Update app.py
Browse files
app.py
CHANGED
@@ -107,7 +107,7 @@ pipe = StableDiffusionImg2ImgPipeline.from_pretrained(
|
|
107 |
tokenizer=tokenizer,
|
108 |
use_auth_token=True,
|
109 |
crop = True,
|
110 |
-
).to(
|
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(
|
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 |
|