Spaces:
Configuration error
Configuration error
公开事件在API文档
Browse files
app.py
CHANGED
|
@@ -273,51 +273,51 @@ def generate_image(
|
|
| 273 |
return images[0], gr.update(visible=True)
|
| 274 |
|
| 275 |
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
with gr.Blocks(css=css) as demo:
|
| 322 |
# description
|
| 323 |
# gr.Markdown(title)
|
|
@@ -437,5 +437,5 @@ with gr.Blocks(css=css) as demo:
|
|
| 437 |
|
| 438 |
# gr.Markdown(article)
|
| 439 |
|
| 440 |
-
demo.queue(
|
| 441 |
demo.launch()
|
|
|
|
| 273 |
return images[0], gr.update(visible=True)
|
| 274 |
|
| 275 |
|
| 276 |
+
### Description
|
| 277 |
+
title = r"""
|
| 278 |
+
<h1 align="center">InstantID: Zero-shot Identity-Preserving Generation in Seconds</h1>
|
| 279 |
+
"""
|
| 280 |
+
|
| 281 |
+
description = r"""
|
| 282 |
+
<b>Official 🤗 Gradio demo</b> for <a href='https://github.com/InstantID/InstantID' target='_blank'><b>InstantID: Zero-shot Identity-Preserving Generation in Seconds</b></a>.<br>
|
| 283 |
+
|
| 284 |
+
How to use:<br>
|
| 285 |
+
1. Upload a person image. For multiple person images, we will only detect the biggest face. Make sure face is not too small and not significantly blocked or blurred.
|
| 286 |
+
2. (Optionally) upload another person image as reference pose. If not uploaded, we will use the first person image to extract landmarks. If you use a cropped face at step1, it is recommeneded to upload it to extract a new pose.
|
| 287 |
+
3. Enter a text prompt as done in normal text-to-image models.
|
| 288 |
+
4. Click the <b>Submit</b> button to start customizing.
|
| 289 |
+
5. Share your customizd photo with your friends, enjoy😊!
|
| 290 |
+
"""
|
| 291 |
+
|
| 292 |
+
article = r"""
|
| 293 |
+
---
|
| 294 |
+
📝 **Citation**
|
| 295 |
+
<br>
|
| 296 |
+
If our work is helpful for your research or applications, please cite us via:
|
| 297 |
+
```bibtex
|
| 298 |
+
@article{wang2024instantid,
|
| 299 |
+
title={InstantID: Zero-shot Identity-Preserving Generation in Seconds},
|
| 300 |
+
author={Wang, Qixun and Bai, Xu and Wang, Haofan and Qin, Zekui and Chen, Anthony},
|
| 301 |
+
journal={arXiv preprint arXiv:2401.07519},
|
| 302 |
+
year={2024}
|
| 303 |
+
}
|
| 304 |
+
```
|
| 305 |
+
📧 **Contact**
|
| 306 |
+
<br>
|
| 307 |
+
If you have any questions, please feel free to open an issue or directly reach us out at <b>haofanwang.ai@gmail.com</b>.
|
| 308 |
+
"""
|
| 309 |
+
|
| 310 |
+
tips = r"""
|
| 311 |
+
### Usage tips of InstantID
|
| 312 |
+
1. If you're unsatisfied with the similarity, increase the weight of controlnet_conditioning_scale (IdentityNet) and ip_adapter_scale (Adapter).
|
| 313 |
+
2. If the generated image is over-saturated, decrease the ip_adapter_scale. If not work, decrease controlnet_conditioning_scale.
|
| 314 |
+
3. If text control is not as expected, decrease ip_adapter_scale.
|
| 315 |
+
4. Find a good base model always makes a difference.
|
| 316 |
+
"""
|
| 317 |
+
|
| 318 |
+
css = """
|
| 319 |
+
.gradio-container {width: 85% !important}
|
| 320 |
+
"""
|
| 321 |
with gr.Blocks(css=css) as demo:
|
| 322 |
# description
|
| 323 |
# gr.Markdown(title)
|
|
|
|
| 437 |
|
| 438 |
# gr.Markdown(article)
|
| 439 |
|
| 440 |
+
demo.queue()
|
| 441 |
demo.launch()
|