Akjava commited on
Commit
f186505
·
1 Parent(s): 6f28201
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -79,21 +79,21 @@ def process_images(image, image2=None,prompt="a girl",inpaint_model="black-fores
79
  generators.append(generator)
80
 
81
  width,height = convert_to_fit_size(image.size)
82
- print(f"fit {width}x{height}")
83
  width,height = adjust_to_multiple_of_32(width,height)
84
- print(f"multiple {width}x{height}")
85
  image = image.resize((width, height), Image.LANCZOS)
86
  mask_image = mask_image.resize((width, height), Image.NEAREST)
87
 
88
  output = pipe(prompt=prompt, image=image, mask_image=mask_image,generator=generator,strength=strength,width=width,height=height,
89
  guidance_scale=0,num_inference_steps=num_inference_steps,max_sequence_length=256)
90
 
91
- return output.images[0]
92
 
93
 
94
- output = process_inpaint(image["background"],mask,prompt,inpaint_model,strength,seed)
95
 
96
- return output,mask
97
 
98
 
99
  def read_file(path: str) -> str:
 
79
  generators.append(generator)
80
 
81
  width,height = convert_to_fit_size(image.size)
82
+ #print(f"fit {width}x{height}")
83
  width,height = adjust_to_multiple_of_32(width,height)
84
+ #print(f"multiple {width}x{height}")
85
  image = image.resize((width, height), Image.LANCZOS)
86
  mask_image = mask_image.resize((width, height), Image.NEAREST)
87
 
88
  output = pipe(prompt=prompt, image=image, mask_image=mask_image,generator=generator,strength=strength,width=width,height=height,
89
  guidance_scale=0,num_inference_steps=num_inference_steps,max_sequence_length=256)
90
 
91
+ return output.images[0],mask_image
92
 
93
 
94
+ output,mask_image = process_inpaint(image["background"],mask,prompt,inpaint_model,strength,seed)
95
 
96
+ return output,mask_image
97
 
98
 
99
  def read_file(path: str) -> str: