Views
No views yet
THUDM/CogVideoX-5b.1import torch
2from diffusers import CogVideoXPipeline
3from diffusers.utils import export_to_video
4
5pipe = CogVideoXPipeline.from_pretrained("THUDM/CogVideoX-5b", torch_dtype=torch.bfloat16).to("cuda")
6pipe.load_lora_weights("a-r-r-o-w/cogvideox-disney-adamw-4000-0.0003-constant", weight_name="pytorch_lora_weights.safetensors", adapter_name="cogvideox-lora")
7
8# The LoRA adapter weights are determined by what was used for training.
9# In this case, we assume `--lora_alpha` is 32 and `--rank` is 64.
10# It can be made lower or higher from what was used in training to decrease or amplify the effect
11# of the LoRA upto a tolerance, beyond which one might notice no effect at all or overflows.
12pipe.set_adapters(["cogvideox-lora"], [32 / 64])
13
14video = pipe("BW_STYLE A black and white animated scene unfolds with an anthropomorphic goat surrounded by musical notes and symbols, suggesting a playful environment. Mickey Mouse appears, leaning forward in curiosity as the goat remains still. The goat then engages with Mickey, who bends down to converse or react. The dynamics shift as Mickey grabs the goat, potentially in surprise or playfulness, amidst a minimalistic background. The scene captures the evolving relationship between the two characters in a whimsical, animated setting, emphasizing their interactions and emotions", guidance_scale=6, use_dynamic_cfg=True).frames[0]
15export_to_video(video, "output.mp4", fps=8)