Spaces:
Sleeping
Sleeping
fix: utility
Browse files
app.py
CHANGED
@@ -189,7 +189,7 @@ def generate(
|
|
189 |
image = utils.get_image_for_img_to_img(pipeline_to_benchmark)
|
190 |
call_args.update({"image": image})
|
191 |
elif "Inpainting" in pipeline_to_benchmark:
|
192 |
-
image, mask_image = utils.
|
193 |
call_args.update({"image": image, "mask_image": mask_image})
|
194 |
elif "ControlNet" in pipeline_to_benchmark:
|
195 |
image = utils.get_image_for_controlnet(pipeline_to_benchmark)
|
|
|
189 |
image = utils.get_image_for_img_to_img(pipeline_to_benchmark)
|
190 |
call_args.update({"image": image})
|
191 |
elif "Inpainting" in pipeline_to_benchmark:
|
192 |
+
image, mask_image = utils.get_image_for_inpainting(pipeline_to_benchmark)
|
193 |
call_args.update({"image": image, "mask_image": mask_image})
|
194 |
elif "ControlNet" in pipeline_to_benchmark:
|
195 |
image = utils.get_image_for_controlnet(pipeline_to_benchmark)
|
utils.py
CHANGED
@@ -12,13 +12,13 @@ def get_image_for_img_to_img(pipeline_to_benchmark):
|
|
12 |
return init_image
|
13 |
|
14 |
|
15 |
-
def
|
16 |
-
if pipeline_to_benchmark == "SD
|
17 |
image_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png"
|
18 |
mask_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png"
|
19 |
init_image = load_image(image_url).convert("RGB").resize((512, 512))
|
20 |
mask_image = load_image(mask_url).convert("RGB").resize((512, 512))
|
21 |
-
elif pipeline_to_benchmark == "SDXL
|
22 |
image_url = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/sdxl-text2img.png"
|
23 |
mask_url = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/sdxl-inpaint-mask.png"
|
24 |
init_image = load_image(image_url).convert("RGB")
|
|
|
12 |
return init_image
|
13 |
|
14 |
|
15 |
+
def get_image_for_inpainting(pipeline_to_benchmark):
|
16 |
+
if pipeline_to_benchmark == "SD Inpainting":
|
17 |
image_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png"
|
18 |
mask_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png"
|
19 |
init_image = load_image(image_url).convert("RGB").resize((512, 512))
|
20 |
mask_image = load_image(mask_url).convert("RGB").resize((512, 512))
|
21 |
+
elif pipeline_to_benchmark == "SDXL Inpainting":
|
22 |
image_url = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/sdxl-text2img.png"
|
23 |
mask_url = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/sdxl-inpaint-mask.png"
|
24 |
init_image = load_image(image_url).convert("RGB")
|