anzorq commited on
Commit
d7673a6
1 Parent(s): 5210bf9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -130,7 +130,7 @@ def txt_to_img(model_path, prompt, neg_prompt, guidance, steps, width, height, g
130
  if is_colab or current_model == custom_model:
131
  pipe = StableDiffusionPipeline.from_pretrained(current_model_path, torch_dtype=torch.float16, scheduler=scheduler, safety_checker=lambda images, clip_input: (images, False))
132
  else:
133
- pipe.to("cpu")
134
  pipe = current_model.pipe_t2i
135
 
136
  if torch.cuda.is_available():
@@ -163,7 +163,7 @@ def img_to_img(model_path, prompt, neg_prompt, img, strength, guidance, steps, w
163
  if is_colab or current_model == custom_model:
164
  pipe = StableDiffusionImg2ImgPipeline.from_pretrained(current_model_path, torch_dtype=torch.float16, scheduler=scheduler, safety_checker=lambda images, clip_input: (images, False))
165
  else:
166
- pipe.to("cpu")
167
  pipe = current_model.pipe_i2i
168
 
169
  if torch.cuda.is_available():
 
130
  if is_colab or current_model == custom_model:
131
  pipe = StableDiffusionPipeline.from_pretrained(current_model_path, torch_dtype=torch.float16, scheduler=scheduler, safety_checker=lambda images, clip_input: (images, False))
132
  else:
133
+ pipe = pipe.to("cpu")
134
  pipe = current_model.pipe_t2i
135
 
136
  if torch.cuda.is_available():
 
163
  if is_colab or current_model == custom_model:
164
  pipe = StableDiffusionImg2ImgPipeline.from_pretrained(current_model_path, torch_dtype=torch.float16, scheduler=scheduler, safety_checker=lambda images, clip_input: (images, False))
165
  else:
166
+ pipe = pipe.to("cpu")
167
  pipe = current_model.pipe_i2i
168
 
169
  if torch.cuda.is_available():