Repository files navigation

CameraCtrl

This repository is the official implementation of CameraCtrl.

This main branch contains the codes and model for CameraCtrl implemented on AnimateDiffV3. For codes and models of CameraCtrl with stable video diffusion, please refer to the svd branch for detail.

CameraCtrl: Enabling Camera Control for Video Diffusion Models
Hao He, Yinghao Xu, Yuwei Guo, Gordon Wetzstein, Bo Dai, Hongsheng Li, Ceyuan Yang

Todo List

  • Release inference code.
  • Release pretrained models on AnimateDiffV3.
  • Release training code.
  • Release Gradio Demo.
  • Release pretrained models on SVD in the svd branch.

Configurations

Environment

  • 64-bit Python 3.10 and PyTorch 1.13.0 or higher.
  • CUDA 11.7
  • Users can use the following commands to install the packages
conda env create -f environment.yaml
conda activate cameractrl

Dataset

  • Download the camera trajectories and videos from RealEstate10K.
  • Run tools/gather_realestate.py to get all the clips for each video.
  • Run tools/get_realestate_clips.py to get the video clips from the original videos.
  • Using LAVIS or other methods to generate a caption for each video clip. We provide our extracted captions in Google Drive and Google Drive.
  • Run tools/generate_realestate_json.py to generate the json files for training and test, you can construct the validation json file by randomly sampling some item from the training json file.
  • After the above steps, you can get the dataset folder like this
- RealEstate10k
- annotations
- test.json
- train.json
- validation.json
- pose_files
- 0000cc6d8b108390.txt
- 00028da87cc5a4c4.txt
- 0002b126b0a8a685.txt
- 0003a9bce989e532.txt
- 000465ebe46a98d2.txt
- ...
- video_clips
- 00ccbtp2aSQ
- 00rMZpGSeOI
- 01bTY_glskw
- 01PJ3skCZPo
- 01uaDoluhzo
- ...

Inferences

Prepare Models

  • Download Stable Diffusion V1.5 (SD1.5) from HuggingFace.
  • Download the checkpoints of AnimateDiffV3 (ADV3) adaptor and motion module from AnimateDiff.
  • Download the pretrained camera control model from HuggingFace.
  • Run tools/merge_lora2unet.py to merge the ADV3 adaptor weights into SD1.5 unet and save results to new subfolder (like, unet_webvidlora_v3) under the SD1.5 folder.
  • (Optional) Download the pretrained image LoRA model on RealEstate10K dataset from HuggingFace to sample videos on indoor and outdoor estates.
  • (Optional) Download the personalized base model, like Realistic Vision from CivitAI.

Prepare camera trajectory & prompts

  • Adopt tools/select_realestate_clips.py to prepare trajectory txt file, some example trajectories and corresponding reference videos are in assets/pose_files and assets/reference_videos, respectively. The generated trajectories can be visualized with tools/visualize_trajectory.py.
  • Prepare the prompts (negative prompts, specific seeds), one example is assets/cameractrl_prompts.json.

Inference

  • Run inference.py to sample videos
python -m torch.distributed.launch --nproc_per_node=8 --master_port=25000 inference.py \
--out_root ${OUTPUT_PATH} \
--ori_model_path ${SD1.5_PATH}\ 
--unet_subfolder ${SUBFOUDER_NAME} \
--motion_module_ckpt ${ADV3_MM_CKPT}\ 
--pose_adaptor_ckpt ${CAMERACTRL_CKPT} \
--model_config configs/train_cameractrl/adv3_256_384_cameractrl_relora.yaml \
--visualization_captions assets/cameractrl_prompts.json \
--use_specific_seeds \
--trajectory_file assets/pose_files/0f47577ab3441480.txt \
--n_procs 8

where

  • OUTPUT_PATH refers to the path to save resules.
  • SD1.5_PATH refers to the root path of the downloaded SD1.5 model.
  • SUBFOUDER_NAME refers to the subfolder name of unet in the SD1.5_PATH, default is unet. Here we adopt the name specified by tools/merge_lora2unet.py.
  • ADV3_MM_CKPT refers to the path of the downloaded AnimateDiffV3 motion module checkpoint.
  • CAMERACTRL_CKPT refers to the

The above inference example is used to generate videos in the original T2V model domain. The inference.py script supports generate videos in other domains with image LoRAs (args.image_lora_rank and args.image_lora_ckpt), like the RealEstate10K LoRA or some personalized base models (args.personalized_base_model), like the Realistic Vision. please refer to the code for detail.

Results

  • Same text prompt with different camera trajectories
Camera TrajectoryVideoCamera TrajectoryVideoCamera TrajectoryVideo
horse1_trajhorse1_vidhorse2_trajhorse2_vidhorse3_trajhorse3_vid
horse4_trajhorse4_vidhorse5_trajhorse5_vidhorse6_trajhorse6_vid
  • Camera control on different domains' videos
GeneratorCamera TrajectoryVideoCamera TrajectoryVideoCamera TrajectoryVideo
SD1.5dd1_trajdd1_viddd2_trajdd2_viddd3_trajdd3_vid
SD1.5 + RealEstate LoRA dd4_trajdd4_viddd5_trajdd5_viddd6_trajdd6_vid
Realistic Visiondd7_trajdd7_viddd8_trajdd8_viddd9_trajdd9_vid
ToonYoudd10_trajdd10_viddd11_trajdd8_viddd12_trajdd12_vid

Note that, each image paired with the video represents the camera trajectory. Each small tetrahedron on the image represents the position and orientation of the camera for one video frame. Its vertex stands for the camera location, while the base represents the imaging plane of the camera. The red arrows indicate the movement of camera position. The camera rotation can be observed through the orientation of the tetrahedrons.

Training

Step1 (RealEstate10K image LoRA)

Update the below paths to data and pretrained model of the config configs/train_image_lora/realestate_lora.yaml

pretrained_model_path: "[replace with SD1.5 root path]"
train_data:
root_path: "[replace RealEstate10K root path]"

Other training parameters (lr, epochs, validation settings, etc.) are also included in the config files.

Then, launch the image LoRA training using slurm

./slurm_run.sh ${PARTITION} image_lora 8 configs/train_image_lora/realestate_lora.yaml train_image_lora.py

or PyTorch

./dist_run.sh configs/train_image_lora/realestate_lora.yaml 8 train_image_lora.py

We provide our pretrained checkpoint of the RealEstate10K LoRA model in HuggingFace.

Step2 (Camera control model)

Update the below paths to data and pretrained model of the config configs/train_cameractrl/adv3_256_384_cameractrl_relora.yaml

pretrained_model_path: "[replace with SD1.5 root path]"
train_data:
root_path: "[replace RealEstate10K root path]"
validation_data:
root_path: "[replace RealEstate10K root path]"
lora_ckpt: "[Replace with RealEstate10k image LoRA ckpt]"
motion_module_ckpt: "[Replace with ADV3 motion module]"

Other training parameters (lr, epochs, validation settings, etc.) are also included in the config files.

Then, launch the camera control model training using slurm

./slurm_run.sh ${PARTITION} cameractrl 8 configs/train_cameractrl/adv3_256_384_cameractrl_relora.yaml train_camera_control.py

or PyTorch

./dist_run.sh configs/train_cameractrl/adv3_256_384_cameractrl_relora.yaml 8 train_camera_control.py

Disclaimer

This project is released for academic use. We disclaim responsibility for user-generated content. Users are solely liable for their actions. The project contributors are not legally affiliated with, nor accountable for, users' behaviors. Use the generative model responsibly, adhering to ethical and legal standards.

Acknowledgement

We thank AnimateDiff for their amazing codes and models.

BibTeX

@article{he2024cameractrl,
title={CameraCtrl: Enabling Camera Control for Text-to-Video Generation}, author={Hao He and Yinghao Xu and Yuwei Guo and Gordon Wetzstein and Bo Dai and Hongsheng Li and Ceyuan Yang},
journal={arXiv preprint arXiv:2404.02101},
year={2024}
}

About

No description, website, or topics provided.

Resources

Stars

664 stars

Watchers

