ComfyUI Node

Latent (Improved)

Latent (Improved) — order your latent stages, stop the stale-decode problem

By augment-lib·Created 6 months ago·Updated 6 months ago· 2
Latent (Improved)
  • value
  • trigger
  • value
  • json
  • trigger

AugmentWaitLatent - "Latent (Improved)" in the menu - is the trigger-aware passthrough for the LATENT type in Augment's Flow Control family. Latents are the compressed image representations that flow between the VAE and the sampler, and they're the classic victim of ComfyUI's caching: change something upstream, and the sampler happily runs on a latent that wasn't regenerated. If you've ever stared at an unchanged render after tweaking a prompt, you've met this problem.

This node is the fix for the latent half of that: carry the latent through your graph in a pinned order so encode → sampler → decode stages actually run as a sequence, every time.

How it works

The name is a bit of a fib - it doesn't hold the latent until a trigger arrives. The source's execute passes the value straight through and emits a trigger token. The real mechanism is the pack's executor override: on import, Augment patches ComfyUI's execution internals so any node that takes or emits a TRIGGER type always re-runs and is never pruned by the output cache. Chain trigger outputs into the next stage's trigger input and you've forced real order onto stages that would otherwise evaluate "all at once, then maybe skip the ones that looked unchanged."

So think of it as a sequencing node for latents, not a gate.

The inputs and outputs

  • value (LATENT, required) - the latent to carry. Comes in on the wire; there's no widget here.
  • trigger (optional) - the sequencing input from a previous stage.
  • Outputs value (LATENT), json (AUGMENT_JSON), trigger (TRIGGER) - the latent passes through untouched, the trigger continues the chain, and json carries a structured dump (type and value as a string) for Augment's JSON Extract / JSON Viewer.

Nothing to configure - its job is purely ordering and forcing re-execution.

How to install

Augment isn't on the ComfyUI registry yet, so clone it manually. The folder name is the classic trap:

cd ComfyUI/custom_nodes
git clone https://github.com/augment-lib/augment-ComfyUI augment
cd augment
pip install -r requirements.txt

The clone target must be augment - the pack imports everything as custom_nodes.augment.py.*, so the default folder name breaks every node. Restart ComfyUI afterward; nodes appear under Augment.

Dependencies are light (opencv-python, numpy, torch, Pillow, requests) and already installed from running ComfyUI. No model files, no API key - the paid API only applies to the pack's vector nodes.

Common issues

  • Sampler reusing a stale latent - cache behavior. Threading the latent through this node and sequencing the triggers forces regeneration in order.
  • Node missing after install - folder name. Rename to augment and restart.
  • Full graph re-runs every time - by design. Trigger nodes always re-execute; keep Wait nodes on paths where deterministic re-runs earn their keep.
CategoryAugment/Utils

Inputs (2)

NameTypeDefaultDescription
valueLATENT
triggeroptTRIGGER

Outputs (3)

NameTypeDescription
valueLATENT
jsonAUGMENT_JSON
triggerTRIGGER