Spaces:
Runtime error
Runtime error
change the resizing.
Browse files- text_to_image_inpainting.py +13 -9
text_to_image_inpainting.py
CHANGED
@@ -47,13 +47,17 @@ class InpaintingTool(Tool):
|
|
47 |
def __call__(self, image, mask_image, prompt):
|
48 |
if not self.is_initialized:
|
49 |
self.setup()
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
|
|
|
|
|
|
58 |
mask_image=mask_image
|
59 |
-
).images[0]
|
|
|
|
47 |
def __call__(self, image, mask_image, prompt):
|
48 |
if not self.is_initialized:
|
49 |
self.setup()
|
50 |
+
|
51 |
+
resized_image = image.resize((512, 512))
|
52 |
+
mask_image = mask_image.resize((512, 512))
|
53 |
+
# negative_prompt = "low quality, bad quality, deformed, low resolution"
|
54 |
+
# added_prompt = " , highest quality, highly realistic, very high resolution"
|
55 |
+
|
56 |
+
inpainted_image = self.pipeline(
|
57 |
+
# prompt=prompt + added_prompt,
|
58 |
+
# negative_prompt=negative_prompt,
|
59 |
+
prompt=prompt,
|
60 |
+
image=resized_image,
|
61 |
mask_image=mask_image
|
62 |
+
).images[0]
|
63 |
+
return inpainted_image.resize((image.size[0], image.size[1]))
|