10 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Repository files navigation

CameraCtrl

This repository is the official implementation of CameraCtrl.

This main branch contains the codes and model for CameraCtrl implemented on AnimateDiffV3. For codes and models of CameraCtrl with stable video diffusion, please refer to the svd branch for detail.

CameraCtrl: Enabling Camera Control for Video Diffusion Models
Hao He, Yinghao Xu, Yuwei Guo, Gordon Wetzstein, Bo Dai, Hongsheng Li, Ceyuan Yang

Todo List

  • Release inference code.
  • Release pretrained models on AnimateDiffV3.
  • Release training code.
  • Release Gradio Demo.
  • Release pretrained models on SVD in the svd branch.

Configurations

Environment

  • 64-bit Python 3.10 and PyTorch 1.13.0 or higher.
  • CUDA 11.7
  • Users can use the following commands to install the packages
conda env create -f environment.yaml
conda activate cameractrl

Dataset

  • Download the camera trajectories and videos from RealEstate10K.
  • Run tools/gather_realestate.py to get all the clips for each video.
  • Run tools/get_realestate_clips.py to get the video clips from the original videos.
  • Using LAVIS or other methods to generate a caption for each video clip. We provide our extracted captions in Google Drive and Google Drive.
  • Run tools/generate_realestate_json.py to generate the json files for training and test, you can construct the validation json file by randomly sampling some item from the training json file.
  • After the above steps, you can get the dataset folder like this
- RealEstate10k
- annotations
- test.json
- train.json
- validation.json
- pose_files
- 0000cc6d8b108390.txt
- 00028da87cc5a4c4.txt
- 0002b126b0a8a685.txt
- 0003a9bce989e532.txt
- 000465ebe46a98d2.txt
- ...
- video_clips
- 00ccbtp2aSQ
- 00rMZpGSeOI
- 01bTY_glskw
- 01PJ3skCZPo
- 01uaDoluhzo
- ...

Inferences

Prepare Models

  • Download Stable Diffusion V1.5 (SD1.5) from HuggingFace.
  • Download the checkpoints of AnimateDiffV3 (ADV3) adaptor and motion module from AnimateDiff.
  • Download the pretrained camera control model from HuggingFace.
  • Run tools/merge_lora2unet.py to merge the ADV3 adaptor weights into SD1.5 unet and save results to new subfolder (like, unet_webvidlora_v3) under the SD1.5 folder.
  • (Optional) Download the pretrained image LoRA model on RealEstate10K dataset from HuggingFace to sample videos on indoor and outdoor estates.
  • (Optional) Download the personalized base model, like Realistic Vision from CivitAI.

Prepare camera trajectory & prompts

  • Adopt tools/select_realestate_clips.py to prepare trajectory txt file, some example trajectories and corresponding reference videos are in assets/pose_files and assets/reference_videos, respectively. The generated trajectories can be visualized with tools/visualize_trajectory.py.
  • Prepare the prompts (negative prompts, specific seeds), one example is assets/cameractrl_prompts.json.

Inference

  • Run inference.py to sample videos
python -m torch.distributed.launch --nproc_per_node=8 --master_port=25000 inference.py \
--out_root ${OUTPUT_PATH} \
--ori_model_path ${SD1.5_PATH}\ 
--unet_subfolder ${SUBFOUDER_NAME} \
--motion_module_ckpt ${ADV3_MM_CKPT}\ 
--pose_adaptor_ckpt ${CAMERACTRL_CKPT} \
--model_config configs/train_cameractrl/adv3_256_384_cameractrl_relora.yaml \
--visualization_captions assets/cameractrl_prompts.json \
--use_specific_seeds \
--trajectory_file assets/pose_files/0f47577ab3441480.txt \
--n_procs 8

where

  • OUTPUT_PATH refers to the path to save resules.
  • SD1.5_PATH refers to the root path of the downloaded SD1.5 model.
  • SUBFOUDER_NAME refers to the subfolder name of unet in the SD1.5_PATH, default is unet. Here we adopt the name specified by tools/merge_lora2unet.py.
  • ADV3_MM_CKPT refers to the path of the downloaded AnimateDiffV3 motion module checkpoint.
  • CAMERACTRL_CKPT refers to the

The above inference example is used to generate videos in the original T2V model domain. The inference.py script supports generate videos in other domains with image LoRAs (args.image_lora_rank and args.image_lora_ckpt), like the RealEstate10K LoRA or some personalized base models (args.personalized_base_model), like the Realistic Vision. please refer to the code for detail.

Results

  • Same text prompt with different camera trajectories
Camera TrajectoryVideoCamera TrajectoryVideoCamera TrajectoryVideo
horse1_trajhorse1_vidhorse2_trajhorse2_vidhorse3_trajhorse3_vid
horse4_trajhorse4_vidhorse5_trajhorse5_vidhorse6_trajhorse6_vid
  • Camera control on different domains' videos
GeneratorCamera TrajectoryVideoCamera TrajectoryVideoCamera TrajectoryVideo
SD1.5dd1_trajdd1_viddd2_trajdd2_viddd3_trajdd3_vid
SD1.5 + RealEstate LoRA dd4_trajdd4_viddd5_trajdd5_viddd6_trajdd6_vid
Realistic Visiondd7_trajdd7_viddd8_trajdd8_viddd9_trajdd9_vid
ToonYoudd10_trajdd10_viddd11_trajdd8_viddd12_trajdd12_vid

Note that, each image paired with the video represents the camera trajectory. Each small tetrahedron on the image represents the position and orientation of the camera for one video frame. Its vertex stands for the camera location, while the base represents the imaging plane of the camera. The red arrows indicate the movement of camera position. The camera rotation can be observed through the orientation of the tetrahedrons.

Training

Step1 (RealEstate10K image LoRA)

Update the below paths to data and pretrained model of the config configs/train_image_lora/realestate_lora.yaml

pretrained_model_path: "[replace with SD1.5 root path]"
train_data:
root_path: "[replace RealEstate10K root path]"

Other training parameters (lr, epochs, validation settings, etc.) are also included in the config files.

Then, launch the image LoRA training using slurm

./slurm_run.sh ${PARTITION} image_lora 8 configs/train_image_lora/realestate_lora.yaml train_image_lora.py

or PyTorch

./dist_run.sh configs/train_image_lora/realestate_lora.yaml 8 train_image_lora.py

We provide our pretrained checkpoint of the RealEstate10K LoRA model in HuggingFace.

Step2 (Camera control model)

Update the below paths to data and pretrained model of the config configs/train_cameractrl/adv3_256_384_cameractrl_relora.yaml

pretrained_model_path: "[replace with SD1.5 root path]"
train_data:
root_path: "[replace RealEstate10K root path]"
validation_data:
root_path: "[replace RealEstate10K root path]"
lora_ckpt: "[Replace with RealEstate10k image LoRA ckpt]"
motion_module_ckpt: "[Replace with ADV3 motion module]"

Other training parameters (lr, epochs, validation settings, etc.) are also included in the config files.

Then, launch the camera control model training using slurm

./slurm_run.sh ${PARTITION} cameractrl 8 configs/train_cameractrl/adv3_256_384_cameractrl_relora.yaml train_camera_control.py

or PyTorch

./dist_run.sh configs/train_cameractrl/adv3_256_384_cameractrl_relora.yaml 8 train_camera_control.py

Disclaimer

This project is released for academic use. We disclaim responsibility for user-generated content. Users are solely liable for their actions. The project contributors are not legally affiliated with, nor accountable for, users' behaviors. Use the generative model responsibly, adhering to ethical and legal standards.

Acknowledgement

We thank AnimateDiff for their amazing codes and models.

BibTeX

@article{he2024cameractrl,
title={CameraCtrl: Enabling Camera Control for Text-to-Video Generation}, author={Hao He and Yinghao Xu and Yuwei Guo and Gordon Wetzstein and Bo Dai and Hongsheng Li and Ceyuan Yang},
journal={arXiv preprint arXiv:2404.02101},
year={2024}
}

About

No description, website, or topics provided.

Resources

Stars

664 stars

Watchers

10 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

