Nodes/raylight/Epsilon Scaling (Ray)
ComfyUI Node

Epsilon Scaling (Ray)

The 0.5% nudge that sharpens things up

By komikndr·Created about a year ago·Updated 2 days ago· 409
Epsilon Scaling (Ray)
  • ray_actors
  • ray_actors
scaling_factor1.005

Every sampling step predicts noise, subtracts it, and moves on. RayEpsilonScaling is a tiny patch that scales that predicted noise before it gets subtracted - and "tiny" is doing a lot of work there, because the default scaling factor is 1.005. Half a percent. That's the whole node, and it's the sort of detail that either fixes a nagging softness in your output or does absolutely nothing you can perceive. Usually the latter, occasionally the former.

How it works. The math from the source is two lines: the corrected output is input - ((input - denoised) / scaling_factor). The (input - denoised) term is the model's predicted noise (in epsilon-prediction terms), and dividing it by a factor above 1 means you subtract more noise than the model proposed - you denoise slightly harder each step. A factor below 1 does the opposite, denoising more gently. At the default 1.005 you're asking for a hair more denoising per step, which in practice reads as a touch more contrast and crispness at the end of a run.

The inputs that matter. Two, both required: ray_actors (the initializer chain) and scaling_factor, default 1.005, range 0.5–1.5. The range is generous - you can crank it to 1.5 and get aggressively harder denoising - but the effects compound across every step of the run, so the extremes produce visibly degraded output rather than just "crisper." If you're going to deviate from the default, nudge it to 1.01 or 1.02, run, compare, and stop.

Output. ray_actors, passed through. Same patch-node contract as the other guidance nodes: wire it in series between the initializer and the sampler. It applies its post-CFG function to the model on every worker, then hands the chain onward.

Where it fits. Reach for it when output looks slightly soft or low-contrast and you've already ruled out the usual suspects (CFG, scheduler, sampler). It's a finishing tweak, not a foundation - the kind of knob you set once per model and forget. It pairs naturally with the CFG-correction nodes (RayCFGNorm, RayCFGZeroStar) for high-CFG setups that need both magnitude and sharpness fixes, though for most workflows it'll be redundant with just lowering your CFG slightly.

The honest assessment: on a single run you may not see the difference at all. Where it tends to show up is consistency across a batch - slightly punchier output on average, marginally more defined texture. It's the smallest possible lever in the guidance toolbox, and its size is the feature: one input, one decimal, zero harm in testing.

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

If you're not the type to A/B a half-percent knob, skip it - it'll never be the thing that's wrong with your workflow. If you are, it's a five-minute experiment that sometimes quietly becomes a permanent fixture in your graph.

CategoryRaylight/extra/guidance

Inputs (2)

NameTypeDefaultDescription
ray_actorsRAY_ACTORS
scaling_factorFLOAT1.0050.5–1.5

Outputs (1)

NameTypeDescription
ray_actorsRAY_ACTORS