tonyassi commited on
Commit
965c284
1 Parent(s): 3e711ca

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -31,6 +31,8 @@ def generate(image_editor, prompt, neg_prompt, strength, guidance):
31
  image = image_editor['background'].convert('RGB')
32
  image.thumbnail((1024, 1024))
33
  image = divisible_by_8(image)
 
 
34
 
35
 
36
  layer = image_editor["layers"][0].resize(image.size)
@@ -56,6 +58,8 @@ def generate(image_editor, prompt, neg_prompt, strength, guidance):
56
  #strength=strength,
57
  #guidance_scale=guidance).images[0]
58
 
 
 
59
  return image_editor, image, mask, final_image
60
 
61
  with gr.Blocks() as demo:
 
31
  image = image_editor['background'].convert('RGB')
32
  image.thumbnail((1024, 1024))
33
  image = divisible_by_8(image)
34
+
35
+ original_image_size = image.size
36
 
37
 
38
  layer = image_editor["layers"][0].resize(image.size)
 
58
  #strength=strength,
59
  #guidance_scale=guidance).images[0]
60
 
61
+
62
+ final_image = final_image.crop((0, 0, original_image_size.width, original_image_size.height))
63
  return image_editor, image, mask, final_image
64
 
65
  with gr.Blocks() as demo: