"""
Experimental local CogVideoX example.
Requires a CUDA GPU with enough VRAM and the Hugging Face diffusers stack.
"""
import torch
from diffusers import DiffusionPipeline
from diffusers.utils import export_to_video

MODEL_ID = "zai-org/CogVideoX-2b"
PROMPT = "A cinematic 5 second wellness video, natural light, premium health dashboard, realistic blood test scene"

pipe = DiffusionPipeline.from_pretrained(MODEL_ID, torch_dtype=torch.bfloat16)
pipe.enable_model_cpu_offload()

video = pipe(prompt=PROMPT, num_frames=49, guidance_scale=6, num_inference_steps=50).frames[0]
export_to_video(video, "output.mp4", fps=8)
print("Saved output.mp4")
