Files changed (2) hide show
  1. app.py +11 -4
  2. assets/title.html +1 -12
app.py CHANGED
@@ -190,7 +190,7 @@ def upload_image(image, upload_type, did, ip, user_id, user_name):
190
  upload_url = upload_image_url
191
  else:
192
  upload_url = upload_background_image_url
193
- image_format = "PNG"
194
  mime_type = f"image/{image_format.lower()}"
195
  timestamp = str(int(time.time()))
196
  signature = generate_signature(
@@ -395,7 +395,6 @@ with gr.Blocks(css=css) as WeShop:
395
  gr.Markdown("#### Step 1: Upload a garment image")
396
  main_image_input = gr.Image(
397
  type="pil",
398
- format='png',
399
  label="Main Image",
400
  elem_classes=["image-container", "hide-buttons"]
401
  )
@@ -411,7 +410,6 @@ with gr.Blocks(css=css) as WeShop:
411
  gr.Markdown("#### Step 2: Upload a person image")
412
  background_image_input = gr.Image(
413
  type="pil",
414
- format='png',
415
  label="Background reference image",
416
  elem_classes=["image-container", "hide-buttons"]
417
  )
@@ -428,7 +426,6 @@ with gr.Blocks(css=css) as WeShop:
428
  gr.Markdown("#### Step 3: Press 'Generate' to get the result")
429
  output = gr.Image(
430
  type="pil",
431
- format='png',
432
  label="Result",
433
  elem_classes=["image-container", "hide-buttons"],
434
  interactive=False
@@ -456,4 +453,14 @@ with gr.Blocks(css=css) as WeShop:
456
  inputs=[main_image_input, background_image_input, output],
457
  elem_id="example-res-images",
458
  )
 
 
 
 
 
 
 
 
 
 
459
  WeShop.queue(api_open=False).launch(show_api=False)
 
190
  upload_url = upload_image_url
191
  else:
192
  upload_url = upload_background_image_url
193
+ image_format = image.format if image.format else "PNG"
194
  mime_type = f"image/{image_format.lower()}"
195
  timestamp = str(int(time.time()))
196
  signature = generate_signature(
 
395
  gr.Markdown("#### Step 1: Upload a garment image")
396
  main_image_input = gr.Image(
397
  type="pil",
 
398
  label="Main Image",
399
  elem_classes=["image-container", "hide-buttons"]
400
  )
 
410
  gr.Markdown("#### Step 2: Upload a person image")
411
  background_image_input = gr.Image(
412
  type="pil",
 
413
  label="Background reference image",
414
  elem_classes=["image-container", "hide-buttons"]
415
  )
 
426
  gr.Markdown("#### Step 3: Press 'Generate' to get the result")
427
  output = gr.Image(
428
  type="pil",
 
429
  label="Result",
430
  elem_classes=["image-container", "hide-buttons"],
431
  interactive=False
 
453
  inputs=[main_image_input, background_image_input, output],
454
  elem_id="example-res-images",
455
  )
456
+ main_image_input.upload(
457
+ fn=preprocess_image,
458
+ inputs=[main_image_input],
459
+ outputs=main_image_input
460
+ )
461
+ background_image_input.upload(
462
+ fn=preprocess_background_image,
463
+ inputs=[background_image_input],
464
+ outputs=background_image_input
465
+ )
466
  WeShop.queue(api_open=False).launch(show_api=False)
assets/title.html CHANGED
@@ -85,9 +85,7 @@
85
  <br>
86
  <div class="content-text">
87
  <strong>How It Works: </strong>Digitally dress any model in any garment. Upload a clear image of the
88
- clothing and a photo of your model, and our AI will seamlessly outfit them. Explore more with <a
89
- href="https://www.weshop.ai/tools/virtualtryon" style="font-weight: bold;" target="_blank">WeShopAI
90
- Virtual Try-On</a>.
91
  </div>
92
  <br>
93
  <div class="content-text">
@@ -96,20 +94,11 @@
96
  Key </a>to explore further and leverage these powerful tools.
97
  </div>
98
  <br>
99
- <div class="content-text">
100
- <strong>CLI Skill for AI Agents: </strong>Use the <a
101
- href="https://open.weshop.ai/skill/weshop-cli-skill" style="font-weight: bold;" target="_blank">WeShop
102
- CLI Skill</a> to connect weshop agents with the weshop CLI and automate fashion image generation, image
103
- editing, video creation, virtual try-on workflows, and structured API results for production-ready ecommerce
104
- content.
105
- </div>
106
- <br>
107
  <div class="content-text">
108
  Discover our other powerful AI applications on WeShop AI Spaces at Hugging Face:
109
  <span class="nav-links">
110
  <a href="https://huggingface.co/spaces/WeShopAI/WeShopAI-Fashion-Model-Pose-Change">WeShopAI Fashion Model Pose Change</a>
111
  <a href="https://huggingface.co/spaces/WeShopAI/WeShopAI-Bad-Hand-Fixer">WeShopAI Bad Hand Fixer</a>
112
- <a href="https://huggingface.co/spaces/WeShopAI/WeShopAI-Swap-Face-And-BG">WeShopAI Swap Face & BG</a>
113
  </span>
114
  </div>
115
  <br>
 
85
  <br>
86
  <div class="content-text">
87
  <strong>How It Works: </strong>Digitally dress any model in any garment. Upload a clear image of the
88
+ clothing and a photo of your model, and our AI will seamlessly outfit them.
 
 
89
  </div>
90
  <br>
91
  <div class="content-text">
 
94
  Key </a>to explore further and leverage these powerful tools.
95
  </div>
96
  <br>
 
 
 
 
 
 
 
 
97
  <div class="content-text">
98
  Discover our other powerful AI applications on WeShop AI Spaces at Hugging Face:
99
  <span class="nav-links">
100
  <a href="https://huggingface.co/spaces/WeShopAI/WeShopAI-Fashion-Model-Pose-Change">WeShopAI Fashion Model Pose Change</a>
101
  <a href="https://huggingface.co/spaces/WeShopAI/WeShopAI-Bad-Hand-Fixer">WeShopAI Bad Hand Fixer</a>
 
102
  </span>
103
  </div>
104
  <br>