MCPcopy Index your code
hub / github.com/magic-research/magic-animate

github.com/magic-research/magic-animate @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
296 symbols 977 edges 22 files 48 documented · 16% 44 cross-repo links updated 10mo ago★ 10,90295 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

MagicAnimate: Temporally Consistent Human Image Animation using Diffusion Model

<a href="https://scholar.google.com/citations?user=-4iADzMAAAAJ&hl=en"><strong>Zhongcong Xu</strong></a>
·
<a href="http://jeff95.me/"><strong>Jianfeng Zhang</strong></a>
·
<a href="https://scholar.google.com.sg/citations?user=8gm-CYYAAAAJ&hl=en"><strong>Jun Hao Liew</strong></a>
·
<a href="https://hanshuyan.github.io/"><strong>Hanshu Yan</strong></a>
·
<a href="https://scholar.google.com/citations?user=stQQf7wAAAAJ&hl=en"><strong>Jia-Wei Liu</strong></a>
·
<a href="https://zhangchenxu528.github.io/"><strong>Chenxu Zhang</strong></a>
·
<a href="https://sites.google.com/site/jshfeng/home"><strong>Jiashi Feng</strong></a>
·
<a href="https://sites.google.com/view/showlab"><strong>Mike Zheng Shou</strong></a>






    <a href="https://arxiv.org/abs/2311.16498"><img src='https://img.shields.io/badge/arXiv-MagicAnimate-red' alt='Paper PDF'></a>
    <a href='https://showlab.github.io/magicanimate'><img src='https://img.shields.io/badge/Project_Page-MagicAnimate-green' alt='Project Page'></a>
    <a href='https://huggingface.co/spaces/zcxu-eric/magicanimate'><img src='https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue'></a>



<b>National University of Singapore &nbsp; | &nbsp;  ByteDance</b>

📢 News

  • [2023.12.4] Release inference code and gradio demo. We are working to improve MagicAnimate, stay tuned!
  • [2023.11.23] Release MagicAnimate paper and project page.

🏃‍♂️ Getting Started

Download the pretrained base models for StableDiffusion V1.5 and MSE-finetuned VAE.

Download our MagicAnimate checkpoints.

Please follow the huggingface download instructions to download the above models and checkpoints, git lfs is recommended.

Place the based models and checkpoints as follows:

magic-animate
|----pretrained_models
  |----MagicAnimate
    |----appearance_encoder
      |----diffusion_pytorch_model.safetensors
      |----config.json
    |----densepose_controlnet
      |----diffusion_pytorch_model.safetensors
      |----config.json
    |----temporal_attention
      |----temporal_attention.ckpt
  |----sd-vae-ft-mse
    |----config.json
    |----diffusion_pytorch_model.safetensors
  |----stable-diffusion-v1-5
    |----scheduler
       |----scheduler_config.json
    |----text_encoder
       |----config.json
       |----pytorch_model.bin
    |----tokenizer (all)
    |----unet
       |----diffusion_pytorch_model.bin
       |----config.json
    |----v1-5-pruned-emaonly.safetensors
|----...

⚒️ Installation

prerequisites: python>=3.8, CUDA>=11.3, and ffmpeg.

Install with conda:

conda env create -f environment.yaml
conda activate manimate

or pip:

pip3 install -r requirements.txt

💃 Inference

Run inference on single GPU:

bash scripts/animate.sh

Run inference with multiple GPUs:

bash scripts/animate_dist.sh

🎨 Gradio Demo

Online Gradio Demo:

Try our online gradio demo quickly.

Local Gradio Demo:

Launch local gradio demo on single GPU:

python3 -m demo.gradio_animate

Launch local gradio demo if you have multiple GPUs:

python3 -m demo.gradio_animate_dist

Then open gradio demo in local browser.

🙏 Acknowledgements

We would like to thank AK(@_akhaliq) and huggingface team for the help of setting up oneline gradio demo.

🎓 Citation

If you find this codebase useful for your research, please use the following entry.

@inproceedings{xu2023magicanimate,
    author    = {Xu, Zhongcong and Zhang, Jianfeng and Liew, Jun Hao and Yan, Hanshu and Liu, Jia-Wei and Zhang, Chenxu and Feng, Jiashi and Shou, Mike Zheng},
    title     = {MagicAnimate: Temporally Consistent Human Image Animation using Diffusion Model},
    booktitle = {arXiv},
    year      = {2023}
}

Core symbols most depended-on inside this repo

to
called by 86
magicanimate/models/mutual_self_attention.py
print
called by 19
magicanimate/utils/dist_tools.py
torch_dfs
called by 13
magicanimate/models/stable_diffusion_controlnet_reference.py
reshape_heads_to_batch_dim
called by 7
magicanimate/models/orig_attention.py
save_videos_grid
called by 6
magicanimate/utils/util.py
from_pretrained_2d
called by 6
magicanimate/models/unet.py
reshape_heads_to_batch_dim
called by 6
magicanimate/models/orig_attention.py
update
called by 5
magicanimate/models/mutual_self_attention.py

Shape

Method 194
Class 57
Function 45

Languages

Python100%

Modules by API surface

magicanimate/models/orig_attention.py43 symbols
magicanimate/models/mutual_self_attention.py27 symbols
magicanimate/models/embeddings.py26 symbols
magicanimate/models/unet_3d_blocks.py25 symbols
magicanimate/models/appearance_encoder.py22 symbols
magicanimate/pipelines/pipeline_animation.py19 symbols
magicanimate/models/motion_module.py19 symbols
magicanimate/utils/util.py13 symbols
magicanimate/models/resnet.py13 symbols
magicanimate/models/controlnet.py13 symbols
magicanimate/utils/videoreader.py12 symbols
magicanimate/models/stable_diffusion_controlnet_reference.py10 symbols

Dependencies from manifests, versioned

absl-py1.4.0 · 1×
accelerate0.22.0 · 1×
aiofiles23.2.1 · 1×
aiohttp3.8.5 · 1×
aiosignal1.3.1 · 1×
altair5.0.1 · 1×
annotated-types0.5.0 · 1×
antlr4-python3-runtime4.9.3 · 1×
anyio3.7.1 · 1×
async-timeout4.0.3 · 1×
attrs23.1.0 · 1×
cachetools5.3.1 · 1×

For agents

$ claude mcp add magic-animate \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page