LuChengTHU commited on
Commit
a849e1d
β€’
1 Parent(s): 11a403f
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -85,7 +85,7 @@ def inference(model_name, prompt, guidance, steps, width=512, height=512, seed=0
85
  current_model = model
86
  model_path = current_model.path
87
 
88
- generator = torch.Generator('cuda').manual_seed(seed) if seed != 0 else None
89
 
90
  if img is not None:
91
  return img_to_img(model_path, prompt, neg_prompt, img, strength, guidance, steps, width, height, generator)
 
85
  current_model = model
86
  model_path = current_model.path
87
 
88
+ generator = torch.Generator('cuda' if torch.cuda.is_available() else 'cpu').manual_seed(seed) if seed != 0 else None
89
 
90
  if img is not None:
91
  return img_to_img(model_path, prompt, neg_prompt, img, strength, guidance, steps, width, height, generator)