Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,85 @@
|
|
1 |
-
---
|
2 |
-
license: apache-2.0
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
language:
|
4 |
+
- en
|
5 |
+
library_name: diffusers
|
6 |
+
pipeline_tag: text-to-image
|
7 |
+
---
|
8 |
+
|
9 |
+
# PhotoMaker V2 Model Card
|
10 |
+
|
11 |
+
<div align="center">
|
12 |
+
|
13 |
+
[**Project Page**](https://photo-maker.github.io/) **|** [**Paper (ArXiv)**](https://arxiv.org/abs/2312.04461) **|** [**Code**](https://github.com/TencentARC/PhotoMaker)
|
14 |
+
|
15 |
+
[🤗 **Gradio demo**](https://huggingface.co/spaces/TencentARC/PhotoMaker-V2)
|
16 |
+
|
17 |
+
</div>
|
18 |
+
|
19 |
+
## Introduction
|
20 |
+
|
21 |
+
<!-- Provide a quick summary of what the model is/does. -->
|
22 |
+
Users can input one or a few face photos, along with a text prompt, to receive a customized photo or painting within seconds (no training required!). Additionally, this model can be adapted to any base model based on SDXL or used in conjunction with other LoRA modules.
|
23 |
+
|
24 |
+
### Realistic results
|
25 |
+
|
26 |
+
![image/jpeg](https://cdn-uploads.huggingface.co/production/uploads/6285a9133ab6642179158944/BYBZNyfmN4jBKBxxt4uxz.jpeg)
|
27 |
+
|
28 |
+
![image/jpeg](https://cdn-uploads.huggingface.co/production/uploads/6285a9133ab6642179158944/9KYqoDxfbNVLzVKZzSzwo.jpeg)
|
29 |
+
|
30 |
+
### Stylization results
|
31 |
+
|
32 |
+
![image/jpeg](https://cdn-uploads.huggingface.co/production/uploads/6285a9133ab6642179158944/du884lcjpqqjnJIxpATM2.jpeg)
|
33 |
+
|
34 |
+
|
35 |
+
![image/jpeg](https://cdn-uploads.huggingface.co/production/uploads/6285a9133ab6642179158944/-AC7Hr5YL4yW1zXGe_Izl.jpeg)
|
36 |
+
|
37 |
+
More results can be found in our [project page](https://photo-maker.github.io/)
|
38 |
+
|
39 |
+
## Model Details
|
40 |
+
|
41 |
+
It mainly contains two parts corresponding to two keys in loaded state dict:
|
42 |
+
|
43 |
+
1. `id_encoder` includes finetuned OpenCLIP-ViT-H-14 and a few fuse layers.
|
44 |
+
|
45 |
+
2. `lora_weights` applies to all attention layers in the UNet, and the rank is set to 64.
|
46 |
+
|
47 |
+
|
48 |
+
## Usage
|
49 |
+
|
50 |
+
You can directly download the model in this repository.
|
51 |
+
You also can download the model in python script:
|
52 |
+
|
53 |
+
```python
|
54 |
+
from huggingface_hub import hf_hub_download
|
55 |
+
photomaker_ckpt = hf_hub_download(repo_id="TencentARC/PhotoMaker-V2", filename="photomaker-v2.bin", repo_type="model")
|
56 |
+
```
|
57 |
+
|
58 |
+
Then, please follow the instructions in our [GitHub repository](https://github.com/TencentARC/PhotoMaker/README_pmv2.md).
|
59 |
+
|
60 |
+
|
61 |
+
## Limitations
|
62 |
+
|
63 |
+
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
64 |
+
|
65 |
+
- The model's customization performance degrades on Asian male faces.
|
66 |
+
- The model still struggles with accurately rendering human hands.
|
67 |
+
|
68 |
+
## Bias
|
69 |
+
|
70 |
+
While the capabilities of image generation models are impressive, they can also reinforce or exacerbate social biases.
|
71 |
+
|
72 |
+
## Citation
|
73 |
+
|
74 |
+
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
75 |
+
|
76 |
+
**BibTeX:**
|
77 |
+
|
78 |
+
```bibtex
|
79 |
+
@inproceedings{li2023photomaker,
|
80 |
+
title={PhotoMaker: Customizing Realistic Human Photos via Stacked ID Embedding},
|
81 |
+
author={Li, Zhen and Cao, Mingdeng and Wang, Xintao and Qi, Zhongang and Cheng, Ming-Ming and Shan, Ying},
|
82 |
+
booktitle={IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
|
83 |
+
year={2024}
|
84 |
+
}
|
85 |
+
```
|