Merge pull request #364 from xibosun/main

fix the example scripts in parallel_inference_xdit.py
This commit is contained in:
Yuxuan.Zhang 2024-09-27 13:57:53 +08:00 committed by GitHub
commit 4a2af29867
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,16 +7,20 @@ https://github.com/xdit-project/xDiT/blob/main/examples/cogvideox_example.py
By using this code, the inference process is parallelized on multiple GPUs, By using this code, the inference process is parallelized on multiple GPUs,
and thus speeded up. and thus speeded up.
You can also use the run.sh file in the same folder to automate running this
code for batch generation of videos.
Usage: Usage:
1. pip install xfuser 1. pip install xfuser
2. run the following command to generate video 2. mkdir results
torchrun --nproc_per_node=4 cogvideox_xdit.py --model <cogvideox-model-path> \ 3. run the following command to generate video
--ring_degree 2 --use_cfg_parallel --height 480 --width 720 --num_frames 9 \ torchrun --nproc_per_node=4 parallel_inference_xdit.py \
--model <cogvideox-model-path> --ulysses_degree 1 --ring_degree 2 \
--use_cfg_parallel --height 480 --width 720 --num_frames 9 \
--prompt 'A small dog.' --prompt 'A small dog.'
You can also use the run.sh file in the same folder to automate running this
code for batch generation of videos, by running:
sh ./run.sh
""" """
import time import time