CameraCtrl

This repository is the official implementation of CameraCtrl.

This main branch contains the codes and model for CameraCtrl implemented on AnimateDiffV3. For codes and models of CameraCtrl with stable video diffusion, please refer to the svd branch for detail.

CameraCtrl: Enabling Camera Control for Video Diffusion Models
Hao He, Yinghao Xu, Yuwei Guo, Gordon Wetzstein, Bo Dai, Hongsheng Li, Ceyuan Yang

Todo List

  • Release inference code.
  • Release pretrained models on AnimateDiffV3.
  • Release training code.
  • Release Gradio Demo.
  • Release pretrained models on SVD in the svd branch.

Configurations

Environment

  • 64-bit Python 3.10 and PyTorch 1.13.0 or higher.
  • CUDA 11.7
  • Users can use the following commands to install the packages
conda env create -f environment.yaml
conda activate cameractrl

Dataset

  • Download the camera trajectories and videos from RealEstate10K.
  • Run tools/gather_realestate.py to get all the clips for each video.
  • Run tools/get_realestate_clips.py to get the video clips from the original videos.
  • Using LAVIS or other methods to generate a caption for each video clip. We provide our extracted captions in Google Drive and Google Drive.
  • Run tools/generate_realestate_json.py to generate the json files for training and test, you can construct the validation json file by randomly sampling some item from the training json file.
  • After the above steps, you can get the dataset folder like this
- RealEstate10k
- annotations
- test.json
- train.json
- validation.json
- pose_files
- 0000cc6d8b108390.txt
- 00028da87cc5a4c4.txt
- 0002b126b0a8a685.txt
- 0003a9bce989e532.txt
- 000465ebe46a98d2.txt
- ...
- video_clips
- 00ccbtp2aSQ
- 00rMZpGSeOI
- 01bTY_glskw
- 01PJ3skCZPo
- 01uaDoluhzo
- ...

Inferences

Prepare Models

  • Download Stable Diffusion V1.5 (SD1.5) from HuggingFace.
  • Download the checkpoints of AnimateDiffV3 (ADV3) adaptor and motion module from AnimateDiff.
  • Download the pretrained camera control model from HuggingFace.
  • Run tools/merge_lora2unet.py to merge the ADV3 adaptor weights into SD1.5 unet and save results to new subfolder (like, unet_webvidlora_v3) under the SD1.5 folder.
  • (Optional) Download the pretrained image LoRA model on RealEstate10K dataset from HuggingFace to sample videos on indoor and outdoor estates.
  • (Optional) Download the personalized base model, like Realistic Vision from CivitAI.

Prepare camera trajectory & prompts

  • Adopt tools/select_realestate_clips.py to prepare trajectory txt file, some example trajectories and corresponding reference videos are in assets/pose_files and assets/reference_videos, respectively. The generated trajectories can be visualized with tools/visualize_trajectory.py.
  • Prepare the prompts (negative prompts, specific seeds), one example is assets/cameractrl_prompts.json.

Inference

  • Run inference.py to sample videos
python -m torch.distributed.launch --nproc_per_node=8 --master_port=25000 inference.py \
--out_root ${OUTPUT_PATH} \
--ori_model_path ${SD1.5_PATH}\ 
--unet_subfolder ${SUBFOUDER_NAME} \
--motion_module_ckpt ${ADV3_MM_CKPT}\ 
--pose_adaptor_ckpt ${CAMERACTRL_CKPT} \
--model_config configs/train_cameractrl/adv3_256_384_cameractrl_relora.yaml \
--visualization_captions assets/cameractrl_prompts.json \
--use_specific_seeds \
--trajectory_file assets/pose_files/0f47577ab3441480.txt \
--n_procs 8

where

  • OUTPUT_PATH refers to the path to save resules.
  • SD1.5_PATH refers to the root path of the downloaded SD1.5 model.
  • SUBFOUDER_NAME refers to the subfolder name of unet in the SD1.5_PATH, default is unet. Here we adopt the name specified by tools/merge_lora2unet.py.
  • ADV3_MM_CKPT refers to the path of the downloaded AnimateDiffV3 motion module checkpoint.
  • CAMERACTRL_CKPT refers to the

The above inference example is used to generate videos in the original T2V model domain. The inference.py script supports generate videos in other domains with image LoRAs (args.image_lora_rank and args.image_lora_ckpt), like the RealEstate10K LoRA or some personalized base models (args.personalized_base_model), like the Realistic Vision. please refer to the code for detail.

Results

  • Same text prompt with different camera trajectories
Camera TrajectoryVideoCamera TrajectoryVideoCamera TrajectoryVideo
horse1_trajhorse1_vidhorse2_trajhorse2_vidhorse3_trajhorse3_vid
horse4_trajhorse4_vidhorse5_trajhorse5_vidhorse6_trajhorse6_vid
  • Camera control on different domains' videos
GeneratorCamera TrajectoryVideoCamera TrajectoryVideoCamera TrajectoryVideo
SD1.5dd1_trajdd1_viddd2_trajdd2_viddd3_trajdd3_vid
SD1.5 + RealEstate LoRA dd4_trajdd4_viddd5_trajdd5_viddd6_trajdd6_vid
Realistic Visiondd7_trajdd7_viddd8_trajdd8_viddd9_trajdd9_vid
ToonYoudd10_trajdd10_viddd11_trajdd8_viddd12_trajdd12_vid

Note that, each image paired with the video represents the camera trajectory. Each small tetrahedron on the image represents the position and orientation of the camera for one video frame. Its vertex stands for the camera location, while the base represents the imaging plane of the camera. The red arrows indicate the movement of camera position. The camera rotation can be observed through the orientation of the tetrahedrons.

Training

Step1 (RealEstate10K image LoRA)

Update the below paths to data and pretrained model of the config configs/train_image_lora/realestate_lora.yaml

pretrained_model_path: "[replace with SD1.5 root path]"
train_data:
root_path: "[replace RealEstate10K root path]"

Other training parameters (lr, epochs, validation settings, etc.) are also included in the config files.

Then, launch the image LoRA training using slurm

./slurm_run.sh ${PARTITION} image_lora 8 configs/train_image_lora/realestate_lora.yaml train_image_lora.py

or PyTorch

./dist_run.sh configs/train_image_lora/realestate_lora.yaml 8 train_image_lora.py

We provide our pretrained checkpoint of the RealEstate10K LoRA model in HuggingFace.

Step2 (Camera control model)

Update the below paths to data and pretrained model of the config configs/train_cameractrl/adv3_256_384_cameractrl_relora.yaml

pretrained_model_path: "[replace with SD1.5 root path]"
train_data:
root_path: "[replace RealEstate10K root path]"
validation_data:
root_path: "[replace RealEstate10K root path]"
lora_ckpt: "[Replace with RealEstate10k image LoRA ckpt]"
motion_module_ckpt: "[Replace with ADV3 motion module]"

Other training parameters (lr, epochs, validation settings, etc.) are also included in the config files.

Then, launch the camera control model training using slurm

./slurm_run.sh ${PARTITION} cameractrl 8 configs/train_cameractrl/adv3_256_384_cameractrl_relora.yaml train_camera_control.py

or PyTorch

./dist_run.sh configs/train_cameractrl/adv3_256_384_cameractrl_relora.yaml 8 train_camera_control.py

Disclaimer

This project is released for academic use. We disclaim responsibility for user-generated content. Users are solely liable for their actions. The project contributors are not legally affiliated with, nor accountable for, users' behaviors. Use the generative model responsibly, adhering to ethical and legal standards.

Acknowledgement

We thank AnimateDiff for their amazing codes and models.

BibTeX

@article{he2024cameractrl,
title={CameraCtrl: Enabling Camera Control for Text-to-Video Generation}, author={Hao He and Yinghao Xu and Yuwei Guo and Gordon Wetzstein and Bo Dai and Hongsheng Li and Ceyuan Yang},
journal={arXiv preprint arXiv:2404.02101},
year={2024}
}

About

No description, website, or topics provided.

Resources

Stars

664 stars

Watchers

10 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

CameraCtrl

