Spaces:
AguaL
/
Running on Zero

AguaL commited on
Commit
6204db3
·
1 Parent(s): d568c8b

修复输出结果的比例错误的问题

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -132,7 +132,10 @@ def infer(person,garment,denoise_steps,seed):
132
  pipe.to(device)
133
  pipe.unet_encoder.to(device)
134
 
135
- human_img = person.convert("RGB").resize((768,1024))
 
 
 
136
  garm_img= garment.convert("RGB").resize((768,1024))
137
 
138
  progress(0.1,desc="Mask generating")
@@ -223,8 +226,9 @@ def infer(person,garment,denoise_steps,seed):
223
  guidance_scale=2.0,
224
  callback_on_step_end=callback
225
  )[0]
 
226
  progress(1,desc="Complete")
227
- return images[0]
228
 
229
 
230
  title = "## IDM-VTON"
 
132
  pipe.to(device)
133
  pipe.unet_encoder.to(device)
134
 
135
+ personRGB = person.convert("RGB")
136
+ crop_size = personRGB.size
137
+
138
+ human_img = personRGB.resize((768,1024))
139
  garm_img= garment.convert("RGB").resize((768,1024))
140
 
141
  progress(0.1,desc="Mask generating")
 
226
  guidance_scale=2.0,
227
  callback_on_step_end=callback
228
  )[0]
229
+ out_img = images[0].resize(crop_size)
230
  progress(1,desc="Complete")
231
+ return out_img
232
 
233
 
234
  title = "## IDM-VTON"