Boyo Latent Cache Updater
Sneak a sampler's output back into the next loop pass without a graph cycle
- latent
- latent
ComfyUI won't let you connect a node's output back into its own input - that's a cycle, and cycles crash the graph. But infinite and chunked video generation runs on exactly that dependency: the next chunk needs the previous chunk's latent as its starting point. Boyo Latent Cache Updater is the workaround. It writes a latent into the pack's loop cache under a string key and passes the tensor through untouched. The write and the read are split across two nodes, so there's no cycle - just a cache handshake.
The shape is: sampler output → Latent Cache Updater (writes to cache, passes through) → VAE decode / save / whatever. Then, on the next iteration, its partner Boyo Latent Switch reads the cached latent and feeds it to the sampler's latent input. Two nodes, no edge between sampler output and sampler input, and the loop is legal.
The inputs
- latent - the tensor to cache. Usually the samples straight out of a KSampler.
- cache_key - the string that identifies this cache slot, default
latent_loop_cache. This must match thecache_keyon the Boyo Latent Switch that reads it. Change one and forget the other and you've got a silent cache miss. - counter - optional loop iteration number, only used for logging.
Output: latent, the exact same tensor you put in, unchanged.
Install
Part of Boyonodes. ComfyUI Manager → search "Boyonodes", or:
cd ComfyUI/custom_nodes
git clone https://github.com/DragonDiffusionbyBoyo/Boyonodes
Restart. No extra dependencies - it talks to the loop cache the pack already ships in boyo_for_loops_exact.py.
The mental model
Think of it as a note pinned for the next iteration to find, not a data connection. The key insight - and the thing people trip on - is that the updater alone does nothing useful. It's half a pair: write here, read at Boyo Latent Switch. If your loop isn't carrying context forward, check that both nodes use the same cache_key before you blame the sampler.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| latent | LATENT | — | |
| cache_key | STRING | latent_loop_cache | — |
| counteropt | INT | 00–999999 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| latent | LATENT | — |