Generation Resolution From Latent
Pull pixel width/height out of a latent
- latent
- IMAGE_GEN_WIDTH (INT)
- IMAGE_GEN_HEIGHT (INT)
The latent-space twin of Generation Resolution From Image. Same job - hand you the width and height as two integers - but it reads them from a LATENT instead of a pixel image. Latents in Stable Diffusion are 8× smaller than the image they decode to, so this node does the multiply-by-8 for you and returns the real pixel dimensions. It's the utility you reach for when the thing that already defines your target size is a latent partway through a workflow, and you need those dimensions in pixel terms somewhere else in the graph.
How it works
No model, no processing weight. The node inspects the latent's shape, converts from latent resolution to pixel resolution (the ×8 factor), and outputs the width and height as INTs. Feed those into a resize node, a preprocessor that wants an explicit resolution, a ControlNet setup, or any math that needs to know how big the final image will be. The value is keeping everything downstream aligned to the size your latent already implies - so your control maps and any resizes land at the correct pixel dimensions instead of a guess.
A concrete case: say you've built your Empty Latent Image at some resolution and a control preprocessor further down the graph takes a resolution input. Rather than typing the same number in two places (and forgetting to change one when you swap sizes), you read it off the latent once and wire it everywhere. The same trick helps in hi-res passes, where you want a preprocessor or a second ControlNet to run at the upscaled pixel size - pull the numbers from the enlarged latent and everything downstream tracks it automatically. It's a small thing, but "one source of truth for resolution" saves a whole category of off-by-a-resize bugs in bigger graphs.
The inputs and outputs
Minimal:
latent(LATENT) - the latent whose pixel dimensions you want.
Outputs are two integers: IMAGE_GEN_WIDTH (INT) and IMAGE_GEN_HEIGHT (INT) - the pixel-space width and height. Wire them wherever a resolution is needed.
Installing it
ComfyUI Manager: search ComfyUI's ControlNet Auxiliary Preprocessors, install, restart. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/Fannovel16/comfyui_controlnet_aux
pip install -r requirements.txt
Restart ComfyUI. Nothing to download or configure - it's ready as soon as the pack loads.
Where people get burned
Barely anything, but two things to keep straight. First, pick the right sibling: use this node when your source is a LATENT and ImageGenResolutionFromImage when it's a pixel IMAGE - they're not interchangeable because the input types differ. Second, remember it returns pixel dimensions (latent ×8), so don't feed those back into something expecting latent-space numbers or you'll be off by a factor of eight. Used correctly, it's a quiet convenience node that keeps a workflow's resolutions consistent without you doing arithmetic in your head.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| latent | LATENT | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE_GEN_WIDTH (INT) | INT | — |
| IMAGE_GEN_HEIGHT (INT) | INT | — |