Keshabwi66 commited on
Commit
9d2e303
·
verified ·
1 Parent(s): 214875f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -124,7 +124,7 @@ pipe = TryonPipeline.from_pretrained(
124
  pipe.unet_encoder = UNet_Encoder
125
 
126
  @spaces.GPU
127
- def start_tryon(person_img, mask_img, cloth_img, garment_des, denoise_steps, seed):
128
  # Assuming device is set up (e.g., "cuda" or "cpu")
129
  pipe.to(device)
130
  pipe.unet_encoder.to(device)
@@ -222,13 +222,11 @@ with image_blocks as demo:
222
  garment_des = gr.Textbox(placeholder="Description of garment ex) Short Sleeve Round Neck T-shirts", label="Garment Description")
223
 
224
  with gr.Column():
225
- denoise_steps = gr.Number(label="Denoising Steps", minimum=20, maximum=40, value=30, step=1)
226
- seed = gr.Number(label="Seed", minimum=-1, maximum=2147483647, step=1, value=42)
227
 
228
  with gr.Column():
229
  image_out = gr.Image(label="Output Image", elem_id="output-img", show_share_button=False)
230
 
231
  try_button = gr.Button(value="Try-on")
232
- try_button.click(fn=start_tryon, inputs=[person_img, mask_img, cloth_img, garment_des, denoise_steps, seed], outputs=[image_out], api_name='tryon')
233
 
234
  image_blocks.launch()
 
124
  pipe.unet_encoder = UNet_Encoder
125
 
126
  @spaces.GPU
127
+ def start_tryon(person_img, mask_img, cloth_img, garment_des, denoise_steps=10, seed=42):
128
  # Assuming device is set up (e.g., "cuda" or "cpu")
129
  pipe.to(device)
130
  pipe.unet_encoder.to(device)
 
222
  garment_des = gr.Textbox(placeholder="Description of garment ex) Short Sleeve Round Neck T-shirts", label="Garment Description")
223
 
224
  with gr.Column():
 
 
225
 
226
  with gr.Column():
227
  image_out = gr.Image(label="Output Image", elem_id="output-img", show_share_button=False)
228
 
229
  try_button = gr.Button(value="Try-on")
230
+ try_button.click(fn=start_tryon, inputs=[person_img, mask_img, cloth_img, garment_des], outputs=[image_out], api_name='tryon')
231
 
232
  image_blocks.launch()