Skip to content

Conversation

@pftq
Copy link
Contributor

@pftq pftq commented Mar 31, 2025

The video has half the screen covered in static noise when using multi-GPU with 2 GPUs, 3/4 of the screen when using 4 GPUs, etc. This happens when seed is not specified because each GPU generates its own random seed and doesn't sync. This fixes that bug identified here:
#35

Additionally, I implemented the --batch-size to allow for batch creation of videos without reloading the model each time. There are also other quality-of-life features:

  • Variety batch ("--variety-batch") option for varying up CFG/Steps between videos in a batch.
  • Prompt details embedded in MP4 video metadata comments (requires ffmpeg installed: apt-get install -y ffmpeg).
  • More useful filenames with CFG, Steps, seed, lora name, #GPUs, etc.
  • Maintained aspect ratio when resizing to divide evenly among GPUs in multi-GPU spatial parallelization.

@pftq
Copy link
Contributor Author

pftq commented Apr 3, 2025

This also indirectly fixed #60 (comment)

@pftq
Copy link
Contributor Author

pftq commented Apr 5, 2025

Fixed one more bug in the resizing code. If you try 720x720 (540p) on 8 GPUs, it'll run into divisibility issues again. I managed to fix it by having the crop_size_list regenerated based on the diviser instead of 32, so it looks like the list/filter doesn't quite work and it's safer to just generate a new crop list.
crop_size_list = generate_crop_size_list(bucket_hw_base_size, diviser)
The full block:

            crop_size_list = generate_crop_size_list(bucket_hw_base_size, 32)
            aspect_ratios = np.array([round(float(h)/float(w), 5) for h, w in crop_size_list])
            closest_size, closest_ratio = get_closest_ratio(origin_size[1], origin_size[0], aspect_ratios, crop_size_list)

            if ulysses_degree != 1 or ring_degree != 1:
                diviser = get_sequence_parallel_world_size() * 8 * 2
                if closest_size[0] % diviser != 0 and closest_size[1] % diviser != 0:
                    crop_size_list = generate_crop_size_list(bucket_hw_base_size, diviser)
                    xdit_crop_size_list = list(filter(lambda x: x[0] % diviser == 0 or x[1] % diviser == 0, crop_size_list))
                    xdit_aspect_ratios = np.array([round(float(h)/float(w), 5) for h, w in xdit_crop_size_list])
                    xdit_closest_size, closest_ratio = get_closest_ratio(origin_size[1], origin_size[0], xdit_aspect_ratios, xdit_crop_size_list)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant