Skip to content

Commit 2151a3b

Browse files
update with diffusers
1 parent 68d93ce commit 2151a3b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

inference/cli_demo.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def generate_video(
3636
model_path: str,
3737
lora_path: str = None,
3838
lora_rank: int = 128,
39-
num_frames=81,
39+
num_frames: int = 81,
4040
output_path: str = "./output.mp4",
4141
image_or_video_path: str = "",
4242
num_inference_steps: int = 50,
@@ -57,7 +57,7 @@ def generate_video(
5757
- lora_rank (int): The rank of the LoRA weights.
5858
- output_path (str): The path where the generated video will be saved.
5959
- num_inference_steps (int): Number of steps for the inference process. More steps can result in better quality.
60-
- num_frames (int): Number of frames to generate.
60+
- num_frames (int): Number of frames to generate. CogVideoX1.0 generates 49 frames for 6 seconds at 8 fps, while CogVideoX1.5 produces either 81 or 161 frames, corresponding to 5 seconds or 10 seconds at 16 fps.
6161
- guidance_scale (float): The scale for classifier-free guidance. Higher values can lead to better alignment with the prompt.
6262
- num_videos_per_prompt (int): Number of videos to generate per prompt.
6363
- dtype (torch.dtype): The data type for computation (default is torch.bfloat16).
@@ -99,9 +99,9 @@ def generate_video(
9999
# turn off if you have multiple GPUs or enough GPU memory(such as H100) and it will cost less time in inference
100100
# and enable to("cuda")
101101

102-
# pipe.to("cuda")
102+
pipe.to("cuda")
103103

104-
pipe.enable_sequential_cpu_offload()
104+
# pipe.enable_sequential_cpu_offload()
105105

106106
pipe.vae.enable_slicing()
107107
pipe.vae.enable_tiling()
@@ -154,7 +154,7 @@ def generate_video(
154154
help="The path of the image to be used as the background of the video",
155155
)
156156
parser.add_argument(
157-
"--model_path", type=str, default="THUDM/CogVideoX-5b", help="Path of the pre-trained model use"
157+
"--model_path", type=str, default="THUDM/CogVideoX1.5-5B", help="Path of the pre-trained model use"
158158
)
159159
parser.add_argument("--lora_path", type=str, default=None, help="The path of the LoRA weights to be used")
160160
parser.add_argument("--lora_rank", type=int, default=128, help="The rank of the LoRA weights")

0 commit comments

Comments
 (0)