Nodes/ComfyUI-Inference-Core-Nodes/[Inference.Core] Generation Resolution From Latent
ComfyUI Node

[Inference.Core] Generation Resolution From Latent

Read your real output size straight off the latent

By LykosAI·Created 2 years ago·Updated about a year ago· 33
[Inference.Core] Generation Resolution From Latent
  • latent
  • IMAGE_GEN_WIDTH (INT)
  • IMAGE_GEN_HEIGHT (INT)

A small, purely mechanical node that solves a small, purely annoying problem: if you're computing a "pixel perfect" preprocessor resolution (see this pack's Pixel Perfect Resolution node), you need to tell it your actual generation width and height - and if you ever change your generation size, you have to remember to update those numbers in two places. This node removes the "remember to update it" step entirely by reading the real dimensions straight off your latent tensor instead of a typed-in number.

How it works

A latent tensor's spatial dimensions are exactly 1/8th of the pixel image it will decode to (standard SD-family VAE downscaling), so this node just reads the latent's shape and multiplies back up to report the actual pixel width and height it corresponds to. No model, no inference - it's a shape lookup dressed up as two integer outputs.

The inputs and outputs that matter

One required input, nothing optional:

  • latent - any LATENT in your graph. Your Empty Latent Image node, or the output of a KSampler, both work - wire in whichever one represents your actual target generation size.

Two outputs: IMAGE_GEN_WIDTH (INT) and IMAGE_GEN_HEIGHT (INT) - feed these directly into Pixel Perfect Resolution's image_gen_width / image_gen_height inputs so that node always reflects your real generation size automatically, even if you change it later.

How to install it

ComfyUI Manager: search ComfyUI-Inference-Core-Nodes, install, restart. By hand:

cd ComfyUI/custom_nodes
git clone https://github.com/LykosAI/ComfyUI-Inference-Core-Nodes

then run install.py, or the plain pip install -e . is genuinely sufficient here - this node does no accelerated inference, so there's no real benefit to the CUDA/ROCm/DirectML extras unless you're also using other nodes from the pack. Restart ComfyUI.

Common issues & troubleshooting

There's very little that can actually go wrong with this node - it has one input and does one lookup. The only real gotcha is conceptual: make sure you're wiring in the latent that represents your final target size, not an intermediate one. If your workflow does a low-res first pass and then upscales the latent before a second KSampler pass, feeding this node the first-pass latent will report the wrong (smaller) resolution to whatever's downstream. Grab the latent from the stage that matches the resolution you actually want your preprocessor tuned for.

Beyond that, this node quietly does nothing unless you actually route its outputs somewhere - on its own it doesn't touch your image or your generation at all, it's purely a data source for other nodes like Pixel Perfect Resolution.

CategoryControlNet Preprocessors

Inputs (1)

NameTypeDefaultDescription
latentLATENT

Outputs (2)

NameTypeDescription
IMAGE_GEN_WIDTH (INT)INT
IMAGE_GEN_HEIGHT (INT)INT