Nodes/comfyui-scene-generator/🔧 Latent Boundary Analyzer
ComfyUI Node

🔧 Latent Boundary Analyzer

See your outpaint seam before the sampler gets the blame

By elliefox-ai·Created 2 months ago·Updated 9 days ago· 1
🔧 Latent Boundary Analyzer
  • image
  • vae
  • mask
  • latent_heatmap
  • boundary_zoom
boundary_width32

Outpainting seams are annoying for a specific reason: by the time you see the artifact in the final image, you have no idea where it came from. Is the sampler refusing to blend the padding in? Is the VAE mangling the transition between your source and the generated region? Is it a mask problem? LatentBoundaryAnalyzer exists to answer one slice of that - what the latent space actually looks like at the boundary between your image and the padded area.

It ships in elliefox-ai/comfyui-scene-generator, a pack whose center of gravity is outpainting. This node is one half of the author's own seam-debugging kit (the other is VAERoundTrip, a pure encode→decode check). Think of it as the X-ray layer: it encodes your image through the VAE and visualizes where the latent energy spikes at the mask edge.

How it works

The mechanism is refreshingly direct. The node:

  1. Encodes the image through the VAE to get a latent tensor.
  2. Computes per-channel latent energy (the L2 norm across channels) at every location.
  3. Upscales that energy map back to full image resolution and normalizes it.
  4. Renders it as a heatmap - blue is low energy, red is high energy.

The second output, boundary_zoom, takes the mask, finds where it transitions (the edge between source and padding), and dims everything outside that boundary zone so you can stare at the seam in isolation. If there's a big energy spike or discontinuity right at the boundary, that's a strong hint the VAE itself is struggling with the transition - which means no amount of prompt tuning will fix it, because the problem is upstream of sampling.

Inputs and outputs

  • image - your padded image (source + padding composited).
  • vae - the VAE you're actually using in your generation workflow. This matters: the whole point is to test your VAE, not a random one.
  • mask - the same mask you're feeding your outpaint workflow. This is how the node knows where the boundary is.
  • boundary_width - labeled as the width of the boundary zone to analyze, in pixels per side. Default 32, range 8–128.

One honest gotcha: in the current implementation boundary_width is accepted but not actually consulted - the boundary is derived from the full mask gradient regardless of the value you set. It's harmless to leave at default; just don't expect the knob to change much yet.

Outputs: latent_heatmap (IMAGE) and boundary_zoom (IMAGE). Both are visualization outputs - they're meant for a preview or a save node, not for downstream conditioning.

Installing it

It comes with the pack, so:

cd ComfyUI/custom_nodes/
git clone https://github.com/elliefox-ai/comfyui-scene-generator.git ComfyUI-EllieFoxAI-scene-gen

Restart, then find it under EllieFoxAI/Diagnostics - look for 🔧 Latent Boundary Analyzer. ComfyUI Manager can do it too (search "comfyui-scene-generator"). No extra Python dependencies, no model downloads; it only needs the VAE you already have loaded.

Common issues

  • Heatmap is all one color - the map is normalized to its own max, so a flat image produces a flat map. That's not a bug; it means low contrast at the boundary, which is what you want.
  • Reading it wrong - this shows relative latent energy, not a prediction of where seams will be. Use it to compare before/after a change (a different VAE, a different feather setting), not to declare a single image good or bad.
  • Wrong VAE gives misleading results - if the VAE doesn't match your checkpoint, you're analyzing a codec you aren't even using. Check the vae input first, always.

It's a diagnostic tool, so the honest review is: you won't use it every day, but the day a seam mystery has you chasing the sampler for two hours, this node will save you. Pair it with VAERoundTrip for the full "is it the VAE or the sampler" verdict.

CategoryEllieFoxAI/Diagnostics

Inputs (4)

NameTypeDefaultDescription
imageIMAGE
vaeVAE
maskMASK
boundary_widthINT328–128Width of boundary zone to analyze (in pixels on each side)

Outputs (2)

NameTypeDescription
latent_heatmapIMAGE
boundary_zoomIMAGE