CFG Guider (Ray)
Your old friend CFG, distributed
- ray_actors
- positive
- negative
- guider
Classifier-free guidance is the oldest trick in the book, and RayCFGGuider is that trick running on the Ray cluster: positive conditioning pulled away from negative conditioning by a scale you choose. If you're building a custom sampling graph with Raylight and your model actually uses CFG - SDXL, SD1.5, Chroma, Qwen Image, the ERNIE models - this is the guider you wire in. The distilled video models that run at CFG=1 don't need it; RayBasicGuider is their lane.
The inputs that matter. Four, all required:
ray_actors- the initializer chain.positiveandnegative- your twoCONDITIONINGinputs. The negative is optional in spirit (you can feed it an empty conditioning) but the port is required.cfg- the guidance scale, default 8.0. That's a very SDXL default; for Chroma and Qwen Image the README's own benchmark workflows run 3.5 and 2.5 respectively. If you paste a workflow and the results look overcooked, dial this down before you blame the model.
Output. A RAY_GUIDER feeding DPSamplerCustomAdvanced's guider input. That's the whole arc: build the guider here, sample with it there.
Why it matters in the parallel world. CFG isn't just a scaling knob in Raylight - it's a parallelism axis. The pack's CFG mode splits the conditional and unconditional branches across GPUs, which is how two weak GPUs can feel like a bigger one for SD1.5/SDXL-class work (the README's benchmark shows a 2× RTX 2000 Ada running SDXL's CFG work in roughly the time you'd expect from a single stronger card). The catch, spelled out in the README: "CFG parallel for Flux, Hunyuan ... since these models do not support conditional batches (CFG = 1), enabling it has no effect." So the CFG-parallel speedup only exists for models that genuinely use guidance - which is exactly the set this guider serves.
Gotchas. The most common mistake is using this on a CFG=1 model and then hunting for a speedup that structurally can't happen. Second: forgetting that a negative prompt on a distilled model isn't a free win - if the model was trained at CFG=1, even a small scale can push it off its distribution and you get weird oversaturation. When in doubt, RayBasicGuider is the safer default and RayCFGGuider is the upgrade for models that earn it.
Install. One pack install:
cd ComfyUI/custom_nodes
git clone https://github.com/komikndr/raylight
cd raylight
pip install -r requirements.txt
or ComfyUI Manager → search "raylight" → Install, restart. xfuser is the heavy dependency, FlashAttention is optional, Windows means WSL2.
Before you trust a CFG value from a shared workflow, check the model's support row in the README - several models are listed as FSDP/USP-ready but CFG-only or untested, and the supported-models table is more reliable than the workflow you downloaded.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| ray_actors | RAY_ACTORS | — | |
| positive | CONDITIONING | — | |
| negative | CONDITIONING | — | |
| cfg | FLOAT | 8.00–100 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| guider | RAY_GUIDER | — |