Skip to content

Commit

Permalink
fix the example scripts in parallel_inference_xdit.py
Browse files Browse the repository at this point in the history
  • Loading branch information
xibosun committed Sep 26, 2024
1 parent dcb6795 commit 3304ea7
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions tools/parallel_inference/parallel_inference_xdit.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,20 @@
By using this code, the inference process is parallelized on multiple GPUs,
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:
1. pip install xfuser
2. run the following command to generate video
torchrun --nproc_per_node=4 cogvideox_xdit.py --model <cogvideox-model-path> \
--ring_degree 2 --use_cfg_parallel --height 480 --width 720 --num_frames 9 \
2. mkdir results
3. run the following command to generate video
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.'
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
Expand Down

0 comments on commit 3304ea7

Please sign in to comment.