profaker commited on
Commit
ccc12ba
·
verified ·
1 Parent(s): 652265d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -7
app.py CHANGED
@@ -73,13 +73,19 @@ def predict(dict, prompt="", negative_prompt="", guidance_scale=7.5, steps=30, s
73
  strength=strength,
74
  clip_skip=1
75
  )
76
- print("Positive:",prompt)
77
- print("Negative:",negative_prompt)
78
- print("Guidance_scale:",guidance_scale)
79
- print("Steps:",steps)
80
- print("Strength:",strength)
81
- print("Scheduler:",scheduler)
82
- return output.images[0].resize(init_image.size, resample=Image.LANCZOS), gr.update(visible=True)
 
 
 
 
 
 
83
 
84
 
85
  css = '''
 
73
  strength=strength,
74
  clip_skip=1
75
  )
76
+ inpainted_image = output.images[0]
77
+
78
+ # Combine the original and inpainted images using the mask
79
+ combined_image = Image.composite(inpainted_image, init_image, mask_image.split()[3])
80
+
81
+ print("Positive:", prompt)
82
+ print("Negative:", negative_prompt)
83
+ print("Guidance_scale:", guidance_scale)
84
+ print("Steps:", steps)
85
+ print("Strength:", strength)
86
+ print("Scheduler:", scheduler)
87
+
88
+ return combined_image.resize(init_image.size, resample=Image.LANCZOS), gr.update(visible=True)
89
 
90
 
91
  css = '''