How to use from the
Use from the
Diffusers library
pip install -U diffusers transformers accelerate
import torch
from diffusers import DiffusionPipeline
from diffusers.utils import load_image, export_to_video

# switch to "mps" for apple devices
pipe = DiffusionPipeline.from_pretrained("NimVideo/cogvideox-2b-img2vid", dtype=torch.bfloat16, device_map="cuda")
pipe.to("cuda")

prompt = "A man with short gray hair plays a red electric guitar."
image = load_image(
    "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/guitar-man.png"
)

output = pipe(image=image, prompt=prompt).frames[0]
export_to_video(output, "output.mp4")

πŸŽ₯ CogVideoX-2B-Img2Vid πŸš€

Fine-tuned on 10 million videos for high-quality generation at SBS levels comparable to CogVideoX-5B! 🌟

Model Highlights 🌟

  • Fine-tuned on 10 million videos for exceptional image-to-video generation quality.

  • Performance benchmarked to match SBS standards at CogVideoX-5B i2v level.

Usage Examples πŸ”₯

Try it for free on nim.video

CLI Inference 🌐

python -m inference.cli_demo \
    --video_path "resources/truck.jpg" \
    --prompt "A truck is driving through a dirt road, showcasing its capability for off-roading." \
    --model_path NimVideo/cogvideox-2b-img2vid

Gradio Inference with Web Demo πŸ–₯️

python -m inference.gradio_web_demo \
    --model_path NimVideo/cogvideox-2b-img2vid

ComfyUI Example πŸ’‘

Workflow Preview

πŸ”— JSON Workflow Example

πŸ”§ Find the custom ComfyUI node here.

Quick Start πŸš€

1️⃣ Clone the Repository

git clone https://github.com/Nim-Video/cogvideox-2b-img2vid.git
cd cogvideox-2b-img2vid

2️⃣ Set up a Virtual Environment

python -m venv venv
source venv/bin/activate

3️⃣ Install Requirements

pip install -r requirements.txt

Acknowledgements πŸ™

This project builds on the foundational work of CogVideoX.

Downloads last month
198
Safetensors
Model size
2B params
Tensor type
F16
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ 1 Ask for provider support