This repository is the official implementation of CameraCtrl.

This main branch contains the codes and model for CameraCtrl implemented on AnimateDiffV3. For codes and models of CameraCtrl with stable video diffusion, please refer to the svd branch for detail.

CameraCtrl: Enabling Camera Control for Video Diffusion Models
Hao He, Yinghao Xu, Yuwei Guo, Gordon Wetzstein, Bo Dai, Hongsheng Li, Ceyuan Yang

Todo List

  • Release inference code.
  • Release pretrained models on AnimateDiffV3.
  • Release training code.
  • Release Gradio Demo.
  • Release pretrained models on SVD in the svd branch.

Configurations

Environment

  • 64-bit Python 3.10 and PyTorch 1.13.0 or higher.
  • CUDA 11.7
  • Users can use the following commands to install the packages
conda env create -f environment.yaml
conda activate cameractrl

Dataset

  • Download the camera trajectories and videos from RealEstate10K.
  • Run tools/gather_realestate.py to get all the clips for each video.
  • Run tools/get_realestate_clips.py to get the video clips from the original videos.
  • Using LAVIS or other methods to generate a caption for each video clip. We provide our extracted captions in Google Drive and Google Drive.
  • Run tools/generate_realestate_json.py to generate the json files for training and test, you can construct the validation json file by randomly sampling some item from the training json file.
  • After the above steps, you can get the dataset folder like this
- RealEstate10k
- annotations
- test.json
- train.json
- validation.json
- pose_files
- 0000cc6d8b108390.txt
- 00028da87cc5a4c4.txt
- 0002b126b0a8a685.txt
- 0003a9bce989e532.txt
- 000465ebe46a98d2.txt
- ...
- video_clips
- 00ccbtp2aSQ
- 00rMZpGSeOI
- 01bTY_glskw
- 01PJ3skCZPo
- 01uaDoluhzo
- ...

Inferences

Prepare Models

  • Download Stable Diffusion V1.5 (SD1.5) from HuggingFace.
  • Download the checkpoints of AnimateDiffV3 (ADV3) adaptor and motion module from AnimateDiff.
  • Download the pretrained camera control model from HuggingFace.
  • Run tools/merge_lora2unet.py to merge the ADV3 adaptor weights into SD1.5 unet and save results to new subfolder (like, unet_webvidlora_v3) under the SD1.5 folder.
  • (Optional) Download the pretrained image LoRA model on RealEstate10K dataset from HuggingFace to sample videos on indoor and outdoor estates.
  • (Optional) Download the personalized base model, like Realistic Vision from CivitAI.

Prepare camera trajectory & prompts

  • Adopt tools/select_realestate_clips.py to prepare trajectory txt file, some example trajectories and corresponding reference videos are in assets/pose_files and assets/reference_videos, respectively. The generated trajectories can be visualized with tools/visualize_trajectory.py.
  • Prepare the prompts (negative prompts, specific seeds), one example is assets/cameractrl_prompts.json.

Inference

  • Run inference.py to sample videos
python -m torch.distributed.launch --nproc_per_node=8 --master_port=25000 inference.py \
--out_root ${OUTPUT_PATH} \
--ori_model_path ${SD1.5_PATH}\ 
--unet_subfolder ${SUBFOUDER_NAME} \
--motion_module_ckpt ${ADV3_MM_CKPT}\ 
--pose_adaptor_ckpt ${CAMERACTRL_CKPT} \
--model_config configs/train_cameractrl/adv3_256_384_cameractrl_relora.yaml \
--visualization_captions assets/cameractrl_prompts.json \
--use_specific_seeds \
--trajectory_file assets/pose_files/0f47577ab3441480.txt \
--n_procs 8

where

  • OUTPUT_PATH refers to the path to save resules.
  • SD1.5_PATH refers to the root path of the downloaded SD1.5 model.
  • SUBFOUDER_NAME refers to the subfolder name of unet in the SD1.5_PATH, default is unet. Here we adopt the name specified by tools/merge_lora2unet.py.
  • ADV3_MM_CKPT refers to the path of the downloaded AnimateDiffV3 motion module checkpoint.
  • CAMERACTRL_CKPT refers to the

The above inference example is used to generate videos in the original T2V model domain. The inference.py script supports generate videos in other domains with image LoRAs (args.image_lora_rank and args.image_lora_ckpt), like the RealEstate10K LoRA or some personalized base models (args.personalized_base_model), like the Realistic Vision. please refer to the code for detail.

Results

  • Same text prompt with different camera trajectories
Camera TrajectoryVideoCamera TrajectoryVideoCamera TrajectoryVideo
horse1_trajhorse1_vidhorse2_trajhorse2_vidhorse3_trajhorse3_vid
horse4_trajhorse4_vidhorse5_trajhorse5_vidhorse6_trajhorse6_vid
  • Camera control on different domains' videos
GeneratorCamera TrajectoryVideoCamera TrajectoryVideoCamera TrajectoryVideo
SD1.5dd1_trajdd1_viddd2_trajdd2_viddd3_trajdd3_vid
SD1.5 + RealEstate LoRA dd4_trajdd4_viddd5_trajdd5_viddd6_trajdd6_vid
Realistic Visiondd7_trajdd7_viddd8_trajdd8_viddd9_trajdd9_vid
ToonYoudd10_trajdd10_viddd11_trajdd8_viddd12_trajdd12_vid

Note that, each image paired with the video represents the camera trajectory. Each small tetrahedron on the image represents the position and orientation of the camera for one video frame. Its vertex stands for the camera location, while the base represents the imaging plane of the camera. The red arrows indicate the movement of camera position. The camera rotation can be observed through the orientation of the tetrahedrons.

Training

Step1 (RealEstate10K image LoRA)

Update the below paths to data and pretrained model of the config configs/train_image_lora/realestate_lora.yaml

pretrained_model_path: "[replace with SD1.5 root path]"
train_data:
root_path: "[replace RealEstate10K root path]"

Other training parameters (lr, epochs, validation settings, etc.) are also included in the config files.

Then, launch the image LoRA training using slurm

./slurm_run.sh ${PARTITION} image_lora 8 configs/train_image_lora/realestate_lora.yaml train_image_lora.py

or PyTorch

./dist_run.sh configs/train_image_lora/realestate_lora.yaml 8 train_image_lora.py

We provide our pretrained checkpoint of the RealEstate10K LoRA model in HuggingFace.

Step2 (Camera control model)

Update the below paths to data and pretrained model of the config configs/train_cameractrl/adv3_256_384_cameractrl_relora.yaml

pretrained_model_path: "[replace with SD1.5 root path]"
train_data:
root_path: "[replace RealEstate10K root path]"
validation_data:
root_path: "[replace RealEstate10K root path]"
lora_ckpt: "[Replace with RealEstate10k image LoRA ckpt]"
motion_module_ckpt: "[Replace with ADV3 motion module]"

Other training parameters (lr, epochs, validation settings, etc.) are also included in the config files.

Then, launch the camera control model training using slurm

./slurm_run.sh ${PARTITION} cameractrl 8 configs/train_cameractrl/adv3_256_384_cameractrl_relora.yaml train_camera_control.py

or PyTorch

./dist_run.sh configs/train_cameractrl/adv3_256_384_cameractrl_relora.yaml 8 train_camera_control.py

Disclaimer

This project is released for academic use. We disclaim responsibility for user-generated content. Users are solely liable for their actions. The project contributors are not legally affiliated with, nor accountable for, users' behaviors. Use the generative model responsibly, adhering to ethical and legal standards.

Acknowledgement

We thank AnimateDiff for their amazing codes and models.

BibTeX

@article{he2024cameractrl,
title={CameraCtrl: Enabling Camera Control for Text-to-Video Generation}, author={Hao He and Yinghao Xu and Yuwei Guo and Gordon Wetzstein and Bo Dai and Hongsheng Li and Ceyuan Yang},
journal={arXiv preprint arXiv:2404.02101},
year={2024}
}

About

No description, website, or topics provided.

Resources

Stars

664 stars

Watchers

10 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Repository files navigation

CameraCtrl

