Capybara is a unified visual creation model, i.e., a powerful visual generation and editing framework designed for high-quality visual synthesis and manipulation tasks.
The framework leverages advanced diffusion models and transformer architectures to support versatile visual generation and editing capabilities with precise control over content, motion, and camera movements.
Speech-driven base clips generated by Seedance 2.0. All editing powered by CAPYBARA
Key Features:
🎬 Multi-Task Support: Supports Text-to-Video (T2V), Text-to-Image (T2I), Instruction-based Video-to-Video (TV2V), Instruction-based Image-to-Image (TI2I), and various editing tasks
🚀 High Performance: Built with distributed inference support for efficient multi-GPU processing
🔥 News
[2026.02.20] 🎨 Added ComfyUI support with custom nodes for all task types (T2I, T2V, TI2I, TV2V), together with FP8 quantization support for the inference script and ComfyUI custom node.
[2026.02.17] 🚀 Initial release v0.1 of the Capybara inference framework supporting generation and instruction-based editing tasks (T2I, T2V, TI2I, TV2V).
📝 TODO List
Add support for ComfyUI.
Release our unified creation model.
Release training code.
🏞️ Show Cases
Results of generation tasks. We show two generation tasks under our unified model. The top section presents text-to-image results, illustrating high-fidelity synthesis across diverse styles. The bottom rows show text-to-video results, demonstrating temporally coherent generation with natural motion for both realistic and stylized content.
Results of image editing tasks. We show the results of both instruction-based image editing and in-context image editing. The examples cover local and global edits (e.g., time-of-day and style changes), background replacement, and expression control. We further demonstrate multi-turn editing, where edits are applied sequentially. We also show in-context editing guided by a refenece image.
Results of instruction-based video editing task. We showcase instruction-based editing (TV2V) under our unified creation interface, covering local edits, global edits, dense prediction, and dynamic edits. Each example presents input frames and the edited outputs, highlighting temporally coherent transformations that preserve identity and overall structure.
Results of in-context visual creation. We show in-context generation and in-context editing results, including subject-conditioned generation (S2V/S2I), conditional generation (C2V), image-to-video (I2V), reference-driven editing (II2I/IV2V).
🛠️ Installation
We recommend using Anaconda to create an isolated Python environment and recommend using CUDA 12.6:
Capybara supports two inference modes: Single Sample Mode for quick testing with a single input, and Batch Mode for processing multiple samples via CSV files. Both modes support all task types.
We provide example scripts under script/ and example data under assets/ to help you get started quickly:
assets/
├── examples/ # Example media files
│ ├── img1.jpeg
│ ├── img2.jpeg
│ ├── video1.mp4
│ └── video2.mp4
└── test_data/ # Example CSV files for batch mode
├── ti2i_example.csv
└── tv2v_example.csv
Single Sample Mode
Process a single image or video with a text prompt. See script/test_single_infer.sh for full examples.
Instruction-based Image-to-Image (TI2I):
bash
1python inference.py \2 --pretrained_model_name_or_path ./ckpts \3 --media_path ./assets/examples/img1.jpeg \4 --prompt "Change the time to night."\5 --output_path ./results/test_single_output/ti2i \6 --num_inference_steps 50\7 --task_type ti2i \8 --resolution 720p \9 --rewrite_instruction
Instruction-based Video-to-Video (TV2V):
bash
1python inference.py \2 --pretrained_model_name_or_path ./ckpts \3 --media_path ./assets/examples/video1.mp4 \4 --prompt "Replace the monkey with Ultraman. Keep the Ultraman's motion matched the original running pose and motion of monkey."\5 --output_path ./results/test_single_output/tv2v \6 --num_inference_steps 50\7 --num_frames 81\8 --task_type tv2v \9 --resolution 480p \10 --rewrite_instruction
More inference examples about generation tasks (T2I/T2V)
Text-to-Video (T2V):
bash
1python inference.py \2 --pretrained_model_name_or_path ./ckpts \3 --prompt "A giant humpback whale and its calf gracefully swim in the crystal-clear, deep blue open ocean."\4 --output_path ./results/test_single_output/t2v \5 --guidance_scale 4\6 --num_inference_steps 50\7 --num_frames 81\8 --task_type t2v \9 --resolution 480p \10 --aspect_ratio "16:9"\11 --rewrite_instruction
Text-to-Image (T2I):
bash
1python inference.py \2 --pretrained_model_name_or_path ./ckpts \3 --prompt "A group of five hikers, sitting on the snow mountain."\4 --output_path ./results/test_single_output/t2i \5 --guidance_scale 4\6 --num_inference_steps 50\7 --task_type t2i \8 --resolution 720p \9 --aspect_ratio "16:9"\10 --rewrite_instruction
Batch Mode (CSV)
Process multiple samples using a CSV file. See script/test_infer.sh for a full example.
CSV Format
For editing tasks (TI2I / TV2V), prepare a CSV with img_path/video_path and instruction columns:
For optimal quality and performance, we recommend the following settings:
Task Type
Recommended Resolution
Recommended Steps
Note
Video (T2V, TV2V)
480p
50
Balanced quality and generation speed
Image (T2I, TI2I)
720p
50
Higher quality for static images
Notes:
Resolution: You can experiment with higher resolutions (1024 or 1080p).
Inference Steps: 50 steps provide a good balance between quality and speed. You can use 30-40 steps for faster generation.
⚡ FP8 Quantization
Capybara supports FP8 (E4M3) weight-only quantization for the transformer via torchao. This roughly halves the transformer's weight memory, allowing larger resolutions or longer videos to fit in GPU VRAM.
Requirements:
NVIDIA GPU with compute capability >= 8.9 (Ada Lovelace or Hopper, e.g. RTX 4090, L40, H100)
torchao installed (pip install torchao)
ComfyUI
In the Capybara Load Pipeline node, set the quantize dropdown to fp8. The node handles everything automatically -- the transformer will be loaded in FP8 on GPU while other components (VAE, text encoders, etc.) still offload to CPU as usual.
If you find Capybara useful for your research, please consider citing:
bibtex
1@misc{capybara2026rao,
2 title={Capybara: A Unified Visual Creation Model},
3 author={Rao, Zhefan and Che, Haoxuan and Hu, Ziwen and Zou, Bin and Liu, Yaofang and He, Xuanhua and Choi, Chong-Hou and He, Yuyang and Chen, Haoyu and Su, Jingran and Li, Yanheng and Chu, Meng and Lei, Chenyang and Zhao, Guanhua and Li, Zhaoqing and Zhang, Xichen and Li, Anping and Liu, Lin and Tu, Dandan and Liu, Rui},
4 year={2026}
5}
📧 Contact
For questions and feedback, please open an issue on GitHub.