Nodes/SimpleSyrup/Latent From Image
ComfyUI Node

Latent From Image

Get back the latent your workflow already had

By Artificial-Sweetener·Created 5 months ago·Updated 21 days ago· 4
Latent From Image
  • image
  • latent

If you have ever done a hires pass and felt slightly robbed, this node is the complaint made executable. You sampled a latent, decoded it to pixels, then - because a second-pass sampler needs a LATENT - you shoved those pixels back through VAE Encode. That encode is lossy. You are asking an autoencoder to re-derive something it deleted on purpose. Latent From Image skips it: it walks your graph, finds the latent that produced the decoded image, and hands you that.

What it actually does

This is a plumbing node, not an image node. It has one input, one output, and no widgets - and at execution it doesn't compute a tensor at all. ComfyUI's dynamic-expansion path lets the node return the upstream link instead of a value, so the receiver downstream ends up wired straight to the original samples. Nothing is encoded, nothing is copied, and no VAE runs.

The trace is strict on purpose. Working backward from the image link, it accepts exactly two decode sources (VAEDecode, and SimpleSyrup's own VAE Decode options node) plus intermediate nodes that explicitly declare themselves as pass-through. Anything else and the trace stops - which is the point. The node only claims provenance when the graph proves it, and it fails loudly when it doesn't.

Because the recovered latent is the real sampler output, it also carries the right identity for the pack's noise reuse features. Latent From Image and Simple Upscale Latent are the two nodes the reuse tracer will happily walk through when it is looking for the source sampler behind your second pass.

Inputs and outputs

  • image - connect an image that came directly out of a VAE decode. That's it.
  • latent - the original latent, ready for a sampler, an upscaler (latent, not pixel), or anything else that wants LATENT.

There are no settings to tune. If you find yourself wanting a checkbox here, you probably want VAE Encode instead.

Install

ComfyUI Manager, search the Node Pack list for SimpleSyrup, install, restart. Legacy Manager puts the same search under Custom Nodes Manager.

Manual, with the Python that runs your ComfyUI:

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

Windows Portable:

.\python_embeded\python.exe -m pip install -r .\ComfyUI\custom_nodes\SimpleSyrup\requirements.txt

No models to download for this node. Restart ComfyUI afterward - and the whole pack needs a reasonably current ComfyUI, because it's written against the v3 extension API. Installing it into a frozen 2024 build is the fastest way to see nothing new in the node menu.

Where people get burned

You will meet this error eventually:

Unable to find an unmodified VAE Decode source for this image.

It means something between the decode and this node touched pixels. The usual suspects are a pixel upscaler, ImageScale, a crop, a detailer, a face-restore pass, or even a Preview in the chain. The rule of thumb: if the image was edited in any way, its latent is a fiction and this node refuses to tell it to you.

That's a feature, not a limitation - grep-free sanity check on your own graph. If you genuinely edited the pixels and you want to keep going, use VAE Encode and accept the roundtrip. The honest version of what you get here is "the exact latent the sampler produced", not "a latent that represents the image you're looking at".

One more: this is a graph-rewiring node, so it changes what downstream nodes receive rather than what you see in the preview. If your second pass suddenly looks different from your first-pass output, that's the missing encode showing up - same pixels when decoded, different latent going in. Which is usually the entire reason you reached for it.

CategorySimpleSyrup/Latent

Inputs (1)

NameTypeDefaultDescription
imageIMAGEConnect an unmodified VAE Decode image; the original latent is recovered through graph provenance.

Outputs (1)

NameTypeDescription
latentLATENTOriginal sampler latent with its sampling provenance.