sayakpaul HF staff commited on
Commit
65034b6
1 Parent(s): 9d71979

change the resizing.

Browse files
Files changed (1) hide show
  1. 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
- negative_prompt = "low quality, bad quality, deformed, low resolution"
52
- added_prompt = " , highest quality, highly realistic, very high resolution"
53
-
54
- return self.pipeline(
55
- prompt=prompt + added_prompt,
56
- negative_prompt=negative_prompt,
57
- image=image,
 
 
 
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]))