Latent Size Controller
Draw Your Latent Size
- latent
The default Empty Latent Image node is fine, but it has a problem: you type 896 x 1152 and have zero feel for what that actually looks like as an aspect ratio. The Latent Size Controller (class InteractiveEmptyLatent) from babydjacNODES fixes that with a visual resolution plane - you drag on a graph or histogram UI to pick your output size, the numbers update, and it snaps everything to the right multiples for your model. It's the pack author's self-described favorite node, and it's easy to see why.
How it works
Underneath it's still an empty latent generator: it creates the standard torch.zeros batch in latent space (which is 1/8 the pixel dimensions), so the output plugs into any sampler exactly like the core node. The difference is the model awareness and the frontend.
The node ships per-model profiles, and each profile has its own snapping rules and presets:
- WAN 2.1 / 2.2 - snaps to 32, max 1536, presets like "Low VRAM (480x480)" and "Mid Detail (720x1280)"
- SD 1.5 - snaps to 64, max 1024, the classic 512/768 set
- SDXL - snaps to 64, max 2048, the 1024-family set
- Z-Image / Z-Image Turbo - snaps to 16, max 2048, with "Ultra Fast (512x512)" and "Balanced Vertical (720x1280)"
Selecting a profile changes the default snap, the ceiling, and the preset menu. That "snap to the right multiple" detail is the real value - wrong multiples cause "latent size mismatch" errors downstream, and this node removes the whole class of those mistakes. There's also an aspect_lock that keeps the ratio while you resize one axis.
The inputs that matter
- model_profile - set this first; it decides the presets and snapping rules.
- width / height / batch_size - the basics, in pixels (width/height), batch in latent count.
- preset - the per-profile presets, e.g. "High Quality (1344x1344)" for Z-Image. Setting a preset overrides width/height.
- snap_to -
auto(uses the profile default) or an explicit 8/16/32/64. - ui_mode -
graph(drag on a resolution plane) orhistogram. Purely a frontend choice.
Output is a single latent, wired into your sampler just like a core Empty Latent.
Install
ComfyUI Manager → babydjacNODES, or git clone https://github.com/babydjac/babydjacNODES into ComfyUI/custom_nodes. Restart ComfyUI and hard-refresh the browser - the graph/histogram UI is JavaScript in the pack's interactive_empty_latent web directory, and a soft reload won't show it. No extra pip deps.
Gotchas
- A preset silently overrides your typed width/height. If you set a preset then type custom numbers, the preset wins until you switch back to "custom." That has confused more than one person.
aspect_lockandui_modeare frontend-only. They're included in the schema for serialization but don't change the tensor math - the size you end up with is what the sampler gets.- Snapping can surprise you. Auto-snap for WAN is 32 and for Z-Image is 16; if you request 1000px it rounds to the nearest multiple, not your exact number. That's intentional - it's the feature.
The Latent Size Controller is the node that makes resolution "feel" like something instead of a pair of magic numbers. If you switch between SDXL, WAN, and Z-Image workflows, the model-aware presets alone are worth the install.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 102464–2048 | — |
| height | INT | 102464–2048 | — |
| batch_size | INT | 11–16 | — |
| model_profile | COMBO | SDXL | 4 options: WAN 2.1 / WAN 2.2, SD 1.5, SDXL, Z-Image / Z-Image Turbo |
| snap_to | COMBO | auto | 5 options: auto, 8, 16, 32, 64 |
| ui_mode | COMBO | graph | 2 options: graph, histogram |
| aspect_lock | BOOLEAN | false | — |
| preset | COMBO | custom | 23 options: custom, Low VRAM (480x480), Portrait Detail (480x832), Mid Detail (720x1280), High Detail (1536x1536), Base (512x512), +17 |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| latent | LATENT | — |