Updated the demo and API docs for the latest API release with support of clothing-only images (on ghost mannequins or flat lay photos)
Browse files- README.md +1 -1
- app.py +3 -3
- docs/API.md +28 -7
- docs/images/clothing_image_05.jpg +3 -0
- docs/images/clothing_image_06.jpg +3 -0
- docs/images/clothing_modification_result_01.jpg +3 -0
- docs/images/clothing_modification_result_02.jpg +3 -0
- docs/images/image_based_result_02.jpg +3 -0
- examples/clothing/female_05.jpg +2 -2
- examples/clothing/female_07.jpg +3 -0
- examples/clothing/female_08.jpg +3 -0
- examples/clothing/female_09.jpg +3 -0
- examples/clothing/male_07.jpg +3 -0
- examples/clothing/male_08.jpg +3 -0
- examples/clothing/male_09.jpg +3 -0
README.md
CHANGED
|
@@ -4,7 +4,7 @@ emoji: 👗
|
|
| 4 |
colorFrom: indigo
|
| 5 |
colorTo: purple
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version: 5.
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
short_description: Diffusion-based multi-modal virtual try-on pipeline demo
|
|
|
|
| 4 |
colorFrom: indigo
|
| 5 |
colorTo: purple
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: 5.9.0
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
short_description: Diffusion-based multi-modal virtual try-on pipeline demo
|
app.py
CHANGED
|
@@ -133,7 +133,7 @@ with gr.Blocks(theme=gr.themes.Soft(), delete_cache=(3600, 3600)) as app:
|
|
| 133 |
clothing_image = gr.Image(label="Clothing Image", sources=["upload"], type="numpy")
|
| 134 |
|
| 135 |
clothing_image_examples = gr.Examples(
|
| 136 |
-
inputs=clothing_image, examples_per_page=
|
| 137 |
)
|
| 138 |
|
| 139 |
with gr.Tab("Prompt"):
|
|
@@ -175,7 +175,7 @@ with gr.Blocks(theme=gr.themes.Soft(), delete_cache=(3600, 3600)) as app:
|
|
| 175 |
|
| 176 |
avatar_image_examples = gr.Examples(
|
| 177 |
inputs=avatar_image,
|
| 178 |
-
examples_per_page=
|
| 179 |
examples=get_examples("avatar"),
|
| 180 |
)
|
| 181 |
|
|
@@ -224,7 +224,7 @@ with gr.Blocks(theme=gr.themes.Soft(), delete_cache=(3600, 3600)) as app:
|
|
| 224 |
background_image = gr.Image(label="Background Image", sources=["upload"], type="numpy")
|
| 225 |
|
| 226 |
background_image_examples = gr.Examples(
|
| 227 |
-
inputs=background_image, examples_per_page=
|
| 228 |
)
|
| 229 |
|
| 230 |
with gr.Tab("Prompt"):
|
|
|
|
| 133 |
clothing_image = gr.Image(label="Clothing Image", sources=["upload"], type="numpy")
|
| 134 |
|
| 135 |
clothing_image_examples = gr.Examples(
|
| 136 |
+
inputs=clothing_image, examples_per_page=18, examples=get_examples("clothing")
|
| 137 |
)
|
| 138 |
|
| 139 |
with gr.Tab("Prompt"):
|
|
|
|
| 175 |
|
| 176 |
avatar_image_examples = gr.Examples(
|
| 177 |
inputs=avatar_image,
|
| 178 |
+
examples_per_page=18,
|
| 179 |
examples=get_examples("avatar"),
|
| 180 |
)
|
| 181 |
|
|
|
|
| 224 |
background_image = gr.Image(label="Background Image", sources=["upload"], type="numpy")
|
| 225 |
|
| 226 |
background_image_examples = gr.Examples(
|
| 227 |
+
inputs=background_image, examples_per_page=18, examples=get_examples("background")
|
| 228 |
)
|
| 229 |
|
| 230 |
with gr.Tab("Prompt"):
|
docs/API.md
CHANGED
|
@@ -21,11 +21,13 @@
|
|
| 21 |
* [Image-based virtual try-on with background](#image-based-virtual-try-on-with-background)
|
| 22 |
* [Avatar from a text prompt](#avatar-from-a-text-prompt)
|
| 23 |
* [Clothing from a text prompt](#clothing-from-a-text-prompt)
|
|
|
|
| 24 |
* [Modifying avatar's body](#modifying-avatars-body)
|
| 25 |
* [Txt2Img](#txt2img)
|
| 26 |
* [Other creative possibilities](#other-creative-possibilities)
|
| 27 |
* [Performance](#performance)
|
| 28 |
* [Known Issues and Limitations](#known-issues-and-limitations)
|
|
|
|
| 29 |
<!-- TOC -->
|
| 30 |
|
| 31 |
## Summary
|
|
@@ -114,7 +116,7 @@ For best results clothing reference images should meet a number of requirements:
|
|
| 114 |
- Maximum file size: **12 MB**
|
| 115 |
- Minimum image size: **256x256**
|
| 116 |
- Recommended image size: **768x1024 and above**
|
| 117 |
-
-
|
| 118 |
- **Single person** on the image (though multiple persons might also work)
|
| 119 |
- **Frontal** photo, though some degree of rotation is fine
|
| 120 |
- **Good lighting** conditions and **high image quality** as it directly affects the result
|
|
@@ -124,8 +126,8 @@ To summarize: the better is the clothing image the better is the final result.
|
|
| 124 |
|
| 125 |
Examples of good clothing images:
|
| 126 |
|
| 127 |
-
| <img src="images/clothing_image_01.jpg" width="240"> | <img src="images/clothing_image_02.jpg" width="240"> | <img src="images/clothing_image_03.jpg" width="240"> | <img src="images/clothing_image_04.jpg" width="240"> |
|
| 128 |
-
|
| 129 |
|
| 130 |
### Clothing prompt
|
| 131 |
|
|
@@ -243,6 +245,7 @@ user avatar) while maintaining the avatar and the background.
|
|
| 243 |
| Clothing Image | Avatar Image | Result Image |
|
| 244 |
|------------------------------------------------------|----------------------------------------------------|----------------------------------------------------------|
|
| 245 |
| <img src="images/clothing_image_01.jpg" width="240"> | <img src="images/avatar_image_02.jpg" width="240"> | <img src="images/image_based_result_01.jpg" width="240"> |
|
|
|
|
| 246 |
|
| 247 |
### Image-based virtual try-on with background
|
| 248 |
|
|
@@ -283,6 +286,15 @@ Similarly, you can specify clothing with a text prompt while providing an avatar
|
|
| 283 |
| a sheer blue sleeveless mini dress | <img src="images/avatar_image_02.jpg" width="240"> | <img src="images/clothing_prompt_result_01.jpg" width="240"> |
|
| 284 |
| a colorful t-shirt and black shorts | <img src="images/avatar_image_03.jpg" width="240"> | <img src="images/clothing_prompt_result_02.jpg" width="240"> |
|
| 285 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 286 |
### Modifying avatar's body
|
| 287 |
|
| 288 |
If you specify clothing and avatar images to be the same while providing an avatar prompt it's possible to change
|
|
@@ -315,9 +327,9 @@ replace the background in a creative way:
|
|
| 315 |
It's also possible to use a combination of clothing image, clothing prompt, avatar image and a background to add some
|
| 316 |
accessories:
|
| 317 |
|
| 318 |
-
| Clothing Image | Clothing Prompt | Avatar Image | Background Image | Result Image
|
| 319 |
-
|
| 320 |
-
| <img src="images/avatar_image_02.jpg" width="240"> | a (light brown purse)+++ | <img src="images/avatar_image_02.jpg" width="240"> | <img src="images/background_image_03.jpg" width="240"> | <img src="images/accessory_result_01.jpg" width="240">
|
| 321 |
|
| 322 |
## Performance
|
| 323 |
|
|
@@ -337,5 +349,14 @@ As any generative model, our models are not perfect (though we constantly work o
|
|
| 337 |
- Currently, we do not support trying on a single garment, only the full look.
|
| 338 |
- Hats and sunglasses are not currently transferred, but we are working on it.
|
| 339 |
- Backgrounds might lack some clarity as currently we focus more on clothing.
|
| 340 |
-
- In case of a specified background a hairstyle might change.
|
| 341 |
- Body shape of the avatar might change towards smaller sizes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
* [Image-based virtual try-on with background](#image-based-virtual-try-on-with-background)
|
| 22 |
* [Avatar from a text prompt](#avatar-from-a-text-prompt)
|
| 23 |
* [Clothing from a text prompt](#clothing-from-a-text-prompt)
|
| 24 |
+
* [Modifying clothing](#modifying-clothing)
|
| 25 |
* [Modifying avatar's body](#modifying-avatars-body)
|
| 26 |
* [Txt2Img](#txt2img)
|
| 27 |
* [Other creative possibilities](#other-creative-possibilities)
|
| 28 |
* [Performance](#performance)
|
| 29 |
* [Known Issues and Limitations](#known-issues-and-limitations)
|
| 30 |
+
* [Changelog](#changelog)
|
| 31 |
<!-- TOC -->
|
| 32 |
|
| 33 |
## Summary
|
|
|
|
| 116 |
- Maximum file size: **12 MB**
|
| 117 |
- Minimum image size: **256x256**
|
| 118 |
- Recommended image size: **768x1024 and above**
|
| 119 |
+
- For best results clothing should be **dressed on a person** or **on a ghost mannequin**. Some flat lay clothing photos might work too, but currently it's not guaranteed.
|
| 120 |
- **Single person** on the image (though multiple persons might also work)
|
| 121 |
- **Frontal** photo, though some degree of rotation is fine
|
| 122 |
- **Good lighting** conditions and **high image quality** as it directly affects the result
|
|
|
|
| 126 |
|
| 127 |
Examples of good clothing images:
|
| 128 |
|
| 129 |
+
| <img src="images/clothing_image_01.jpg" width="240"> | <img src="images/clothing_image_02.jpg" width="240"> | <img src="images/clothing_image_03.jpg" width="240"> | <img src="images/clothing_image_04.jpg" width="240"> | <img src="images/clothing_image_05.jpg" width="240"> | <img src="images/clothing_image_06.jpg" width="240"> |
|
| 130 |
+
|------------------------------------------------------|------------------------------------------------------|------------------------------------------------------|------------------------------------------------------|------------------------------------------------------|------------------------------------------------------|
|
| 131 |
|
| 132 |
### Clothing prompt
|
| 133 |
|
|
|
|
| 245 |
| Clothing Image | Avatar Image | Result Image |
|
| 246 |
|------------------------------------------------------|----------------------------------------------------|----------------------------------------------------------|
|
| 247 |
| <img src="images/clothing_image_01.jpg" width="240"> | <img src="images/avatar_image_02.jpg" width="240"> | <img src="images/image_based_result_01.jpg" width="240"> |
|
| 248 |
+
| <img src="images/clothing_image_05.jpg" width="240"> | <img src="images/avatar_image_02.jpg" width="240"> | <img src="images/image_based_result_02.jpg" width="240"> |
|
| 249 |
|
| 250 |
### Image-based virtual try-on with background
|
| 251 |
|
|
|
|
| 286 |
| a sheer blue sleeveless mini dress | <img src="images/avatar_image_02.jpg" width="240"> | <img src="images/clothing_prompt_result_01.jpg" width="240"> |
|
| 287 |
| a colorful t-shirt and black shorts | <img src="images/avatar_image_03.jpg" width="240"> | <img src="images/clothing_prompt_result_02.jpg" width="240"> |
|
| 288 |
|
| 289 |
+
### Modifying clothing
|
| 290 |
+
|
| 291 |
+
It's possible to modify clothing to some extent using a clothing image and a clothing prompt simultaneously:
|
| 292 |
+
|
| 293 |
+
| Clothing Image | Clothing prompt | Avatar Image | Result Image |
|
| 294 |
+
|------------------------------------------------------|-------------------|----------------------------------------------------|--------------------------------------------------------------------|
|
| 295 |
+
| <img src="images/clothing_image_06.jpg" width="240"> | (long sleeves)+++ | <img src="images/avatar_image_03.jpg" width="240"> | <img src="images/clothing_modification_result_01.jpg" width="240"> |
|
| 296 |
+
| <img src="images/clothing_image_03.jpg" width="240"> | shorts+++ | <img src="images/avatar_image_04.jpg" width="240"> | <img src="images/clothing_modification_result_02.jpg" width="240"> |
|
| 297 |
+
|
| 298 |
### Modifying avatar's body
|
| 299 |
|
| 300 |
If you specify clothing and avatar images to be the same while providing an avatar prompt it's possible to change
|
|
|
|
| 327 |
It's also possible to use a combination of clothing image, clothing prompt, avatar image and a background to add some
|
| 328 |
accessories:
|
| 329 |
|
| 330 |
+
| Clothing Image | Clothing Prompt | Avatar Image | Background Image | Result Image |
|
| 331 |
+
|------------------------------------------------------|--------------------------|------------------------------------------------------|--------------------------------------------------------|--------------------------------------------------------|
|
| 332 |
+
| <img src="images/avatar_image_02.jpg" width="240"> | a (light brown purse)+++ | <img src="images/avatar_image_02.jpg" width="240"> | <img src="images/background_image_03.jpg" width="240"> | <img src="images/accessory_result_01.jpg" width="240"> |
|
| 333 |
|
| 334 |
## Performance
|
| 335 |
|
|
|
|
| 349 |
- Currently, we do not support trying on a single garment, only the full look.
|
| 350 |
- Hats and sunglasses are not currently transferred, but we are working on it.
|
| 351 |
- Backgrounds might lack some clarity as currently we focus more on clothing.
|
| 352 |
+
- In case of a specified background a hairstyle might slightly change.
|
| 353 |
- Body shape of the avatar might change towards smaller sizes.
|
| 354 |
+
|
| 355 |
+
## Changelog
|
| 356 |
+
|
| 357 |
+
The changelog below contains major API updates focusing on new features and other improvements.
|
| 358 |
+
|
| 359 |
+
- **2024-12-15**: New API release brings support for clothing on ghost mannequins and (partially) flat lay clothing
|
| 360 |
+
photos.
|
| 361 |
+
|
| 362 |
+
- **2024-11-07**: Initial public API release.
|
docs/images/clothing_image_05.jpg
ADDED
|
Git LFS Details
|
docs/images/clothing_image_06.jpg
ADDED
|
Git LFS Details
|
docs/images/clothing_modification_result_01.jpg
ADDED
|
Git LFS Details
|
docs/images/clothing_modification_result_02.jpg
ADDED
|
Git LFS Details
|
docs/images/image_based_result_02.jpg
ADDED
|
Git LFS Details
|
examples/clothing/female_05.jpg
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
examples/clothing/female_07.jpg
ADDED
|
Git LFS Details
|
examples/clothing/female_08.jpg
ADDED
|
Git LFS Details
|
examples/clothing/female_09.jpg
ADDED
|
Git LFS Details
|
examples/clothing/male_07.jpg
ADDED
|
Git LFS Details
|
examples/clothing/male_08.jpg
ADDED
|
Git LFS Details
|
examples/clothing/male_09.jpg
ADDED
|
Git LFS Details
|