Spaces:
Runtime error
Runtime error
Update tasks/ref_in.py
Browse files- tasks/ref_in.py +2 -2
tasks/ref_in.py
CHANGED
@@ -69,9 +69,9 @@ def referring_inpainting(model, image, texts, inpainting_text, *args, **kwargs):
|
|
69 |
width = image_crop.size[0]; height = image_crop.size[1]
|
70 |
images_inpainting = pipe(prompt = inpainting_text.strip(), image=image_and_mask['image'], mask_image=image_and_mask['mask'], height=height, width=width).images[0]
|
71 |
# put images_inpainting back to original image
|
72 |
-
image_ori.paste(images_inpainting)
|
73 |
torch.cuda.empty_cache()
|
74 |
-
return Image.fromarray(res) ,'' ,
|
75 |
else:
|
76 |
torch.cuda.empty_cache()
|
77 |
return image_ori, 'text', Image.fromarray(res)
|
|
|
69 |
width = image_crop.size[0]; height = image_crop.size[1]
|
70 |
images_inpainting = pipe(prompt = inpainting_text.strip(), image=image_and_mask['image'], mask_image=image_and_mask['mask'], height=height, width=width).images[0]
|
71 |
# put images_inpainting back to original image
|
72 |
+
# image_ori.paste(images_inpainting)
|
73 |
torch.cuda.empty_cache()
|
74 |
+
return Image.fromarray(res) ,'' , images_inpainting
|
75 |
else:
|
76 |
torch.cuda.empty_cache()
|
77 |
return image_ori, 'text', Image.fromarray(res)
|