mirror of
https://github.com/THUDM/CogVideo.git
synced 2025-04-06 03:57:56 +08:00
docs: enhance CLI demo documentation
This commit is contained in:
parent
bf9c351a10
commit
bf73742c05
@ -14,7 +14,10 @@ To run the script, use the following command with appropriate arguments:
|
|||||||
$ python cli_demo.py --prompt "A girl riding a bike." --model_path THUDM/CogVideoX1.5-5b --generate_type "t2v"
|
$ python cli_demo.py --prompt "A girl riding a bike." --model_path THUDM/CogVideoX1.5-5b --generate_type "t2v"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
You can change `pipe.enable_sequential_cpu_offload()` to `pipe.enable_model_cpu_offload()` to speed up inference, but this will use more GPU memory
|
||||||
|
|
||||||
Additional options are available to specify the model path, guidance scale, number of inference steps, video generation type, and output paths.
|
Additional options are available to specify the model path, guidance scale, number of inference steps, video generation type, and output paths.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
@ -22,6 +25,7 @@ import logging
|
|||||||
from typing import Literal, Optional
|
from typing import Literal, Optional
|
||||||
|
|
||||||
import torch
|
import torch
|
||||||
|
|
||||||
from diffusers import (
|
from diffusers import (
|
||||||
CogVideoXDPMScheduler,
|
CogVideoXDPMScheduler,
|
||||||
CogVideoXImageToVideoPipeline,
|
CogVideoXImageToVideoPipeline,
|
||||||
@ -134,8 +138,9 @@ def generate_video(
|
|||||||
# 3. Enable CPU offload for the model.
|
# 3. Enable CPU offload for the model.
|
||||||
# turn off if you have multiple GPUs or enough GPU memory(such as H100) and it will cost less time in inference
|
# turn off if you have multiple GPUs or enough GPU memory(such as H100) and it will cost less time in inference
|
||||||
# and enable to("cuda")
|
# and enable to("cuda")
|
||||||
|
|
||||||
# pipe.to("cuda")
|
# pipe.to("cuda")
|
||||||
|
|
||||||
|
# pipe.enable_model_cpu_offload()
|
||||||
pipe.enable_sequential_cpu_offload()
|
pipe.enable_sequential_cpu_offload()
|
||||||
pipe.vae.enable_slicing()
|
pipe.vae.enable_slicing()
|
||||||
pipe.vae.enable_tiling()
|
pipe.vae.enable_tiling()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user