Nodes/raylight/Data Parallel KSampler (Advanced)
ComfyUI Node

Data Parallel KSampler (Advanced)

N generations, one run

By komikndr·Created about a year ago·Updated 2 days ago· 409
Data Parallel KSampler (Advanced)
  • ray_actors
  • noise_list
  • positive
  • negative
  • latent_image
  • latent
  • ray_actors
add_noise
steps20
cfg8.0
sampler_name
scheduler
start_at_step0
end_at_step10000
return_with_leftover_noise
denoise1.00

This is the workhorse of Raylight's Data Parallel mode - the thing you drop in where a normal KSampler (Advanced) would go, so that every GPU in the cluster runs the whole sampling job on its own, all at once. If you've got two GPUs and you're tired of queueing the same workflow twice to get two seeds, this node is the point of the pack.

How it works. Data Parallel doesn't shard your model and doesn't split your sequence. Each GPU holds the full model and processes the full sequence independently - you just get N results per run instead of one. That's a different trade than the pack's other modes: USP splits the sequence across GPUs (for fitting a model that won't fit on one card), FSDP shards the weights, and DP here is pure throughput. The README's rule of thumb is worth memorizing: enough VRAM → USP; not enough → FSDP; still not enough → FSDP CPU offload. DP is for when the model fits and you want volume.

The inputs that matter. Most of this will look familiar because it's a mirror of the core KSampler Advanced. The ones that aren't:

  • ray_actors - the tooltip says it plainly: "Ray Actor to submit the model into." This is the RayInitializer's output chain, and it's required on every Raylight sampler.
  • noise_list - "List of noise seeds for each GPU in data parallel mode." Feed it the output of DPNoiseList. This is what makes each GPU's run different.
  • positive / negative - plain CONDITIONING. Want different prompts per GPU? Wire DPConditioningList in here instead, and it fans out per GPU.

Then the familiar knobs: steps (20), cfg (8), sampler_name (44 choices), scheduler (9 choices), add_noise, start_at_step / end_at_step, return_with_leftover_noise, and denoise (1.0). If you know how to drive the core sampler, you know how to drive this.

Outputs. latent comes back as a list - one latent per GPU - and ray_actors passes through so you can chain another node after it. Decode the latents the way you'd decode a batch.

Where people get burned. The big one: DP mode requires Ulysses and Ring degrees set to 0 in your RayInitializer. The README is explicit - "Both FSDP and DP modes must have the Ulysses and Ring degrees set to 0." If you clone a USP workflow and forget, you get a confusing parallel-group error instead of a clean message. The second gotcha: DP doesn't combine VRAM. Each GPU needs enough for the whole model and the full sequence, so this won't rescue a model that OOMs on one card - that's FSDP's job. And on a 2-GPU box with a noise list that emits 8 seeds, only the first 2 are used; leftover seeds are harmless but don't be surprised.

Install. One pack install covers this node:

ComfyUI Manager → search "raylight" → Install

or:

cd ComfyUI/custom_nodes
git clone https://github.com/komikndr/raylight
cd raylight
pip install -r requirements.txt

Restart ComfyUI. The requirements.txt pulls ray>=2.48.0 and xfuser>=0.4.4 - that xfuser line is the heavyweight distributed-attention engine, and it's a chunky install. FlashAttention is optional now (Sage/Torch/Flash all work, and the README's own benchmark shows them within a few percent of each other). On Windows, expect to live in WSL2. If you're doing FSDP with fp8 models, pip install nvidia-nccl-cu12==2.28.9 and use PyTorch 2.8.1. And the community's honest feedback on the launch threads: the project moves fast, some models are "a bit unstable," and the fix is sometimes just restarting ComfyUI - keep that in your back pocket before you start blaming your hardware.

CategoryRaylight

Inputs (14)

NameTypeDefaultDescription
add_noiseCOMBO2 options: enable, disable
stepsINT201–10000
cfgFLOAT8.00–100
sampler_nameCOMBO44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38
schedulerCOMBO9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3
ray_actorsRAY_ACTORSRay Actor to submit the model into
noise_listNOISEList of noise seeds for each GPU in data parallel mode
positiveCONDITIONING
negativeCONDITIONING
latent_imageLATENT
start_at_stepINT00–10000
end_at_stepINT100000–10000
return_with_leftover_noiseCOMBO2 options: disable, enable
denoiseFLOAT1.000–1

Outputs (2)

NameTypeDescription
latentLATENT
ray_actorsRAY_ACTORS