fffiloni commited on
Commit
80b786b
1 Parent(s): b230b71

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -59,6 +59,7 @@ prompt = "high quality"
59
  def fill_image(image, model_selection):
60
 
61
  margin = 100
 
62
  # Open the original image
63
  source = image # Changed from image["background"] to match new input format
64
 
@@ -77,7 +78,10 @@ def fill_image(image, model_selection):
77
  # Create the mask
78
  mask = Image.new('L', output_size, 255) # Start with all white
79
  mask_draw = ImageDraw.Draw(mask)
80
- mask_draw.rectangle([position, (position[0] + source.width, position[1] + source.height)], fill=0)
 
 
 
81
 
82
  # Prepare the image for ControlNet
83
  cnet_image = background.copy()
 
59
  def fill_image(image, model_selection):
60
 
61
  margin = 100
62
+ overlap = 10
63
  # Open the original image
64
  source = image # Changed from image["background"] to match new input format
65
 
 
78
  # Create the mask
79
  mask = Image.new('L', output_size, 255) # Start with all white
80
  mask_draw = ImageDraw.Draw(mask)
81
+ mask_draw.rectangle([
82
+ (position[0] + overlap, position[1] + overlap),
83
+ (position[0] + source.width - overlap, position[1] + source.height - overlap)
84
+ ], fill=0)
85
 
86
  # Prepare the image for ControlNet
87
  cnet_image = background.copy()