komikndr/raylight

Enable true multi gpu capability in Comfy UI using XDiT XFuser and FSDP managed by Ray

What it solves

Raylight addresses the hardware limitations of running large AI models in ComfyUI by enabling multi-GPU support. It allows users to combine the VRAM of multiple smaller GPUs to run models that would otherwise exceed the memory capacity of a single card, effectively scaling performance beyond what a single high-end GPU can handle.

How it works

Raylight uses the Ray framework to manage multiple GPU workers. It employs two primary techniques to distribute the workload:

  • Unified Sequence Parallelism (USP): Splits the image or video sequence data across multiple GPUs, allowing them to process parts of the generation simultaneously.
  • Fully Sharded Data Parallel (FSDP): Splits the actual model weights across the available GPUs. This allows you to load models that are too large for a single GPU's VRAM.

These methods can be used individually or combined alongside Data Parallelism (DP) and CFG parallelism to maximize hardware utilization.

Who it’s for

This tool is designed for ComfyUI users who have access to multiple GPUs and want to run large models (like Wan, Flux, or Hunyuan Video) that are too demanding for their individual cards. It is particularly useful for those who prefer using multiple mid-range GPUs rather than investing in a single expensive flagship card.

Highlights

  • Enables multi-GPU parallelism for ComfyUI workflows.
  • Supports model weight sharding (FSDP) to overcome VRAM limitations.
  • Implements Unified Sequence Parallelism (USP) for efficient sequence processing.
  • Compatible with a wide range of modern models including Wan, Flux, Qwen, and Hunyuan Video.
  • Includes experimental support for combining multiple parallel strategies (USP, FSDP, DP, CFG) simultaneously.

Related

  • Project
  • Project
  • Dispatch
  • Project
  • Project