Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -238,15 +238,6 @@ def create_demo(
|
|
| 238 |
)
|
| 239 |
|
| 240 |
|
| 241 |
-
|
| 242 |
-
# Add project badges
|
| 243 |
-
# badges_text = r"""
|
| 244 |
-
# <div style="text-align: center; display: flex; justify-content: left; gap: 5px;">
|
| 245 |
-
# <a href="https://github.com/bytedance/UNO"><img alt="Build" src="https://img.shields.io/github/stars/bytedance/UNO"></a>
|
| 246 |
-
# <a href="https://bytedance.github.io/UNO/"><img alt="Build" src="https://img.shields.io/badge/Project%20Page-UNO-yellow"></a>
|
| 247 |
-
# <a href="https://arxiv.org/abs/2504.02160"><img alt="Build" src="https://img.shields.io/badge/arXiv%20paper-UNO-b31b1b.svg"></a>
|
| 248 |
-
# </div>
|
| 249 |
-
# """.strip()
|
| 250 |
|
| 251 |
def parse_bboxes(bbox_text):
|
| 252 |
"""Parse bounding box text input"""
|
|
@@ -413,8 +404,30 @@ def create_demo(
|
|
| 413 |
|
| 414 |
# Create Gradio interface
|
| 415 |
with gr.Blocks() as demo:
|
| 416 |
-
gr.Markdown("# WithAnyone Demo")
|
| 417 |
-
# gr.Markdown(badges_text)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 418 |
|
| 419 |
with gr.Row():
|
| 420 |
|
|
|
|
| 238 |
)
|
| 239 |
|
| 240 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 241 |
|
| 242 |
def parse_bboxes(bbox_text):
|
| 243 |
"""Parse bounding box text input"""
|
|
|
|
| 404 |
|
| 405 |
# Create Gradio interface
|
| 406 |
with gr.Blocks() as demo:
|
| 407 |
+
# gr.Markdown("# WithAnyone Demo")
|
| 408 |
+
# # gr.Markdown(badges_text)
|
| 409 |
+
gr.HTML("""
|
| 410 |
+
<div style="text-align: center; max-width: 900px; margin: 0 auto;">
|
| 411 |
+
<h1 style="font-size: 2.0rem; font-weight: 700; display: block;">WithAnyone</h1>
|
| 412 |
+
<h2 style="font-size: 1.5rem; font-weight: 300; margin-bottom: 1rem; display: block;">Official Gradio Demo for <a href="https://github.com/Doby-Xu/WithAnyone/tree/main">WithAnyone: Towards Controllable and ID-Consistent Image Generation</a></h2>
|
| 413 |
+
<a href="https://doby-xu.github.io/WithAnyone/">[Project Page]</a> 
|
| 414 |
+
<a href="https://github.com/Doby-Xu/WithAnyone/tree/main">[Code]</a> 
|
| 415 |
+
<a href="https://huggingface.co/WithAnyone/WithAnyone">[Model]</a> 
|
| 416 |
+
<a href="https://huggingface.co/datasets/WithAnyone/MultiID-Bench">[MultiID-Bench]</a> 
|
| 417 |
+
<a href="https://huggingface.co/datasets/WithAnyone/MultiID-2M">[MultiID-2M]</a>
|
| 418 |
+
</div>
|
| 419 |
+
""")
|
| 420 |
+
|
| 421 |
+
gr.Markdown("""
|
| 422 |
+
### 💡 How to Use This Demo:
|
| 423 |
+
1. **Upload an identity (ID) refernces.** The model will generate images containing the same identities. You can upload 1-4 reference images, each containing one clear human face.
|
| 424 |
+
2. **Provide detailed prompts describing the identity.** Please refer to **Tips** under the Generated Image field. WithAnyone is "controllable", so it needs more information to be controlled.
|
| 425 |
+
3. **[Recommended] Specify bounding boxes for each identity.** You can either:
|
| 426 |
+
- Upload a multi-person image containing all the desired identities, and the system will automatically detect faces and extract bounding boxes. (Recommended for most users)
|
| 427 |
+
- Manually input bounding boxes in the text box (format: x1,y1,x2,y2, one per line). If left empty, the system will automatically generate bounding boxes based on the number of reference images.
|
| 428 |
+
4. **[Recommended] Adjust the "Spiritual Resemblance <--> Formal Resemblance" slider** to balance between preserving identity details and allowing creative freedom. Move it to the right for more resemblance to the reference images, or to the left for more creativity.
|
| 429 |
+
5. **Click the "Generate" button to generate an image.** Enjoy!
|
| 430 |
+
""")
|
| 431 |
|
| 432 |
with gr.Row():
|
| 433 |
|