Nodes/SimpleSyrup/Attach Sampling Provenance (Internal)
ComfyUI Node

Attach Sampling Provenance (Internal)

Teaching a plain LATENT where it came from

By Artificial-Sweetener·Created 5 months ago·Updated 21 days ago· 4
Attach Sampling Provenance (Internal)
  • latent
  • capture
  • latent

ComfyUI's LATENT is a dictionary with samples, an optional mask, and a whole lot of missing context: which model produced it, which latent format it's in, which noise levels were recorded along the way. Since you can't add sockets to a type every other pack also speaks, SimpleSyrup smuggles that metadata inside the latent itself. This node is the stamping step.

What it does

Two inputs, one output, no widgets: it takes the completed source sampler output and the capture belonging to that exact execution, checks they match, and returns the latent with verified provenance attached. The verification is the substance - the capture knows which model it observed and which states it recorded, and it validates that the latent actually came out of that run before publishing any of it. Mismatch, and it fails instead of attaching a plausible-looking lie.

In a normal noise-reuse workflow you don't place this. When you enable Noise Reuse Options on a receiving sampler, the pack rewrites the prompt: it injects the trajectory capture into the source model chain, then inserts this node between the source sampler and everything that consumed its latent. Walk the prompt JSON afterwards and you'll see every consumer of that latent slot now reading this node's output instead - collect decode, upscalers, a second sampler, all of them.

Inputs and outputs

  • latent - the completed source sampler output. Not a partially denoised latent, not a decoded image.
  • capture - the capture handle from Trajectory Capture Model, for this exact source run.
  • latent - the same latent, now carrying verified sampling provenance: the latent format, the recorded real states and their separated residuals, and the source schedule.

Everything downstream still sees an ordinary LATENT, which is the whole point. Impact Pack detailers, a plain VAEDecode, another pack's nodes - they don't need to know the metadata is there. Only the nodes that care (the noise-reuse path, Simple Upscale Latent in Auto mode) go looking for it.

Install

It comes with the pack; there's nothing to fetch.

cd ComfyUI/custom_nodes
git clone https://github.com/Artificial-Sweetener/SimpleSyrup.git
cd SimpleSyrup
../../venv/bin/python -m pip install -r requirements.txt

Manager route: search the Node Pack list for SimpleSyrup, install, restart. As with the rest of the pack's internal nodes, you need a current ComfyUI - this is written against the v3 extension API.

Where it goes wrong

Provenance is per-run, and ComfyUI caches aggressively. If the source sampler's output is cached from an earlier queue while the receiving sampler now asks for a different noise level, the recorded states won't include what's being requested. The reuse path detects this and tells you to queue again - the current level was never saved. Reading it as "I queued twice and then it worked" is accurate.

Metadata does not survive a rebuild. Going image → VAE Encode → new latent produces a fresh latent with no provenance on it, which is why the pack's noise-reuse tracer walks through Latent From Image and its latent upscaler instead of re-encoding. Break that chain and the stamp is simply absent; the downstream feature falls back or errors rather than guessing.

Don't hand-wire captures across runs. The identity check is there to stop you, but it's easy to defeat by copying a capture socket from a different branch of a big graph. If the reported error mentions the source execution not matching, that's what happened.

CategorySimpleSyrup/Internal

Inputs (2)

NameTypeDefaultDescription
latentLATENTCompleted source sampler output.
captureSIMPLE_SYRUP_TRAJECTORY_CAPTURECapture belonging to this exact source sampler execution.

Outputs (1)

NameTypeDescription
latentLATENTOriginal latent with verified sampling provenance.