This repository is the official implementation of CameraCtrl.

This main branch contains the codes and model for CameraCtrl implemented on AnimateDiffV3. For codes and models of CameraCtrl with stable video diffusion, please refer to the svd branch for detail.

CameraCtrl: Enabling Camera Control for Video Diffusion Models
Hao He, Yinghao Xu, Yuwei Guo, Gordon Wetzstein, Bo Dai, Hongsheng Li, Ceyuan Yang

Todo List

  • Release inference code.
  • Release pretrained models on AnimateDiffV3.
  • Release training code.
  • Release Gradio Demo.
  • Release pretrained models on SVD in the svd branch.

Configurations

Environment

  • 64-bit Python 3.10 and PyTorch 1.13.0 or higher.
  • CUDA 11.7
  • Users can use the following commands to install the packages
conda env create -f environment.yaml
conda activate cameractrl

Dataset

  • Download the camera trajectories and videos from RealEstate10K.
  • Run tools/gather_realestate.py to get all the clips for each video.
  • Run tools/get_realestate_clips.py to get the video clips from the original videos.
  • Using LAVIS or other methods to generate a caption for each video clip. We provide our extracted captions in Google Drive and Google Drive.
  • Run tools/generate_realestate_json.py to generate the json files for training and test, you can construct the validation json file by randomly sampling some item from the training json file.
  • After the above steps, you can get the dataset folder like this
- RealEstate10k
- annotations
- test.json
- train.json
- validation.json
- pose_files
- 0000cc6d8b108390.txt
- 00028da87cc5a4c4.txt
- 0002b126b0a8a685.txt
- 0003a9bce989e532.txt
- 000465ebe46a98d2.txt
- ...
- video_clips
- 00ccbtp2aSQ
- 00rMZpGSeOI
- 01bTY_glskw
- 01PJ3skCZPo
- 01uaDoluhzo
- ...

Inferences

Prepare Models

  • Download Stable Diffusion V1.5 (SD1.5) from HuggingFace.
  • Download the checkpoints of AnimateDiffV3 (ADV3) adaptor and motion module from AnimateDiff.
  • Download the pretrained camera control model from HuggingFace.
  • Run tools/merge_lora2unet.py to merge the ADV3 adaptor weights into SD1.5 unet and save results to new subfolder (like, unet_webvidlora_v3) under the SD1.5 folder.
  • (Optional) Download the pretrained image LoRA model on RealEstate10K dataset from HuggingFace to sample videos on indoor and outdoor estates.
  • (Optional) Download the personalized base model, like Realistic Vision from CivitAI.

Prepare camera trajectory & prompts

  • Adopt tools/select_realestate_clips.py to prepare trajectory txt file, some example trajectories and corresponding reference videos are in assets/pose_files and assets/reference_videos, respectively. The generated trajectories can be visualized with tools/visualize_trajectory.py.
  • Prepare the prompts (negative prompts, specific seeds), one example is assets/cameractrl_prompts.json.

Inference

  • Run inference.py to sample videos
python -m torch.distributed.launch --nproc_per_node=8 --master_port=25000 inference.py \
--out_root ${OUTPUT_PATH} \
--ori_model_path ${SD1.5_PATH}\ 
--unet_subfolder ${SUBFOUDER_NAME} \
--motion_module_ckpt ${ADV3_MM_CKPT}\ 
--pose_adaptor_ckpt ${CAMERACTRL_CKPT} \
--model_config configs/train_cameractrl/adv3_256_384_cameractrl_relora.yaml \
--visualization_captions assets/cameractrl_prompts.json \
--use_specific_seeds \
--trajectory_file assets/pose_files/0f47577ab3441480.txt \
--n_procs 8

where

  • OUTPUT_PATH refers to the path to save resules.
  • SD1.5_PATH refers to the root path of the downloaded SD1.5 model.
  • SUBFOUDER_NAME refers to the subfolder name of unet in the SD1.5_PATH, default is unet. Here we adopt the name specified by tools/merge_lora2unet.py.
  • ADV3_MM_CKPT refers to the path of the downloaded AnimateDiffV3 motion module checkpoint.
  • CAMERACTRL_CKPT refers to the

The above inference example is used to generate videos in the original T2V model domain. The inference.py script supports generate videos in other domains with image LoRAs (args.image_lora_rank and args.image_lora_ckpt), like the RealEstate10K LoRA or some personalized base models (args.personalized_base_model), like the Realistic Vision. please refer to the code for detail.

Results

  • Same text prompt with different camera trajectories
Camera TrajectoryVideoCamera TrajectoryVideoCamera TrajectoryVideo
horse1_trajhorse1_vidhorse2_trajhorse2_vidhorse3_trajhorse3_vid
horse4_trajhorse4_vidhorse5_trajhorse5_vidhorse6_trajhorse6_vid
  • Camera control on different domains' videos
GeneratorCamera TrajectoryVideoCamera TrajectoryVideoCamera TrajectoryVideo
SD1.5dd1_trajdd1_viddd2_trajdd2_viddd3_trajdd3_vid
SD1.5 + RealEstate LoRA dd4_trajdd4_viddd5_trajdd5_viddd6_trajdd6_vid
Realistic Visiondd7_trajdd7_viddd8_trajdd8_viddd9_trajdd9_vid
ToonYoudd10_trajdd10_viddd11_trajdd8_viddd12_trajdd12_vid

Note that, each image paired with the video represents the camera trajectory. Each small tetrahedron on the image represents the position and orientation of the camera for one video frame. Its vertex stands for the camera location, while the base represents the imaging plane of the camera. The red arrows indicate the movement of camera position. The camera rotation can be observed through the orientation of the tetrahedrons.

Training

Step1 (RealEstate10K image LoRA)

Update the below paths to data and pretrained model of the config configs/train_image_lora/realestate_lora.yaml

pretrained_model_path: "[replace with SD1.5 root path]"
train_data:
root_path: "[replace RealEstate10K root path]"

Other training parameters (lr, epochs, validation settings, etc.) are also included in the config files.

Then, launch the image LoRA training using slurm

./slurm_run.sh ${PARTITION} image_lora 8 configs/train_image_lora/realestate_lora.yaml train_image_lora.py

or PyTorch

./dist_run.sh configs/train_image_lora/realestate_lora.yaml 8 train_image_lora.py

We provide our pretrained checkpoint of the RealEstate10K LoRA model in HuggingFace.

Step2 (Camera control model)

Update the below paths to data and pretrained model of the config configs/train_cameractrl/adv3_256_384_cameractrl_relora.yaml

pretrained_model_path: "[replace with SD1.5 root path]"
train_data:
root_path: "[replace RealEstate10K root path]"
validation_data:
root_path: "[replace RealEstate10K root path]"
lora_ckpt: "[Replace with RealEstate10k image LoRA ckpt]"
motion_module_ckpt: "[Replace with ADV3 motion module]"

Other training parameters (lr, epochs, validation settings, etc.) are also included in the config files.

Then, launch the camera control model training using slurm

./slurm_run.sh ${PARTITION} cameractrl 8 configs/train_cameractrl/adv3_256_384_cameractrl_relora.yaml train_camera_control.py

or PyTorch

./dist_run.sh configs/train_cameractrl/adv3_256_384_cameractrl_relora.yaml 8 train_camera_control.py

Disclaimer

This project is released for academic use. We disclaim responsibility for user-generated content. Users are solely liable for their actions. The project contributors are not legally affiliated with, nor accountable for, users' behaviors. Use the generative model responsibly, adhering to ethical and legal standards.

Acknowledgement

We thank AnimateDiff for their amazing codes and models.

BibTeX

@article{he2024cameractrl,
title={CameraCtrl: Enabling Camera Control for Text-to-Video Generation}, author={Hao He and Yinghao Xu and Yuwei Guo and Gordon Wetzstein and Bo Dai and Hongsheng Li and Ceyuan Yang},
journal={arXiv preprint arXiv:2404.02101},
year={2024}
}

About

No description, website, or topics provided.

Resources

Stars

664 stars

Watchers

10 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

CameraCtrl

