nielsr HF Staff commited on
Commit
7a6277c
Β·
verified Β·
1 Parent(s): 1fe980c

Improve model card for AniCrafter

Browse files

This PR significantly enhances the model card for AniCrafter by adding the `library_name: diffusers` and relevant `tags` to the metadata, ensuring proper discoverability and categorization on the Hub.

It also comprehensively updates the content, including:
- Direct links to the paper, project page, and GitHub repository.
- A detailed introduction based on the paper abstract.
- Visual demonstrations (demo videos/gifs).
- Information on new features and code release status.
- Step-by-step environment setup and detailed usage examples for inference.
- The official citation and project acknowledgements.

These improvements will make the model more accessible, understandable, and user-friendly for the community.

Files changed (1) hide show
  1. README.md +163 -4
README.md CHANGED
@@ -1,15 +1,174 @@
1
  ---
2
- license: apache-2.0
3
  base_model:
4
  - Wan-AI/Wan2.1-I2V-14B-720P
 
5
  pipeline_tag: image-to-video
 
 
 
 
 
6
  ---
7
 
8
- ## Paper
9
 
10
- [https://arxiv.org/abs/2505.20255](https://arxiv.org/abs/2505.20255)
11
 
 
12
 
13
- ## Introduction
14
 
15
  We leverage **"3DGS Avatar + Background Video"** as guidance for the video diffusion model to **insert and animate anyone into any scene following given motion sequence**.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
 
2
  base_model:
3
  - Wan-AI/Wan2.1-I2V-14B-720P
4
+ license: apache-2.0
5
  pipeline_tag: image-to-video
6
+ library_name: diffusers
7
+ tags:
8
+ - human-animation
9
+ - 3d-gaussian-splatting
10
+ - smplx
11
  ---
12
 
13
+ # AniCrafter: Customizing Realistic Human-Centric Animation via Avatar-Background Conditioning in Video Diffusion Models
14
 
15
+ [πŸ“„ Paper](https://huggingface.co/papers/2505.20255) | [🏠 Project Page](https://myniuuu.github.io/AniCrafter) | [πŸ’» Code](https://github.com/myniuuu/AniCrafter)
16
 
17
+ Recent advances in video diffusion models have significantly improved character animation techniques. However, current approaches rely on basic structural conditions such as DWPose or SMPL-X to animate character images, limiting their effectiveness in open-domain scenarios with dynamic backgrounds or challenging human poses. In this paper, we introduce **AniCrafter**, a diffusion-based human-centric animation model that can seamlessly integrate and animate a given character into open-domain dynamic backgrounds while following given human motion sequences. Built on cutting-edge Image-to-Video (I2V) diffusion architectures, our model incorporates an innovative ''avatar-background'' conditioning mechanism that reframes open-domain human-centric animation as a restoration task, enabling more stable and versatile animation outputs. Experimental results demonstrate the superior performance of our method.
18
 
19
+ ## TL;DR
20
 
21
  We leverage **"3DGS Avatar + Background Video"** as guidance for the video diffusion model to **insert and animate anyone into any scene following given motion sequence**.
22
+
23
+ <table align="center">
24
+ <tr>
25
+ <td align="center" width="13%">
26
+ <img src="https://github.com/myniuuu/AniCrafter/blob/main/assets/character_image/000000.jpg?raw=true"/>
27
+ <br />
28
+ </td>
29
+ <td align="center" width="29%">
30
+ <img src="https://github.com/myniuuu/AniCrafter/blob/main/assets/demo_videos/0.gif?raw=true"/>
31
+ <br />
32
+ </td>
33
+ <td align="center" width="29%">
34
+ <img src="https://github.com/myniuuu/AniCrafter/blob/main/assets/demo_videos/1.gif?raw=true"/>
35
+ <br />
36
+ </td>
37
+ <td align="center" width="29%">
38
+ <img src="https://github.com/myniuuu/AniCrafter/blob/main/assets/demo_videos/2.gif?raw=true"/>
39
+ <br />
40
+ </td>
41
+ </tr>
42
+ </table>
43
+
44
+ <table align="center">
45
+ <tr>
46
+ <td align="center" width="13%">
47
+ <img src="https://github.com/myniuuu/AniCrafter/blob/main/assets/character_image/000001.jpg?raw=true"/>
48
+ <br />
49
+ </td>
50
+ <td align="center" width="29%">
51
+ <img src="https://github.com/myniuuu/AniCrafter/blob/main/assets/demo_videos/3.gif?raw=true"/>
52
+ <br />
53
+ </td>
54
+ <td align="center" width="29%">
55
+ <img src="https://github.com/myniuuu/AniCrafter/blob/main/assets/demo_videos/4.gif?raw=true"/>
56
+ <br />
57
+ </td>
58
+ <td align="center" width="29%">
59
+ <img src="https://github.com/myniuuu/AniCrafter/blob/main/assets/demo_videos/5.gif?raw=true"/>
60
+ <br />
61
+ </td>
62
+ </tr>
63
+ </table>
64
+
65
+ ## πŸ”₯πŸ”₯πŸ”₯ New Features/Updates
66
+
67
+ - (2024.07.03) We have released the cross-character inference script to replace the person in the source video!
68
+ - (2025.07.02) Our [Project Page](https://myniuuu.github.io/AniCrafter) 🏠 is online!
69
+ - (2025.07.01) We have released the model and inference script to insert and animate the character into the background video following SMPLX motion sequences!
70
+ - If you find this work interesting, please do not hesitate to give a ⭐!
71
+
72
+ ## πŸ“° CODE RELEASE
73
+
74
+ - [x] (2024.07.01) Release model checkpoint and cross-character inference script.
75
+ - [x] (2024.07.03) Release the complete cross-character inference script including data preprocessing (mask parsing + SMPLX estimation + background inpainting).
76
+ - [ ] Release training codes.
77
+
78
+ ## βš™οΈ Environment Setup
79
+
80
+ ### 🌍 Virtual Enviroment
81
+
82
+ ```bash
83
+ conda create -n anicrafter python=3.10
84
+ conda activate anicrafter
85
+ bash install_cu124.sh
86
+ ```
87
+
88
+ ### πŸ“¦ Download Checkpoints
89
+
90
+ ```bash
91
+ huggingface-cli download Wan-AI/Wan2.1-I2V-14B-720P --local-dir ./Wan2.1-I2V-14B-720P
92
+ huggingface-cli download MyNiuuu/Anicrafter_release --local-dir ./Anicrafter_release
93
+ mv ./Anicrafter_release/gfpgan ./gfpgan
94
+ mv ./Anicrafter_release/pretrained_models ./pretrained_models
95
+ ```
96
+
97
+ ## πŸƒ Cross-Character Inference from Background Video and Motions
98
+
99
+ Run the following commands to insert and animate the character into the background video following SMPLX motion sequences. The pipeline consists of following key functions:
100
+ - Reconstructing 3DGS Avatar from single image using [LHM](https://github.com/aigc3d/LHM)
101
+ - Animating the 3DGS Avatar according to the SMPLX sequences to obtain the spatial aligned avatar renderings
102
+ - Combine avatar rendering and background video to form the "Avatar + Background" condition
103
+ - Run the diffusion model to obtain the final animation results
104
+
105
+ ```bash
106
+ python run_pipeline.py \
107
+ --ckpt_path ./pretrained_models/anicrafter \
108
+ --wan_base_ckpt_path ./Wan2.1-I2V-14B-720P \
109
+ --character_image_path ./demo/character_images/000000.jpg \
110
+ --scene_path ./demo/videos/scene_000000 \
111
+ --save_root ./infer_result
112
+ ```
113
+
114
+ ## πŸƒ Cross-Character Inference from in-the-wild Videos
115
+ Run the following commands to replace the person in the source video with our complete data preprocessing pipeline, which contains the following components:
116
+
117
+ - Parsing human masks
118
+ - Estimating SMPLX parameters and rendering SMPLX mesh videos
119
+ - Background inpainting based on the human masks
120
+ - Reconstructing 3DGS Avatar from single image using [LHM](https://github.com/aigc3d/LHM)
121
+ - Animating the 3DGS Avatar according to the SMPLX sequences to obtain the spatial aligned avatar renderings
122
+ - Combine avatar rendering and background video to form the "Avatar + Background" condition
123
+ - Run the diffusion model to obtain the final animation results
124
+
125
+ ### βš™οΈ Additional Environment Setup
126
+
127
+ ```bash
128
+ cd engine/pose_estimation
129
+ pip install mmcv==1.3.9
130
+ pip install -v -e third-party/ViTPose
131
+ pip install ultralytics
132
+ pip install av
133
+ cd ../..
134
+ pip install numpy==1.23.5
135
+
136
+
137
+ mkdir weights
138
+ cd weights
139
+ wget https://github.com/sczhou/ProPainter/releases/download/v0.1.0/cutie-base-mega.pth
140
+ wget https://github.com/sczhou/ProPainter/releases/download/v0.1.0/i3d_rgb_imagenet.pt
141
+ wget https://github.com/sczhou/ProPainter/releases/download/v0.1.0/ProPainter.pth
142
+ wget https://github.com/sczhou/ProPainter/releases/download/v0.1.0/raft-things.pth
143
+ wget https://github.com/sczhou/ProPainter/releases/download/v0.1.0/recurrent_flow_completion.pth
144
+ cd ..
145
+
146
+ # or you can mannually download from https://github.com/sczhou/ProPainter/releases/tag/v0.1.0
147
+ ```
148
+
149
+ ### πŸ’» Start Inference
150
+
151
+ ```bash
152
+ # Mask + SMPLX + Inpainting + Avatar Recon + Rendering + Diffusion
153
+ # You could change the hyper-parameters of the inpainting algorithm to obtain optimal results
154
+
155
+ python run_pipeline_with_preprocess.py \
156
+ --video_root ./demo/origin_videos/raw_video \
157
+ --ckpt_path ./pretrained_models/anicrafter \
158
+ --wan_base_ckpt_path ./Wan2.1-I2V-14B-720P \
159
+ --character_image_path ./demo/character_images/000000.jpg \
160
+ --save_root ./infer_result_replace
161
+ ```
162
+
163
+ ## Citation
164
+ ```bibtex
165
+ @article{niu2025anicrafter,
166
+ title={AniCrafter: Customizing Realistic Human-Centric Animation via Avatar-Background Conditioning in Video Diffusion Models},
167
+ author={Niu, Muyao and Cao, Mingdeng and Zhan, Yifan and Zhu, Qingtian and Ma, Mingze and Zhao, Jiancheng and Zeng, Yanhong and Zhong, Zhihang and Sun, Xiao and Zheng, Yinqiang},
168
+ journal={arXiv preprint arXiv:2505.20255},
169
+ year={2025}
170
+ }
171
+ ```
172
+
173
+ ## Acknowledgements
174
+ We sincerely appreciate the code release of the following projects: [LHM](https://github.com/aigc3d/LHM), [Unianimate-DiT](https://github.com/ali-vilab/UniAnimate-DiT), [Diffusers](https://github.com/huggingface/diffusers), and [DiffSynth-Studio](https://github.com/modelscope/DiffSynth-Studio)