EasyCache (Ray)
Skip the attention that doesn't change
- ray_actors
- ray_actors
During diffusion sampling, most steps aren't really changing the image - early steps do the big structural work and the middle steps make tiny refinements. EasyCache is the family of techniques that exploit that: cache the attention hidden states from a step, and when the next step's states would be nearly identical, reuse the cached ones instead of recomputing. RayEasyCache is the distributed version, added to Raylight by rmatif, and it's one of the highest-value nodes in the pack if you're sampling big video models - the kind of speedup where you keep it installed forever.
How it works. The node patches the model (it's a ray_actors in, ray_actors out patch node, same contract as the guidance nodes) and registers a cache holder through the model's transformer options. During sampling it tracks hidden states, and between steps it compares - cheaply, via a subsampled check - how much the states have changed. If they've changed less than reuse_threshold, it reuses the cached states for that layer instead of recomputing. The distributed_sync option keeps the cache coherent across GPU ranks, which matters in USP/FSDP mode where the sequence is split - the ranks have to agree on what got cached, or you get artifacts at the seams.
The inputs that matter. Three required, three optional:
ray_actors- the initializer chain.reuse_threshold- how similar states must be before reuse kicks in, default 0.2, range 0–3. Higher = more aggressive caching = faster but more quality drift. Start at the default; only raise it if you're comfortable with the quality trade.start_percentandend_percent- the sampling window where caching is active, defaults 0.15 to 0.95. The defaults are sensible: skip the first steps (they're changing fast) and the last steps (they set the final details), cache the boring middle.subsample_factor- how coarse the similarity check is, default 8. Performance knob; leave it.verbose- turn on to see what the cache is doing in the console. Useful exactly once, when you're tuning.distributed_sync- default true; keep it true on multi-GPU.
Where it fits. This is the TeaCache/EasyCache family that's become standard for video models, and in a distributed pack it lands hard: caching saves attention compute, which is the dominant cost, and on a multi-GPU split that saving multiplies. If your Wan or LTX run feels slow and you haven't tried this node, it's the single highest-leverage experiment in the pack. The honest caveat: aggressive caching can cause flicker in video or subtle quality drift, so it's a dial, not a free lunch - but at defaults, most people can't reliably tell the difference and happily take the speed.
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.
Wire it in series like any patch node - RayInitializer → RayEasyCache → sampler - A/B it on one run, and if the output survives the comparison, never take it out again.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| ray_actors | RAY_ACTORS | — | |
| reuse_threshold | FLOAT | 0.200–3 | — |
| start_percent | FLOAT | 0.150–1 | — |
| end_percent | FLOAT | 0.950–1 | — |
| subsample_factoropt | INT | 81–16 | — |
| verboseopt | BOOLEAN | false | — |
| distributed_syncopt | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| ray_actors | RAY_ACTORS | — |