This repository is the official implementation of CameraCtrl.

This main branch contains the codes and model for CameraCtrl implemented on AnimateDiffV3. For codes and models of CameraCtrl with stable video diffusion, please refer to the svd branch for detail.

CameraCtrl: Enabling Camera Control for Video Diffusion Models
Hao He, Yinghao Xu, Yuwei Guo, Gordon Wetzstein, Bo Dai, Hongsheng Li, Ceyuan Yang

Todo List

  • Release inference code.
  • Release pretrained models on AnimateDiffV3.
  • Release training code.
  • Release Gradio Demo.
  • Release pretrained models on SVD in the svd branch.

Configurations

Environment

  • 64-bit Python 3.10 and PyTorch 1.13.0 or higher.
  • CUDA 11.7
  • Users can use the following commands to install the packages
conda env create -f environment.yaml
conda activate cameractrl

Dataset

  • Download the camera trajectories and videos from RealEstate10K.
  • Run tools/gather_realestate.py to get all the clips for each video.
  • Run tools/get_realestate_clips.py to get the video clips from the original videos.
  • Using LAVIS or other methods to generate a caption for each video clip. We provide our extracted captions in Google Drive and Google Drive.
  • Run tools/generate_realestate_json.py to generate the json files for training and test, you can construct the validation json file by randomly sampling some item from the training json file.
  • After the above steps, you can get the dataset folder like this
- RealEstate10k
- annotations
- test.json
- train.json
- validation.json
- pose_files
- 0000cc6d8b108390.txt
- 00028da87cc5a4c4.txt
- 0002b126b0a8a685.txt
- 0003a9bce989e532.txt
- 000465ebe46a98d2.txt
- ...
- video_clips
- 00ccbtp2aSQ
- 00rMZpGSeOI
- 01bTY_glskw
- 01PJ3skCZPo
- 01uaDoluhzo
- ...

Inferences

Prepare Models

  • Download Stable Diffusion V1.5 (SD1.5) from HuggingFace.
  • Download the checkpoints of AnimateDiffV3 (ADV3) adaptor and motion module from AnimateDiff.
  • Download the pretrained camera control model from HuggingFace.
  • Run tools/merge_lora2unet.py to merge the ADV3 adaptor weights into SD1.5 unet and save results to new subfolder (like, unet_webvidlora_v3) under the SD1.5 folder.
  • (Optional) Download the pretrained image LoRA model on RealEstate10K dataset from HuggingFace to sample videos on indoor and outdoor estates.
  • (Optional) Download the personalized base model, like Realistic Vision from CivitAI.

Prepare camera trajectory & prompts

  • Adopt tools/select_realestate_clips.py to prepare trajectory txt file, some example trajectories and corresponding reference videos are in assets/pose_files and assets/reference_videos, respectively. The generated trajectories can be visualized with tools/visualize_trajectory.py.
  • Prepare the prompts (negative prompts, specific seeds), one example is assets/cameractrl_prompts.json.

Inference

  • Run inference.py to sample videos
python -m torch.distributed.launch --nproc_per_node=8 --master_port=25000 inference.py \
--out_root ${OUTPUT_PATH} \
--ori_model_path ${SD1.5_PATH}\ 
--unet_subfolder ${SUBFOUDER_NAME} \
--motion_module_ckpt ${ADV3_MM_CKPT}\ 
--pose_adaptor_ckpt ${CAMERACTRL_CKPT} \
--model_config configs/train_cameractrl/adv3_256_384_cameractrl_relora.yaml \
--visualization_captions assets/cameractrl_prompts.json \
--use_specific_seeds \
--trajectory_file assets/pose_files/0f47577ab3441480.txt \
--n_procs 8

where

  • OUTPUT_PATH refers to the path to save resules.
  • SD1.5_PATH refers to the root path of the downloaded SD1.5 model.
  • SUBFOUDER_NAME refers to the subfolder name of unet in the SD1.5_PATH, default is unet. Here we adopt the name specified by tools/merge_lora2unet.py.
  • ADV3_MM_CKPT refers to the path of the downloaded AnimateDiffV3 motion module checkpoint.
  • CAMERACTRL_CKPT refers to the

The above inference example is used to generate videos in the original T2V model domain. The inference.py script supports generate videos in other domains with image LoRAs (args.image_lora_rank and args.image_lora_ckpt), like the RealEstate10K LoRA or some personalized base models (args.personalized_base_model), like the Realistic Vision. please refer to the code for detail.

Results

  • Same text prompt with different camera trajectories
Camera TrajectoryVideoCamera TrajectoryVideoCamera TrajectoryVideo
horse1_trajhorse1_vidhorse2_trajhorse2_vidhorse3_trajhorse3_vid
horse4_trajhorse4_vidhorse5_trajhorse5_vidhorse6_trajhorse6_vid
  • Camera control on different domains' videos
GeneratorCamera TrajectoryVideoCamera TrajectoryVideoCamera TrajectoryVideo
SD1.5dd1_trajdd1_viddd2_trajdd2_viddd3_trajdd3_vid
SD1.5 + RealEstate LoRA dd4_trajdd4_viddd5_trajdd5_viddd6_trajdd6_vid
Realistic Visiondd7_trajdd7_viddd8_trajdd8_viddd9_trajdd9_vid
ToonYoudd10_trajdd10_viddd11_trajdd8_viddd12_trajdd12_vid

Note that, each image paired with the video represents the camera trajectory. Each small tetrahedron on the image represents the position and orientation of the camera for one video frame. Its vertex stands for the camera location, while the base represents the imaging plane of the camera. The red arrows indicate the movement of camera position. The camera rotation can be observed through the orientation of the tetrahedrons.

Training

Step1 (RealEstate10K image LoRA)

Update the below paths to data and pretrained model of the config configs/train_image_lora/realestate_lora.yaml

pretrained_model_path: "[replace with SD1.5 root path]"
train_data:
root_path: "[replace RealEstate10K root path]"

Other training parameters (lr, epochs, validation settings, etc.) are also included in the config files.

Then, launch the image LoRA training using slurm

./slurm_run.sh ${PARTITION} image_lora 8 configs/train_image_lora/realestate_lora.yaml train_image_lora.py

or PyTorch

./dist_run.sh configs/train_image_lora/realestate_lora.yaml 8 train_image_lora.py

We provide our pretrained checkpoint of the RealEstate10K LoRA model in HuggingFace.

Step2 (Camera control model)

Update the below paths to data and pretrained model of the config configs/train_cameractrl/adv3_256_384_cameractrl_relora.yaml

pretrained_model_path: "[replace with SD1.5 root path]"
train_data:
root_path: "[replace RealEstate10K root path]"
validation_data:
root_path: "[replace RealEstate10K root path]"
lora_ckpt: "[Replace with RealEstate10k image LoRA ckpt]"
motion_module_ckpt: "[Replace with ADV3 motion module]"

Other training parameters (lr, epochs, validation settings, etc.) are also included in the config files.

Then, launch the camera control model training using slurm

./slurm_run.sh ${PARTITION} cameractrl 8 configs/train_cameractrl/adv3_256_384_cameractrl_relora.yaml train_camera_control.py

or PyTorch

./dist_run.sh configs/train_cameractrl/adv3_256_384_cameractrl_relora.yaml 8 train_camera_control.py

Disclaimer

This project is released for academic use. We disclaim responsibility for user-generated content. Users are solely liable for their actions. The project contributors are not legally affiliated with, nor accountable for, users' behaviors. Use the generative model responsibly, adhering to ethical and legal standards.

Acknowledgement

We thank AnimateDiff for their amazing codes and models.

BibTeX

@article{he2024cameractrl,
title={CameraCtrl: Enabling Camera Control for Text-to-Video Generation}, author={Hao He and Yinghao Xu and Yuwei Guo and Gordon Wetzstein and Bo Dai and Hongsheng Li and Ceyuan Yang},
journal={arXiv preprint arXiv:2404.02101},
year={2024}
}

About

No description, website, or topics provided.

Resources

Stars

664 stars

Watchers

10 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

CameraCtrl

This repository is the official implementation of CameraCtrl.

