Project Icon

MotionDirector

自定义文本到视频模型的动作生成

MotionDirector是一款文本到视频扩散模型定制工具,可根据视频样本学习特定动作概念并应用于视频生成。该工具支持单个或多个参考视频,能准确捕捉动作特征,实现外观和动作的同步定制。此外,MotionDirector还具备图像动画和电影镜头效果功能,为AI视频创作提供更多可能性。

MotionDirector: Motion Customization of Text-to-Video Diffusion Models

Rui Zhao · Yuchao Gu · Jay Zhangjie Wu · David Junhao Zhang · Jia-Wei Liu · Weijia Wu · Jussi Keppo · Mike Zheng Shou


Show Lab, National University of Singapore   |   Zhejiang University


MotionDirector can customize text-to-video diffusion models to generate videos with desired motions.

Task Definition

Motion Customization of Text-to-Video Diffusion Models:
Given a set of video clips of the same motion concept, the task of Motion Customization is to adapt existing text-to-video diffusion models to generate diverse videos with this motion.

Demos

Demo Video:

Demo Video of MotionDirector

Customize both Appearance and Motion:

Reference images or videosVideos generated by MotionDirector
Reference images for appearance customization: "A Terracotta Warrior on a pure color background.""A Terracotta Warrior is riding a horse through an ancient battlefield."
seed: 1455028
"A Terracotta Warrior is playing golf in front of the Great Wall."
seed: 5804477
"A Terracotta Warrior is walking cross the ancient army captured with a reverse follow cinematic shot."
seed: 653658
Reference videos for motion customization: "A person is riding a bicycle.""A Terracotta Warrior is riding a bicycle past an ancient Chinese palace."
seed: 166357.
"A Terracotta Warrior is lifting weights in front of the Great Wall."
seed: 5635982
"A Terracotta Warrior is skateboarding."
seed: 9033688

News

ToDo

  • Gradio Demo
  • More trained weights of MotionDirector

Model List

TypeTraining DataDescriptionsLink
MotionDirector for SportsMultiple videos for each model.Learn motion concepts of sports, i.e. lifting weights, riding horse, palying golf, etc.Link
MotionDirector for Cinematic ShotsA single video for each model.Learn motion concepts of cinematic shots, i.e. dolly zoom, zoom in, zoom out, etc.Link
MotionDirector for Image AnimationA single image for spatial path. And a single video or multiple videos for temporal path.Animate the given image with learned motions.Link
MotionDirector with Customized AppearanceA single image or multiple images for spatial path. And a single video or multiple videos for temporal path.Customize both appearance and motion in video generation.Link

Setup

Requirements

# create virtual environment
conda create -n motiondirector python=3.8
conda activate motiondirector
# install packages
pip install -r requirements.txt

Weights of Foundation Models

git lfs install
## You can choose the ModelScopeT2V or ZeroScope, etc., as the foundation model.
## ZeroScope
git clone https://huggingface.co/cerspense/zeroscope_v2_576w ./models/zeroscope_v2_576w/
## ModelScopeT2V
git clone https://huggingface.co/damo-vilab/text-to-video-ms-1.7b ./models/model_scope/

Weights of trained MotionDirector

# Make sure you have git-lfs installed (https://git-lfs.com)
git lfs install
git clone https://huggingface.co/ruizhaocv/MotionDirector_weights ./outputs

# More and better trained MotionDirector are released at a new repo:
git clone https://huggingface.co/ruizhaocv/MotionDirector ./outputs
# The usage is slightly different, which will be updated later.

Usage

Training

Train MotionDirector on multiple videos:

python MotionDirector_train.py --config ./configs/config_multi_videos.yaml

Train MotionDirector on a single video:

python MotionDirector_train.py --config ./configs/config_single_video.yaml

Note:

  • Before running the above command, make sure you replace the path to foundational model weights and training data with your own in the config files config_multi_videos.yaml or config_single_video.yaml.
  • Generally, training on multiple 16-frame videos usually takes 300~500 steps, about 9~16 minutes using one A5000 GPU. Training on a single video takes 50~150 steps, about 1.5~4.5 minutes using one A5000 GPU. The required VRAM for training is around 14GB.
  • Reduce n_sample_frames if your GPU memory is limited.
  • Reduce the learning rate and increase the training steps for better performance.

Inference

python MotionDirector_inference.py --model /path/to/the/foundation/model  --prompt "Your prompt" --checkpoint_folder /path/to/the/trained/MotionDirector --checkpoint_index 300 --noise_prior 0.

Note:

  • Replace /path/to/the/foundation/model with your own path to the foundation model, like ZeroScope.
  • The value of checkpoint_index means the checkpoint saved at which the training step is selected.
  • The value of noise_prior indicates how much the inversion noise of the reference video affects the generation. We recommend setting it to 0 for MotionDirector trained on multiple videos to achieve the highest diverse generation, while setting it to 0.1~0.5 for MotionDirector trained on a single video for faster convergence and better alignment with the reference video.

