You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: inference/cli_demo.py
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ def generate_video(
36
36
model_path: str,
37
37
lora_path: str=None,
38
38
lora_rank: int=128,
39
-
num_frames=81,
39
+
num_frames: int=81,
40
40
output_path: str="./output.mp4",
41
41
image_or_video_path: str="",
42
42
num_inference_steps: int=50,
@@ -57,7 +57,7 @@ def generate_video(
57
57
- lora_rank (int): The rank of the LoRA weights.
58
58
- output_path (str): The path where the generated video will be saved.
59
59
- 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.
61
61
- guidance_scale (float): The scale for classifier-free guidance. Higher values can lead to better alignment with the prompt.
62
62
- num_videos_per_prompt (int): Number of videos to generate per prompt.
63
63
- dtype (torch.dtype): The data type for computation (default is torch.bfloat16).
@@ -99,9 +99,9 @@ def generate_video(
99
99
# turn off if you have multiple GPUs or enough GPU memory(such as H100) and it will cost less time in inference
100
100
# and enable to("cuda")
101
101
102
-
# pipe.to("cuda")
102
+
pipe.to("cuda")
103
103
104
-
pipe.enable_sequential_cpu_offload()
104
+
# pipe.enable_sequential_cpu_offload()
105
105
106
106
pipe.vae.enable_slicing()
107
107
pipe.vae.enable_tiling()
@@ -154,7 +154,7 @@ def generate_video(
154
154
help="The path of the image to be used as the background of the video",
155
155
)
156
156
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"
158
158
)
159
159
parser.add_argument("--lora_path", type=str, default=None, help="The path of the LoRA weights to be used")
160
160
parser.add_argument("--lora_rank", type=int, default=128, help="The rank of the LoRA weights")
0 commit comments