Nodes/raylight/Dual CFG Guider (Ray)
ComfyUI Node

Dual CFG Guider (Ray)

Two positives, one negative, two scales

By komikndr·Created about a year ago·Updated 2 days ago· 409
Dual CFG Guider (Ray)
  • ray_actors
  • cond1
  • cond2
  • negative
  • guider
cfg_conds8.0
cfg_cond2_negative8.0
style

Most of the time one positive and one negative are enough. RayDualCFGGuider is for when they aren't - when your generation is pulled by two independent positive conditionings, each with its own scale, both steering away from a shared negative. This is the distributed twin of core ComfyUI's DualCFGGuider, and it's the node you reach for on multi-conditional setups: a style embedding plus your actual prompt, an image conditioning plus text, a character reference plus a scene.

The inputs that matter. Six, all required:

  • ray_actors - the initializer chain.
  • cond1 and cond2 - the two positive conditionings.
  • negative - the shared negative.
  • cfg_conds - guidance scale for cond1, default 8.
  • cfg_cond2_negative - guidance scale for cond2, default 8. The name is a mouthful but the meaning is simple: this is how hard cond2 pushes against the negative. Don't assume the two scales need to match; a common pattern is a strong style term and a weaker content term.
  • style - two choices: regular and nested. This is the knob people gloss over, and it changes how the two CFG terms combine. regular treats the two positive terms as parallel branches against the negative; nested applies one CFG inside the other's result, which is the closer match for setups where one conditioning is a modifier of the other. If the output looks washed out or over-baked with one style, try the other before touching the scales.

Output. A RAY_GUIDER for DPSamplerCustomAdvanced. Same handoff as RayCFGGuider, just more input ports on the front.

Where it fits. This is a niche node and it knows it. It lives in the custom-sampling stack precisely because that stack is where people build the experimental multi-conditioning graphs. If your model runs at CFG=1 (Flux, Wan, Hunyuan), dual CFG is as pointless as regular CFG - the branches don't exist to split. If you're on SDXL/SD1.5/Chroma-class guidance, though, this is how you get two-conditioning control in a Raylight graph, and it's also one of the few places in the pack where the style option actually rewards experimentation.

Gotchas. The scales defaulting to 8 for both is a trap on modern models - 8 is an SDXL-era number, and models like Chroma want something closer to 3–4. Start both low and raise them one at a time so you can hear each conditioning working. And the usual family rules apply: it's a guider for the custom sampler, not a standalone sampler, and per-GPU behavior only exists when you're in Data Parallel mode with the initializer set correctly.

Install. Part of the pack:

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 install, FlashAttention is optional, and Windows realistically means WSL2.

If you don't have two distinct conditionings in mind, skip this node - you're adding a knob you won't use. If you do, regular versus nested is the first thing to flip when results surprise you.

CategoryRaylight/extra/custom_sampling/guiders

Inputs (7)

NameTypeDefaultDescription
ray_actorsRAY_ACTORS
cond1CONDITIONING
cond2CONDITIONING
negativeCONDITIONING
cfg_condsFLOAT8.00–100
cfg_cond2_negativeFLOAT8.00–100
styleCOMBO2 options: regular, nested

Outputs (1)

NameTypeDescription
guiderRAY_GUIDER