Inference with pre-trained MotionDirector

All available weights are at official Huggingface Repo. Run the download command, the weights will be downloaded to the folder outputs, then run the following inference command to generate videos.

MotionDirector trained on multiple videos:

python MotionDirector_inference.py --model /path/to/the/ZeroScope  --prompt "A person is riding a bicycle past the Eiffel Tower." --checkpoint_folder ./outputs/train/riding_bicycle/ --checkpoint_index 300 --noise_prior 0. --seed 7192280

Note:

  • Replace /path/to/the/ZeroScope with your own path to the foundation model, i.e. the ZeroScope.
  • Change the prompt to generate different videos.
  • The seed is set to a random value by default. Set it to a specific value will obtain certain results, as provided in the table below.

Results:

Reference VideosVideos Generated by MotionDirector
"A person is riding a bicycle.""A person is riding a bicycle past the Eiffel Tower.”
seed: 7192280
"A panda is riding a bicycle in a garden."
seed: 2178639
"An alien is riding a bicycle on Mars."
seed: 2390886

MotionDirector trained on a single video:

16 frames:

python MotionDirector_inference.py --model /path/to/the/ZeroScope  --prompt "A tank is running on the moon." --checkpoint_folder ./outputs/train/car_16/ --checkpoint_index 150 --noise_prior 0.5 --seed 8551187
Reference VideoVideos Generated by MotionDirector
"A car is running on the road.""A tank is running on the moon.”
seed: 8551187
"A lion is running past the pyramids."
seed: 431554
"A spaceship is flying past Mars."
seed: 8808231

24 frames:

python MotionDirector_inference.py --model /path/to/the/ZeroScope  --prompt "A truck is running past the Arc de Triomphe." --checkpoint_folder ./outputs/train/car_24/ --checkpoint_index 150 --noise_prior 0.5 --width 576 --height 320 --num-frames 24 --seed 34543
Reference VideoVideos Generated by MotionDirector
"A car is running on the road.""A truck is running past the Arc de Triomphe.”
seed: 34543
"An elephant is running in a forest."
seed: 2171736
项目侧边栏1项目侧边栏2
推荐项目
Project Cover

豆包MarsCode

豆包 MarsCode 是一款革命性的编程助手,通过AI技术提供代码补全、单测生成、代码解释和智能问答等功能,支持100+编程语言,与主流编辑器无缝集成,显著提升开发效率和代码质量。

Project Cover

AI写歌

Suno AI是一个革命性的AI音乐创作平台,能在短短30秒内帮助用户创作出一首完整的歌曲。无论是寻找创作灵感还是需要快速制作音乐,Suno AI都是音乐爱好者和专业人士的理想选择。

Project Cover

白日梦AI

白日梦AI提供专注于AI视频生成的多样化功能,包括文生视频、动态画面和形象生成等,帮助用户快速上手,创造专业级内容。

Project Cover

有言AI

有言平台提供一站式AIGC视频创作解决方案,通过智能技术简化视频制作流程。无论是企业宣传还是个人分享,有言都能帮助用户快速、轻松地制作出专业级别的视频内容。

Project Cover

Kimi

Kimi AI助手提供多语言对话支持,能够阅读和理解用户上传的文件内容,解析网页信息,并结合搜索结果为用户提供详尽的答案。无论是日常咨询还是专业问题,Kimi都能以友好、专业的方式提供帮助。

Project Cover

讯飞绘镜

讯飞绘镜是一个支持从创意到完整视频创作的智能平台,用户可以快速生成视频素材并创作独特的音乐视频和故事。平台提供多样化的主题和精选作品,帮助用户探索创意灵感。

Project Cover

讯飞文书

讯飞文书依托讯飞星火大模型,为文书写作者提供从素材筹备到稿件撰写及审稿的全程支持。通过录音智记和以稿写稿等功能,满足事务性工作的高频需求,帮助撰稿人节省精力,提高效率,优化工作与生活。

Project Cover

阿里绘蛙

绘蛙是阿里巴巴集团推出的革命性AI电商营销平台。利用尖端人工智能技术,为商家提供一键生成商品图和营销文案的服务,显著提升内容创作效率和营销效果。适用于淘宝、天猫等电商平台,让商品第一时间被种草。

Project Cover

AIWritePaper论文写作

AIWritePaper论文写作是一站式AI论文写作辅助工具,简化了选题、文献检索至论文撰写的整个过程。通过简单设定,平台可快速生成高质量论文大纲和全文,配合图表、参考文献等一应俱全,同时提供开题报告和答辩PPT等增值服务,保障数据安全,有效提升写作效率和论文质量。

投诉举报邮箱: service@vectorlightyear.com
@2024 懂AI·鲁ICP备2024100362号-6·鲁公网安备37021002001498号