Spaces:
Runtime error
Runtime error
harriethan
commited on
Commit
•
36915ae
1
Parent(s):
33558df
init
Browse files- README.md +74 -1
- __assets__/.DS_Store +0 -0
- __assets__/banner.gif +3 -0
- __assets__/toonyou.gif +3 -0
- data/__pycache__/datasets_faceswap.cpython-311.pyc +0 -0
- face_adapter/__pycache__/model_seg_unet.cpython-311.pyc +0 -0
- face_adapter/__pycache__/model_to_token.cpython-311.pyc +0 -0
- third_party/__pycache__/insightface_backbone_conv.cpython-311.pyc +0 -0
- third_party/__pycache__/model_parsing.cpython-311.pyc +0 -0
- third_party/__pycache__/model_resnet_d3dfr.cpython-311.pyc +0 -0
- third_party/d3dfr/__pycache__/bfm.cpython-311.pyc +0 -0
README.md
CHANGED
@@ -10,4 +10,77 @@ pinned: false
|
|
10 |
license: apache-2.0
|
11 |
---
|
12 |
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
license: apache-2.0
|
11 |
---
|
12 |
|
13 |
+
# ___***Face Adapter for Pre-Trained Diffusion Models with Fine-Grained ID and Attribute Control***___
|
14 |
+
|
15 |
+
|
16 |
+
|
17 |
+
|
18 |
+
[![arXiv](https://img.shields.io/badge/arXiv-2405.12970-b31b1b.svg)](https://arxiv.org/abs/2405.12970)
|
19 |
+
<a href='https://faceadapter.github.io/face-adapter.github.io/'><img src='https://img.shields.io/badge/Project-Page-green'></a>
|
20 |
+
<a href='https://huggingface.co/FaceAdapter/FaceAdapter'><img src='https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Model-blue'></a>
|
21 |
+
[![GitHub](https://img.shields.io/github/stars/FaceAdapter/Face-Adapter?style=social)](https://github.com/FaceAdapter/Face-Adapter)
|
22 |
+
|
23 |
+
<img src="__assets__/banner.gif">
|
24 |
+
|
25 |
+
|
26 |
+
## Introduction
|
27 |
+
Face-Adapter is an efficient and effective face editing adapter for pre-trained diffusion models, specifically targeting face reenactment and swapping tasks.
|
28 |
+
|
29 |
+
## Release
|
30 |
+
- [2024/5/24] 🔥 We release the code and models.
|
31 |
+
|
32 |
+
|
33 |
+
## Installation
|
34 |
+
|
35 |
+
```
|
36 |
+
# Torch >= 2.0 recommended for acceleration without xformers
|
37 |
+
pip install accelerate diffusers==0.26.0 insightface onnxruntime
|
38 |
+
|
39 |
+
```
|
40 |
+
|
41 |
+
## Download Models
|
42 |
+
|
43 |
+
You can download models of FaceAdapter directly from [here](https://huggingface.co/FaceAdapter/FaceAdapter/tree/main) or download using python script:
|
44 |
+
```python
|
45 |
+
# Download all files
|
46 |
+
from huggingface_hub import snapshot_download
|
47 |
+
snapshot_download(repo_id="FaceAdapter/FaceAdapter", local_dir="./checkpoints")
|
48 |
+
|
49 |
+
# Or download one specific file
|
50 |
+
from huggingface_hub import hf_hub_download
|
51 |
+
hf_hub_download(repo_id="FaceAdapter/FaceAdapter", filename="controlnet/config.json", local_dir="./checkpoints")
|
52 |
+
```
|
53 |
+
|
54 |
+
|
55 |
+
To run the demo, you should also download the pre-trained SD models below:
|
56 |
+
- [runwayml/stable-diffusion-v1-5](https://huggingface.co/runwayml/stable-diffusion-v1-5)
|
57 |
+
- [stabilityai/sd-vae-ft-mse](https://huggingface.co/stabilityai/sd-vae-ft-mse)
|
58 |
+
<!-- - [SG161222/Realistic_Vision_V4.0_noVAE](https://huggingface.co/SG161222/Realistic_Vision_V4.0_noVAE) -->
|
59 |
+
|
60 |
+
## How to Use
|
61 |
+
|
62 |
+
### SD_1.5
|
63 |
+
```python
|
64 |
+
python infer.py
|
65 |
+
```
|
66 |
+
FaceAdapter can be seamlessly plugged into community models:
|
67 |
+
```python
|
68 |
+
python infer.py --base_model "frankjoshua/toonyou_beta6"
|
69 |
+
```
|
70 |
+
<img src="__assets__/toonyou.gif">
|
71 |
+
|
72 |
+
|
73 |
+
## Disclaimer
|
74 |
+
|
75 |
+
This project strives to positively impact the domain of AI-driven image generation. Users are granted the freedom to create images using this tool, but they are expected to comply with local laws and utilize it in a responsible manner. **The developers do not assume any responsibility for potential misuse by users.**
|
76 |
+
|
77 |
+
## Citation
|
78 |
+
If you find Face-Adapter useful for your research and applications, please cite using this BibTeX:
|
79 |
+
```bibtex
|
80 |
+
@article{han2024face,
|
81 |
+
title={Face Adapter for Pre-Trained Diffusion Models with Fine-Grained ID and Attribute Control},
|
82 |
+
author={Han, Yue and Zhu, Junwei and He, Keke and Chen, Xu and Ge, Yanhao and Li, Wei and Li, Xiangtai and Zhang, Jiangning and Wang, Chengjie and Liu, Yong},
|
83 |
+
journal={arXiv preprint arXiv:2405.12970},
|
84 |
+
year={2024}
|
85 |
+
}
|
86 |
+
```
|
__assets__/.DS_Store
ADDED
Binary file (6.15 kB). View file
|
|
__assets__/banner.gif
ADDED
Git LFS Details
|
__assets__/toonyou.gif
ADDED
Git LFS Details
|
data/__pycache__/datasets_faceswap.cpython-311.pyc
ADDED
Binary file (21.9 kB). View file
|
|
face_adapter/__pycache__/model_seg_unet.cpython-311.pyc
ADDED
Binary file (15.3 kB). View file
|
|
face_adapter/__pycache__/model_to_token.cpython-311.pyc
ADDED
Binary file (5.37 kB). View file
|
|
third_party/__pycache__/insightface_backbone_conv.cpython-311.pyc
ADDED
Binary file (11.8 kB). View file
|
|
third_party/__pycache__/model_parsing.cpython-311.pyc
ADDED
Binary file (25.7 kB). View file
|
|
third_party/__pycache__/model_resnet_d3dfr.cpython-311.pyc
ADDED
Binary file (51.8 kB). View file
|
|
third_party/d3dfr/__pycache__/bfm.cpython-311.pyc
ADDED
Binary file (24.7 kB). View file
|
|