This main branch contains the codes and model for CameraCtrl implemented on AnimateDiffV3. For codes and models of CameraCtrl with stable video diffusion, please refer to the svd branch for detail.

CameraCtrl: Enabling Camera Control for Video Diffusion Models
Hao He, Yinghao Xu, Yuwei Guo, Gordon Wetzstein, Bo Dai, Hongsheng Li, Ceyuan Yang

Todo List

  • Release inference code.
  • Release pretrained models on AnimateDiffV3.
  • Release training code.
  • Release Gradio Demo.
  • Release pretrained models on SVD in the svd branch.

Configurations

Environment

  • 64-bit Python 3.10 and PyTorch 1.13.0 or higher.
  • CUDA 11.7
  • Users can use the following commands to install the packages
conda env create -f environment.yaml
conda activate cameractrl

Dataset

  • Download the camera trajectories and videos from RealEstate10K.
  • Run tools/gather_realestate.py to get all the clips for each video.
  • Run tools/get_realestate_clips.py to get the video clips from the original videos.
  • Using LAVIS or other methods to generate a caption for each video clip. We provide our extracted captions in Google Drive and Google Drive.
  • Run tools/generate_realestate_json.py to generate the json files for training and test, you can construct the validation json file by randomly sampling some item from the training json file.
  • After the above steps, you can get the dataset folder like this
- RealEstate10k
- annotations
- test.json
- train.json
- validation.json
- pose_files
- 0000cc6d8b108390.txt
- 00028da87cc5a4c4.txt
- 0002b126b0a8a685.txt
- 0003a9bce989e532.txt
- 000465ebe46a98d2.txt
- ...
- video_clips
- 00ccbtp2aSQ
- 00rMZpGSeOI
- 01bTY_glskw
- 01PJ3skCZPo
- 01uaDoluhzo
- ...

Inferences

Prepare Models

  • Download Stable Diffusion V1.5 (SD1.5) from HuggingFace.
  • Download the checkpoints of AnimateDiffV3 (ADV3) adaptor and motion module from AnimateDiff.
  • Download the pretrained camera control model from HuggingFace.
  • Run tools/merge_lora2unet.py to merge the ADV3 adaptor weights into SD1.5 unet and save results to new subfolder (like, unet_webvidlora_v3) under the SD1.5 folder.
  • (Optional) Download the pretrained image LoRA model on RealEstate10K dataset from HuggingFace to sample videos on indoor and outdoor estates.
  • (Optional) Download the personalized base model, like Realistic Vision from CivitAI.

Prepare camera trajectory & prompts

  • Adopt tools/select_realestate_clips.py to prepare trajectory txt file, some example trajectories and corresponding reference videos are in assets/pose_files and assets/reference_videos, respectively. The generated trajectories can be visualized with tools/visualize_trajectory.py.
  • Prepare the prompts (negative prompts, specific seeds), one example is assets/cameractrl_prompts.json.

Inference

  • Run inference.py to sample videos
python -m torch.distributed.launch --nproc_per_node=8 --master_port=25000 inference.py \
--out_root ${OUTPUT_PATH} \
--ori_model_path ${SD1.5_PATH}\ 
--unet_subfolder ${SUBFOUDER_NAME} \
--motion_module_ckpt ${ADV3_MM_CKPT}\ 
--pose_adaptor_ckpt ${CAMERACTRL_CKPT} \
--model_config configs/train_cameractrl/adv3_256_384_cameractrl_relora.yaml \
--visualization_captions assets/cameractrl_prompts.json \
--use_specific_seeds \
--trajectory_file assets/pose_files/0f47577ab3441480.txt \
--n_procs 8

where

  • OUTPUT_PATH refers to the path to save resules.
  • SD1.5_PATH refers to the root path of the downloaded SD1.5 model.
  • SUBFOUDER_NAME refers to the subfolder name of unet in the SD1.5_PATH, default is unet. Here we adopt the name specified by tools/merge_lora2unet.py.
  • ADV3_MM_CKPT refers to the path of the downloaded AnimateDiffV3 motion module checkpoint.
  • CAMERACTRL_CKPT refers to the

The above inference example is used to generate videos in the original T2V model domain. The inference.py script supports generate videos in other domains with image LoRAs (args.image_lora_rank and args.image_lora_ckpt), like the RealEstate10K LoRA or some personalized base models (args.personalized_base_model), like the Realistic Vision. please refer to the code for detail.

Results

  • Same text prompt with different camera trajectories
Camera TrajectoryVideoCamera TrajectoryVideoCamera TrajectoryVideo
horse1_trajhorse1_vidhorse2_trajhorse2_vidhorse3_trajhorse3_vid
horse4_trajhorse4_vidhorse5_trajhorse5_vidhorse6_trajhorse6_vid
  • Camera control on different domains' videos
GeneratorCamera TrajectoryVideoCamera TrajectoryVideoCamera TrajectoryVideo
SD1.5dd1_trajdd1_viddd2_trajdd2_viddd3_trajdd3_vid
SD1.5 + RealEstate LoRA dd4_trajdd4_viddd5_trajdd5_viddd6_trajdd6_vid
Realistic Visiondd7_trajdd7_viddd8_trajdd8_viddd9_trajdd9_vid
ToonYoudd10_trajdd10_viddd11_trajdd8_viddd12_trajdd12_vid

Note that, each image paired with the video represents the camera trajectory. Each small tetrahedron on the image represents the position and orientation of the camera for one video frame. Its vertex stands for the camera location, while the base represents the imaging plane of the camera. The red arrows indicate the movement of camera position. The camera rotation can be observed through the orientation of the tetrahedrons.

Training

Step1 (RealEstate10K image LoRA)

Update the below paths to data and pretrained model of the config configs/train_image_lora/realestate_lora.yaml

pretrained_model_path: "[replace with SD1.5 root path]"
train_data:
root_path: "[replace RealEstate10K root path]"

Other training parameters (lr, epochs, validation settings, etc.) are also included in the config files.

Then, launch the image LoRA training using slurm

./slurm_run.sh ${PARTITION} image_lora 8 configs/train_image_lora/realestate_lora.yaml train_image_lora.py

or PyTorch

./dist_run.sh configs/train_image_lora/realestate_lora.yaml 8 train_image_lora.py

We provide our pretrained checkpoint of the RealEstate10K LoRA model in HuggingFace.

Step2 (Camera control model)

Update the below paths to data and pretrained model of the config configs/train_cameractrl/adv3_256_384_cameractrl_relora.yaml

pretrained_model_path: "[replace with SD1.5 root path]"
train_data:
root_path: "[replace RealEstate10K root path]"
validation_data:
root_path: "[replace RealEstate10K root path]"
lora_ckpt: "[Replace with RealEstate10k image LoRA ckpt]"
motion_module_ckpt: "[Replace with ADV3 motion module]"

Other training parameters (lr, epochs, validation settings, etc.) are also included in the config files.

Then, launch the camera control model training using slurm

./slurm_run.sh ${PARTITION} cameractrl 8 configs/train_cameractrl/adv3_256_384_cameractrl_relora.yaml train_camera_control.py

or PyTorch

./dist_run.sh configs/train_cameractrl/adv3_256_384_cameractrl_relora.yaml 8 train_camera_control.py

Disclaimer

This project is released for academic use. We disclaim responsibility for user-generated content. Users are solely liable for their actions. The project contributors are not legally affiliated with, nor accountable for, users' behaviors. Use the generative model responsibly, adhering to ethical and legal standards.

Acknowledgement

We thank AnimateDiff for their amazing codes and models.

BibTeX

@article{he2024cameractrl,
title={CameraCtrl: Enabling Camera Control for Text-to-Video Generation}, author={Hao He and Yinghao Xu and Yuwei Guo and Gordon Wetzstein and Bo Dai and Hongsheng Li and Ceyuan Yang},
journal={arXiv preprint arXiv:2404.02101},
year={2024}
}

About

No description, website, or topics provided.

Resources

Stars

664 stars

Watchers

10 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Repository files navigation

CameraCtrl

This repository is the official implementation of CameraCtrl.

