VideoTriangleCFGGuidance (Ray)
VideoTriangleCFGGuidance (Ray)
- ray_actors
- ray_actors
If you've ever made a looping video and watched the seam - the last frame and the first frame clearly not matching - this node exists for exactly that problem. VideoTriangleCFGGuidance (Ray) ramps your CFG up and back down across the sequence, so the start and end of your clip get gentle guidance and the middle gets the full treatment. Loops land softer on both ends, which is precisely what makes them loopable.
It's Raylight's sibling to VideoLinearCFGGuidance: same pack, same Raylight/extra/guidance category, same shape as a node. Raylight is Komikndr's multi-GPU kit for ComfyUI - the "two 5070s instead of a 5090" crowd - splitting work across GPUs with USP sequence parallelism and sharding weights with FSDP. This node is a patch on the model in your RAY_ACTORS chain, not a sampler.
How it works
Where the linear variant climbs from min_cfg to full CFG and stops, this one takes that ramp and mirrors it. The code builds a sawtooth across the batch:
values = 2 * abs(linspace(0, 1, n) - floor(linspace(0, 1, n) + 0.5))
scale = values * (cond_scale - min_cfg) + min_cfg
Read that as: guidance starts at min_cfg, ramps to your sampler's CFG in the middle, and eases back to min_cfg at the end. For a loop, the last frame and first frame are generated under near-identical, low guidance, which is the single biggest thing you can do to make the seam invisible. It's the same idea as easing in/out in animation, applied to how hard the model is steered.
The inputs
Same minimal footprint as its sibling:
- ray_actors - in, then out. Wire from your model loader through to the sampler.
- min_cfg (default 1.0) - guidance at both ends of the clip. Lower = softer loop seam, but flat starts; raise it if your opening and closing frames feel detached from the prompt.
Install
Part of the raylight pack - Manager install by searching raylight, or:
cd ComfyUI/custom_nodes
git clone https://github.com/komikndr/raylight
cd raylight
<your_python> -m pip install -r requirements.txt
No extra deps beyond the pack's usual ray + xfuser set. Restart ComfyUI and the node shows up under Raylight → extra → guidance.
Gotchas
Two things trip people up. First, wiring: this must sit between the Load Diffusion Model (Ray) and the sampler, since it patches the model that flows through ray_actors. Second, don't stack it with the linear guidance node on the same chain - both override the CFG function and the last one wins, so you'll get one ramp, not a blend, and you'll be confused about which is doing the work. Pick one, learn its behavior, and only change min_cfg.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| ray_actors | RAY_ACTORS | — | |
| min_cfg | FLOAT | 1.00–100 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| ray_actors | RAY_ACTORS | — |