Gosula commited on
Commit
89321ee
1 Parent(s): 0b59ab7

Update stablediffusion.py

Browse files
Files changed (1) hide show
  1. 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("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)
 
99
  latents = latents * scheduler.init_noise_sigma # Scaling (previous versions did latents = latents * self.scheduler.sigmas[0]
100
 
101
  # Loop
102
+ with autocast("cpu"): # 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)