Views
No views yet
| Name | Base Model | Reward Model | Hugging Face | Description |
|---|---|---|---|---|
| CogVideoX-Fun-V1.1-5b-InP-HPS2.1.safetensors | CogVideoX-Fun-V1.1-5b | HPS v2.1 | 🤗Link | Official HPS v2.1 reward LoRA (rank=128 and network_alpha=64) for CogVideoX-Fun-V1.1-5b-InP. It is trained with a batch size of 8 for 1,500 steps. |
| CogVideoX-Fun-V1.1-2b-InP-HPS2.1.safetensors | CogVideoX-Fun-V1.1-2b | HPS v2.1 | 🤗Link | Official HPS v2.1 reward LoRA (rank=128 and network_alpha=64) for CogVideoX-Fun-V1.1-2b-InP. It is trained with a batch size of 8 for 3,000 steps. |
| CogVideoX-Fun-V1.1-5b-InP-MPS.safetensors | CogVideoX-Fun-V1.1-5b | MPS | 🤗Link | Official MPS reward LoRA (rank=128 and network_alpha=64) for CogVideoX-Fun-V1.1-5b-InP. It is trained with a batch size of 8 for 5,500 steps. |
| CogVideoX-Fun-V1.1-2b-InP-MPS.safetensors | CogVideoX-Fun-V1.1-2b | MPS | 🤗Link | Official MPS reward LoRA (rank=128 and network_alpha=64) for CogVideoX-Fun-V1.1-2b-InP. It is trained with a batch size of 8 for 16,000 steps. |
| Prompt | CogVideoX-Fun-V1.1-5B | CogVideoX-Fun-V1.1-5B HPSv2.1 Reward LoRA | CogVideoX-Fun-V1.1-5B MPS Reward LoRA |
|---|---|---|---|
| Pig with wings flying above a diamond mountain | |||
| A dog runs through a field while a cat climbs a tree | |||
| Crystal cake shimmering beside a metal apple | |||
| Elderly artist with a white beard painting on a white canvas |
| Prompt | CogVideoX-Fun-V1.1-2B | CogVideoX-Fun-V1.1-2B HPSv2.1 Reward LoRA | CogVideoX-Fun-V1.1-2B MPS Reward LoRA |
|---|---|---|---|
| A blue car drives past a white picket fence on a sunny day | |||
| Blue jay swooping near a red maple tree | |||
| Yellow curtains swaying near a blue sofa | |||
| White tractor plowing near a green farmhouse |
[!NOTE] The above test prompts are from T2V-CompBench. All videos are generated with lora weight 0.7.
1import torch
2from diffusers import CogVideoXDDIMScheduler
3
4from cogvideox.models.transformer3d import CogVideoXTransformer3DModel
5from cogvideox.pipeline.pipeline_cogvideox_inpaint import CogVideoX_Fun_Pipeline_Inpaint
6from cogvideox.utils.lora_utils import merge_lora
7from cogvideox.utils.utils import get_image_to_video_latent, save_videos_grid
8
9model_path = "alibaba-pai/CogVideoX-Fun-V1.1-5b-InP"
10lora_path = "alibaba-pai/CogVideoX-Fun-V1.1-Reward-LoRAs/CogVideoX-Fun-V1.1-5b-InP-HPS2.1.safetensors"
11lora_weight = 0.7
12
13prompt = "Pig with wings flying above a diamond mountain"
14sample_size = [512, 512]
15video_length = 49
16
17transformer = CogVideoXTransformer3DModel.from_pretrained_2d(model_path, subfolder="transformer").to(torch.bfloat16)
18scheduler = CogVideoXDDIMScheduler.from_pretrained(model_path, subfolder="scheduler")
19pipeline = CogVideoX_Fun_Pipeline_Inpaint.from_pretrained(
20 model_path, transformer=transformer, scheduler=scheduler, torch_dtype=torch.bfloat16
21)
22pipeline.enable_model_cpu_offload()
23pipeline = merge_lora(pipeline, lora_path, lora_weight)
24
25generator = torch.Generator(device="cuda").manual_seed(42)
26input_video, input_video_mask, _ = get_image_to_video_latent(None, None, video_length=video_length, sample_size=sample_size)
27sample = pipeline(
28 prompt,
29 num_frames = video_length,
30 negative_prompt = "bad detailed",
31 height = sample_size[0],
32 width = sample_size[1],
33 generator = generator,
34 guidance_scale = 7.0,
35 num_inference_steps = 50,
36 video = input_video,
37 mask_video = input_video_mask,
38).videos
39
40save_videos_grid(sample, "samples/output.mp4", fps=8)