Spaces:
Running
Running
Upload 40 files
Browse files- .gitattributes +2 -0
- app.py +40 -3
- assets/examples/1-alibaba-sucai-1.jpg +0 -0
- assets/examples/1-alibaba-sucai-2.jpg +0 -0
- assets/examples/1-output-6.png +0 -0
- assets/examples/1-output-7.png +3 -0
- assets/examples/2-alibaba-sucai-1.jpg +0 -0
- assets/examples/2-output-5.png +3 -0
.gitattributes
CHANGED
|
@@ -52,3 +52,5 @@ assets/examples/3-stylegan2-ffhq-0381.png filter=lfs diff=lfs merge=lfs -text
|
|
| 52 |
assets/examples/Trump-4.jpg filter=lfs diff=lfs merge=lfs -text
|
| 53 |
assets/examples/1-output-4.png filter=lfs diff=lfs merge=lfs -text
|
| 54 |
assets/examples/1-output-5.png filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
| 52 |
assets/examples/Trump-4.jpg filter=lfs diff=lfs merge=lfs -text
|
| 53 |
assets/examples/1-output-4.png filter=lfs diff=lfs merge=lfs -text
|
| 54 |
assets/examples/1-output-5.png filter=lfs diff=lfs merge=lfs -text
|
| 55 |
+
assets/examples/1-output-7.png filter=lfs diff=lfs merge=lfs -text
|
| 56 |
+
assets/examples/2-output-5.png filter=lfs diff=lfs merge=lfs -text
|
app.py
CHANGED
|
@@ -86,6 +86,28 @@ def text_to_single_id_generation_block():
|
|
| 86 |
examples=examples,
|
| 87 |
inputs=[prompt, pil_faceid, pil_style, example_output],
|
| 88 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 89 |
ips = [
|
| 90 |
pil_faceid, pil_supp_faceids,
|
| 91 |
pil_mix_faceid_1, mix_scale_1,
|
|
@@ -161,6 +183,13 @@ def text_to_multi_id_generation_block():
|
|
| 161 |
format="png")
|
| 162 |
with gr.Row():
|
| 163 |
examples = [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 164 |
[
|
| 165 |
"The two women are captured in laughter and joy, their faces brimming with sincere happiness against the backdrop of a peaceful beach at sunset. The painting, depicted in soft style, captures the warmth and tranquility of the moment.",
|
| 166 |
"assets/examples/2-stylegan2-ffhq-0100.png",
|
|
@@ -177,7 +206,7 @@ def text_to_multi_id_generation_block():
|
|
| 177 |
],
|
| 178 |
]
|
| 179 |
gr.Examples(
|
| 180 |
-
label="Examples",
|
| 181 |
examples=examples,
|
| 182 |
inputs=[prompt, pil_faceid_1st, pil_faceid_2nd, pil_style, example_output],
|
| 183 |
)
|
|
@@ -324,7 +353,7 @@ if __name__ == "__main__":
|
|
| 324 |
|
| 325 |
title_description = r"""
|
| 326 |
This is the <b>official π€ Gradio demo</b> for <a href='https://arxiv.org/pdf/2408.05939' target='_blank'><b>UniPortrait: A Unified Framework for Identity-Preserving Single- and Multi-Human Image Personalization</b></a>.<br>
|
| 327 |
-
The demo provides three capabilities: text-to-single-ID personalization, text-to-multi-ID personalization, and image-to-single-ID personalization. All of these are based on the Stable Diffusion v1-5 model. Feel free to give them a try! π
|
| 328 |
"""
|
| 329 |
|
| 330 |
text_to_single_id_description = r"""πππQuick start:<br>
|
|
@@ -363,10 +392,16 @@ if __name__ == "__main__":
|
|
| 363 |
<br>
|
| 364 |
If our work is helpful for your research or applications, please cite us via:
|
| 365 |
```bibtex
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 366 |
```
|
| 367 |
π§ **Contact**
|
| 368 |
<br>
|
| 369 |
-
If you have any questions, please feel free to open an issue or directly reach us out at <b>
|
| 370 |
"""
|
| 371 |
|
| 372 |
block = gr.Blocks(title="UniPortrait").queue()
|
|
@@ -383,6 +418,8 @@ if __name__ == "__main__":
|
|
| 383 |
with gr.TabItem("Image-to-Single-ID (Stylization)"):
|
| 384 |
image_to_single_id_generation_block()
|
| 385 |
|
|
|
|
|
|
|
| 386 |
block.launch(share=True, max_threads=10)
|
| 387 |
# block.launch(server_name='0.0.0.0', share=False, server_port=9999, allowed_paths=["/"])
|
| 388 |
# block.launch(server_name='127.0.0.1', share=False, server_port=9999, allowed_paths=["/"])
|
|
|
|
| 86 |
examples=examples,
|
| 87 |
inputs=[prompt, pil_faceid, pil_style, example_output],
|
| 88 |
)
|
| 89 |
+
with gr.Row():
|
| 90 |
+
examples = [
|
| 91 |
+
[
|
| 92 |
+
"A woman, vector art, flat illustration, pastel color",
|
| 93 |
+
"assets/examples/1-alibaba-sucai-1.jpg",
|
| 94 |
+
0.5,
|
| 95 |
+
0.0,
|
| 96 |
+
"assets/examples/1-output-6.png",
|
| 97 |
+
],
|
| 98 |
+
[
|
| 99 |
+
"A woman, comic book style, pastel color",
|
| 100 |
+
"assets/examples/1-alibaba-sucai-2.jpg",
|
| 101 |
+
0.5,
|
| 102 |
+
0.0,
|
| 103 |
+
"assets/examples/1-output-7.png",
|
| 104 |
+
],
|
| 105 |
+
]
|
| 106 |
+
gr.Examples(
|
| 107 |
+
label="Advanced Examples",
|
| 108 |
+
examples=examples,
|
| 109 |
+
inputs=[prompt, pil_faceid, faceid_scale, face_structure_scale, example_output],
|
| 110 |
+
)
|
| 111 |
ips = [
|
| 112 |
pil_faceid, pil_supp_faceids,
|
| 113 |
pil_mix_faceid_1, mix_scale_1,
|
|
|
|
| 183 |
format="png")
|
| 184 |
with gr.Row():
|
| 185 |
examples = [
|
| 186 |
+
[
|
| 187 |
+
"Two beautiful women are drinking coffee.",
|
| 188 |
+
"assets/examples/1-alibaba-sucai-2.jpg",
|
| 189 |
+
"assets/examples/2-alibaba-sucai-1.jpg",
|
| 190 |
+
"assets/No-Image-Placeholder.png",
|
| 191 |
+
"assets/examples/2-output-5.png",
|
| 192 |
+
],
|
| 193 |
[
|
| 194 |
"The two women are captured in laughter and joy, their faces brimming with sincere happiness against the backdrop of a peaceful beach at sunset. The painting, depicted in soft style, captures the warmth and tranquility of the moment.",
|
| 195 |
"assets/examples/2-stylegan2-ffhq-0100.png",
|
|
|
|
| 206 |
],
|
| 207 |
]
|
| 208 |
gr.Examples(
|
| 209 |
+
label="Advanced Examples",
|
| 210 |
examples=examples,
|
| 211 |
inputs=[prompt, pil_faceid_1st, pil_faceid_2nd, pil_style, example_output],
|
| 212 |
)
|
|
|
|
| 353 |
|
| 354 |
title_description = r"""
|
| 355 |
This is the <b>official π€ Gradio demo</b> for <a href='https://arxiv.org/pdf/2408.05939' target='_blank'><b>UniPortrait: A Unified Framework for Identity-Preserving Single- and Multi-Human Image Personalization</b></a>.<br>
|
| 356 |
+
The demo provides three capabilities: text-to-single-ID personalization, text-to-multi-ID personalization, and image-to-single-ID personalization. All of these are based on the <b>Stable Diffusion v1-5</b> model. Feel free to give them a try! π
|
| 357 |
"""
|
| 358 |
|
| 359 |
text_to_single_id_description = r"""πππQuick start:<br>
|
|
|
|
| 392 |
<br>
|
| 393 |
If our work is helpful for your research or applications, please cite us via:
|
| 394 |
```bibtex
|
| 395 |
+
@article{he2024uniportrait,
|
| 396 |
+
title={UniPortrait: A Unified Framework for Identity-Preserving Single-and Multi-Human Image Personalization},
|
| 397 |
+
author={He, Junjie and Geng, Yifeng and Bo, Liefeng},
|
| 398 |
+
journal={arXiv preprint arXiv:2408.05939},
|
| 399 |
+
year={2024}
|
| 400 |
+
}
|
| 401 |
```
|
| 402 |
π§ **Contact**
|
| 403 |
<br>
|
| 404 |
+
If you have any questions, please feel free to open an issue or directly reach us out at <b>hejunjie1103@gmail.com</b>.
|
| 405 |
"""
|
| 406 |
|
| 407 |
block = gr.Blocks(title="UniPortrait").queue()
|
|
|
|
| 418 |
with gr.TabItem("Image-to-Single-ID (Stylization)"):
|
| 419 |
image_to_single_id_generation_block()
|
| 420 |
|
| 421 |
+
gr.Markdown(citation)
|
| 422 |
+
|
| 423 |
block.launch(share=True, max_threads=10)
|
| 424 |
# block.launch(server_name='0.0.0.0', share=False, server_port=9999, allowed_paths=["/"])
|
| 425 |
# block.launch(server_name='127.0.0.1', share=False, server_port=9999, allowed_paths=["/"])
|
assets/examples/1-alibaba-sucai-1.jpg
ADDED
|
assets/examples/1-alibaba-sucai-2.jpg
ADDED
|
assets/examples/1-output-6.png
ADDED
|
assets/examples/1-output-7.png
ADDED
|
Git LFS Details
|
assets/examples/2-alibaba-sucai-1.jpg
ADDED
|
assets/examples/2-output-5.png
ADDED
|
Git LFS Details
|