Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -28,13 +28,13 @@ def main(image, prompt, percent_noise): # percent_noise = 0.5, 0.02, 0.999
|
|
28 |
z = pipe.scheduler.add_noise(clean_z, noise, timestep).half()
|
29 |
|
30 |
# Run the diffusion model
|
31 |
-
with autocast('cuda'):
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
|
39 |
|
40 |
|
|
|
28 |
z = pipe.scheduler.add_noise(clean_z, noise, timestep).half()
|
29 |
|
30 |
# Run the diffusion model
|
31 |
+
#with autocast('cuda'):
|
32 |
+
# The 'num_inference_steps=100' arguments means that, if you were running
|
33 |
+
# the full diffusion model (i.e., percent_noise = 0.999), it would be sampling
|
34 |
+
# at 2x frequency compared to the normal stable diffusion model (which uses 50 steps).
|
35 |
+
# This way, running percent_noise = 0.5 yields 50 inference steps,
|
36 |
+
# and running percent_noise = 0.2 yields 20 inference steps, etc.
|
37 |
+
return pipe(prompt=prompt, latents=z, num_inference_steps=100, percent_noise=percent_noise).images[0]
|
38 |
|
39 |
|
40 |
|