Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -65,7 +65,6 @@ def generate(
|
|
65 |
use_img2img: bool = False,
|
66 |
use_controlnet: bool = False,
|
67 |
use_controlnetimg2img: bool = False,
|
68 |
-
url = '',
|
69 |
controlnet_img = '',
|
70 |
controlnet_img2img = '',
|
71 |
):
|
@@ -86,7 +85,9 @@ def generate(
|
|
86 |
if use_img2img:
|
87 |
pipe = AutoPipelineForImage2Image.from_pretrained(model, torch_dtype=torch.float16)
|
88 |
|
89 |
-
|
|
|
|
|
90 |
|
91 |
if use_vae:
|
92 |
vae = AutoencoderKL.from_pretrained(vaecall, torch_dtype=torch.float16)
|
@@ -181,7 +182,7 @@ def generate(
|
|
181 |
elif use_img2img:
|
182 |
images = pipe(
|
183 |
prompt=prompt,
|
184 |
-
image=
|
185 |
strength=strength_img2img,
|
186 |
negative_prompt=negative_prompt,
|
187 |
prompt_2=prompt_2,
|
|
|
65 |
use_img2img: bool = False,
|
66 |
use_controlnet: bool = False,
|
67 |
use_controlnetimg2img: bool = False,
|
|
|
68 |
controlnet_img = '',
|
69 |
controlnet_img2img = '',
|
70 |
):
|
|
|
85 |
if use_img2img:
|
86 |
pipe = AutoPipelineForImage2Image.from_pretrained(model, torch_dtype=torch.float16)
|
87 |
|
88 |
+
img = Image.open(url)
|
89 |
+
img = img.resize((width,height))
|
90 |
+
return img
|
91 |
|
92 |
if use_vae:
|
93 |
vae = AutoencoderKL.from_pretrained(vaecall, torch_dtype=torch.float16)
|
|
|
182 |
elif use_img2img:
|
183 |
images = pipe(
|
184 |
prompt=prompt,
|
185 |
+
image=img,
|
186 |
strength=strength_img2img,
|
187 |
negative_prompt=negative_prompt,
|
188 |
prompt_2=prompt_2,
|