Spaces:
Runtime error
Runtime error
Update stablediffusion.py
Browse files- stablediffusion.py +1 -1
stablediffusion.py
CHANGED
@@ -99,7 +99,7 @@ def generate_image(prompt,concept_embed,num_inference_steps=50,color_postprocess
|
|
99 |
latents = latents * scheduler.init_noise_sigma # Scaling (previous versions did latents = latents * self.scheduler.sigmas[0]
|
100 |
|
101 |
# Loop
|
102 |
-
with autocast("
|
103 |
for i, t in tqdm(enumerate(scheduler.timesteps), total=len(scheduler.timesteps)):
|
104 |
# expand the latents if we are doing classifier-free guidance to avoid doing two forward passes.
|
105 |
latent_model_input = torch.cat([latents] * 2)
|
|
|
99 |
latents = latents * scheduler.init_noise_sigma # Scaling (previous versions did latents = latents * self.scheduler.sigmas[0]
|
100 |
|
101 |
# Loop
|
102 |
+
with autocast("cuda"): # will fallback to CPU if no CUDA; no autocast for MPS
|
103 |
for i, t in tqdm(enumerate(scheduler.timesteps), total=len(scheduler.timesteps)):
|
104 |
# expand the latents if we are doing classifier-free guidance to avoid doing two forward passes.
|
105 |
latent_model_input = torch.cat([latents] * 2)
|