Spaces:
Running
on
Zero
Running
on
Zero
test black
Browse files
app.py
CHANGED
|
@@ -84,13 +84,14 @@ def process_images(image, image2=None,prompt="a girl",inpaint_model="black-fores
|
|
| 84 |
#print(f"multiple {width}x{height}")
|
| 85 |
image = image.resize((width, height), Image.LANCZOS)
|
| 86 |
mask_image = mask_image.resize((width, height), Image.NEAREST)
|
| 87 |
-
|
|
|
|
| 88 |
output = pipe(prompt=prompt, image=image, mask_image=mask_image,generator=generator,strength=strength,width=width,height=height,
|
| 89 |
guidance_scale=0,num_inference_steps=num_inference_steps,max_sequence_length=256)
|
| 90 |
|
| 91 |
return output.images[0],mask_image
|
| 92 |
|
| 93 |
-
|
| 94 |
output,mask_image = process_inpaint(image["background"],mask,prompt,inpaint_model,strength,seed)
|
| 95 |
|
| 96 |
return output,mask_image
|
|
|
|
| 84 |
#print(f"multiple {width}x{height}")
|
| 85 |
image = image.resize((width, height), Image.LANCZOS)
|
| 86 |
mask_image = mask_image.resize((width, height), Image.NEAREST)
|
| 87 |
+
mask_image = mask_image.convert("L")
|
| 88 |
+
print(mask_image.mode)
|
| 89 |
output = pipe(prompt=prompt, image=image, mask_image=mask_image,generator=generator,strength=strength,width=width,height=height,
|
| 90 |
guidance_scale=0,num_inference_steps=num_inference_steps,max_sequence_length=256)
|
| 91 |
|
| 92 |
return output.images[0],mask_image
|
| 93 |
|
| 94 |
+
|
| 95 |
output,mask_image = process_inpaint(image["background"],mask,prompt,inpaint_model,strength,seed)
|
| 96 |
|
| 97 |
return output,mask_image
|