This main branch contains the codes and model for CameraCtrl implemented on AnimateDiffV3. For codes and models of CameraCtrl with stable video diffusion, please refer to the svd branch for detail.

CameraCtrl: Enabling Camera Control for Video Diffusion Models
Hao He, Yinghao Xu, Yuwei Guo, Gordon Wetzstein, Bo Dai, Hongsheng Li, Ceyuan Yang

Todo List

  • Release inference code.
  • Release pretrained models on AnimateDiffV3.
  • Release training code.
  • Release Gradio Demo.
  • Release pretrained models on SVD in the svd branch.

Configurations

Environment

  • 64-bit Python 3.10 and PyTorch 1.13.0 or higher.
  • CUDA 11.7
  • Users can use the following commands to install the packages
conda env create -f environment.yaml
conda activate cameractrl

Dataset

  • Download the camera trajectories and videos from RealEstate10K.
  • Run tools/gather_realestate.py to get all the clips for each video.
  • Run tools/get_realestate_clips.py to get the video clips from the original videos.
  • Using LAVIS or other methods to generate a caption for each video clip. We provide our extracted captions in Google Drive and Google Drive.
  • Run tools/generate_realestate_json.py to generate the json files for training and test, you can construct the validation json file by randomly sampling some item from the training json file.
  • After the above steps, you can get the dataset folder like this
- RealEstate10k
- annotations
- test.json
- train.json
- validation.json
- pose_files
- 0000cc6d8b108390.txt
- 00028da87cc5a4c4.txt
- 0002b126b0a8a685.txt
- 0003a9bce989e532.txt
- 000465ebe46a98d2.txt
- ...
- video_clips
- 00ccbtp2aSQ
- 00rMZpGSeOI
- 01bTY_glskw
- 01PJ3skCZPo
- 01uaDoluhzo
- ...

Inferences

Prepare Models

  • Download Stable Diffusion V1.5 (SD1.5) from HuggingFace.
  • Download the checkpoints of AnimateDiffV3 (ADV3) adaptor and motion module from AnimateDiff.
  • Download the pretrained camera control model from HuggingFace.
  • Run tools/merge_lora2unet.py to merge the ADV3 adaptor weights into SD1.5 unet and save results to new subfolder (like, unet_webvidlora_v3) under the SD1.5 folder.
  • (Optional) Download the pretrained image LoRA model on RealEstate10K dataset from HuggingFace to sample videos on indoor and outdoor estates.
  • (Optional) Download the personalized base model, like Realistic Vision from CivitAI.

Prepare camera trajectory & prompts

  • Adopt tools/select_realestate_clips.py to prepare trajectory txt file, some example trajectories and corresponding reference videos are in assets/pose_files and assets/reference_videos, respectively. The generated trajectories can be visualized with tools/visualize_trajectory.py.
  • Prepare the prompts (negative prompts, specific seeds), one example is assets/cameractrl_prompts.json.

Inference

  • Run inference.py to sample videos
python -m torch.distributed.launch --nproc_per_node=8 --master_port=25000 inference.py \
--out_root ${OUTPUT_PATH} \
--ori_model_path ${SD1.5_PATH}\ 
--unet_subfolder ${SUBFOUDER_NAME} \
--motion_module_ckpt ${ADV3_MM_CKPT}\ 
--pose_adaptor_ckpt ${CAMERACTRL_CKPT} \
--model_config configs/train_cameractrl/adv3_256_384_cameractrl_relora.yaml \
--visualization_captions assets/cameractrl_prompts.json \
--use_specific_seeds \
--trajectory_file assets/pose_files/0f47577ab3441480.txt \
--n_procs 8

where

  • OUTPUT_PATH refers to the path to save resules.
  • SD1.5_PATH refers to the root path of the downloaded SD1.5 model.
  • SUBFOUDER_NAME refers to the subfolder name of unet in the SD1.5_PATH, default is unet. Here we adopt the name specified by tools/merge_lora2unet.py.
  • ADV3_MM_CKPT refers to the path of the downloaded AnimateDiffV3 motion module checkpoint.
  • CAMERACTRL_CKPT refers to the

The above inference example is used to generate videos in the original T2V model domain. The inference.py script supports generate videos in other domains with image LoRAs (args.image_lora_rank and args.image_lora_ckpt), like the RealEstate10K LoRA or some personalized base models (args.personalized_base_model), like the Realistic Vision. please refer to the code for detail.

Results

  • Same text prompt with different camera trajectories
Camera TrajectoryVideoCamera TrajectoryVideoCamera TrajectoryVideo
horse1_trajhorse1_vidhorse2_trajhorse2_vidhorse3_trajhorse3_vid
horse4_trajhorse4_vidhorse5_trajhorse5_vidhorse6_trajhorse6_vid
  • Camera control on different domains' videos
GeneratorCamera TrajectoryVideoCamera TrajectoryVideoCamera TrajectoryVideo
SD1.5dd1_trajdd1_viddd2_trajdd2_viddd3_trajdd3_vid
SD1.5 + RealEstate LoRA dd4_trajdd4_viddd5_trajdd5_viddd6_trajdd6_vid
Realistic Visiondd7_trajdd7_viddd8_trajdd8_viddd9_trajdd9_vid
ToonYoudd10_trajdd10_viddd11_trajdd8_viddd12_trajdd12_vid

Note that, each image paired with the video represents the camera trajectory. Each small tetrahedron on the image represents the position and orientation of the camera for one video frame. Its vertex stands for the camera location, while the base represents the imaging plane of the camera. The red arrows indicate the movement of camera position. The camera rotation can be observed through the orientation of the tetrahedrons.

Training

Step1 (RealEstate10K image LoRA)

Update the below paths to data and pretrained model of the config configs/train_image_lora/realestate_lora.yaml

pretrained_model_path: "[replace with SD1.5 root path]"
train_data:
root_path: "[replace RealEstate10K root path]"

Other training parameters (lr, epochs, validation settings, etc.) are also included in the config files.

Then, launch the image LoRA training using slurm

./slurm_run.sh ${PARTITION} image_lora 8 configs/train_image_lora/realestate_lora.yaml train_image_lora.py

or PyTorch

./dist_run.sh configs/train_image_lora/realestate_lora.yaml 8 train_image_lora.py

We provide our pretrained checkpoint of the RealEstate10K LoRA model in HuggingFace.

Step2 (Camera control model)

Update the below paths to data and pretrained model of the config configs/train_cameractrl/adv3_256_384_cameractrl_relora.yaml

pretrained_model_path: "[replace with SD1.5 root path]"
train_data:
root_path: "[replace RealEstate10K root path]"
validation_data:
root_path: "[replace RealEstate10K root path]"
lora_ckpt: "[Replace with RealEstate10k image LoRA ckpt]"
motion_module_ckpt: "[Replace with ADV3 motion module]"

Other training parameters (lr, epochs, validation settings, etc.) are also included in the config files.

Then, launch the camera control model training using slurm

./slurm_run.sh ${PARTITION} cameractrl 8 configs/train_cameractrl/adv3_256_384_cameractrl_relora.yaml train_camera_control.py

or PyTorch

./dist_run.sh configs/train_cameractrl/adv3_256_384_cameractrl_relora.yaml 8 train_camera_control.py

Disclaimer

This project is released for academic use. We disclaim responsibility for user-generated content. Users are solely liable for their actions. The project contributors are not legally affiliated with, nor accountable for, users' behaviors. Use the generative model responsibly, adhering to ethical and legal standards.

Acknowledgement

We thank AnimateDiff for their amazing codes and models.

BibTeX

@article{he2024cameractrl,
title={CameraCtrl: Enabling Camera Control for Text-to-Video Generation}, author={Hao He and Yinghao Xu and Yuwei Guo and Gordon Wetzstein and Bo Dai and Hongsheng Li and Ceyuan Yang},
journal={arXiv preprint arXiv:2404.02101},
year={2024}
}

About

No description, website, or topics provided.

Resources

Stars

664 stars

Watchers

10 watching

Forks

Releases

Packages

Used by

Contributors

Languages