iciromaco commited on
Commit
2de9e48
·
1 Parent(s): e1b35ba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -107,7 +107,7 @@ pipe = StableDiffusionImg2ImgPipeline.from_pretrained(
107
  tokenizer=tokenizer,
108
  use_auth_token=True,
109
  crop = True,
110
- ).to("cuda")
111
  pipe.enable_attention_slicing()
112
 
113
 
@@ -118,7 +118,7 @@ def inmm(init_image, prompt):
118
  init_image = init_image.crop(((w - h) // 2,0,(w-h)//2 + h,h))
119
  init_image = init_image.resize(512,512)
120
 
121
- with autocast("cuda"):
122
  image = pipe([prompt], num_inference_steps=50, guidance_scale=7, init_image=init_image)["sample"]
123
  return image[0]
124
 
 
107
  tokenizer=tokenizer,
108
  use_auth_token=True,
109
  crop = True,
110
+ ).to(device)
111
  pipe.enable_attention_slicing()
112
 
113
 
 
118
  init_image = init_image.crop(((w - h) // 2,0,(w-h)//2 + h,h))
119
  init_image = init_image.resize(512,512)
120
 
121
+ with autocast(device):
122
  image = pipe([prompt], num_inference_steps=50, guidance_scale=7, init_image=init_image)["sample"]
123
  return image[0]
124