Size Picker Full
A resolution picker that hands you the empty latent *and* the encoded image latent
- image
- vae
- image
- width
- height
- batch
- latent_empty
- latent_from_image
Resolution math is the least interesting part of ComfyUI and the part everyone gets wrong. Size Picker Full (from comfyui-ysnodes) kills it: pick an aspect ratio and a megapixel target, and it computes VAE-safe dimensions, builds the empty latent for txt2img, and VAE-encodes a connected image for img2img/inpainting. Two latents out of one node - one for "start from scratch," one for "start from this image."
It's the extended sibling of the pack's Size Picker, which stops at the empty latent. This one adds a vae input and the latent_from_image output; every other input is identical between them.
How it works
Two independent modes, switched by use_image_size:
- Computed mode (default):
aspect_ratio(17 choices, from 1:1 square through 21:9 ultrawide and 9:21 tall) ×megapixels→ width/height, snapped tomultiple(default 8, the VAE-safe rounding). - Image-driven mode:
use_image_size = truetakes the dimensions from the connectedimage. Withfit_megapixels = falseit keeps the image's exact pixel size; withfit_megapixels = trueit keeps the aspect ratio but resizes to hit themegapixelstarget.
width_override / height_override (0 = off) always beat the computed values if you need an exact size. batch_size sets the latent batch, and latent_type picks the latent format for your model architecture: SD/SDXL (4ch, ÷8), SD3/AuraFlow (16ch, ÷8), Flux (16ch, ÷8), or Flux2 (128ch, ÷16).
The output that matters
latent_empty- the empty latent at the computed size, for txt2img. Never touches the VAE.latent_from_image- the VAE-encoded image resized to (w, h), for img2img/inpainting. Falls back to an empty latent if novaeis connected - it will not error out, so a missing VAE reads as a silent blank latent.image,width,height,batch- passthroughs and computed values you can wire elsewhere (e.g. into aSave Imagesize note or a text display).
The two traps
latent_type must match your model. This is a real thing that burned people before the pack fixed it in v1.2.0 - the latent output used to be hardcoded to SD/SDXL format regardless of target model, causing dimension mismatches when people ran Flux2 (128-channel latent, ÷16) through a 4-channel-empty-latent setup. Pick Flux2 for Flux2, Flux for Flux Dev/Schnell, and so on.
The vae is optional and the fallback is silent. Wire latent_from_image to a KSampler without a VAE connected and you get an empty latent wearing the clothes of an img2img pass - your "image-to-image" will come out as txt2img. If img2img looks like it's ignoring your input entirely, check this node first.
Installing it
The pack's standard zero-dependency install - no models, no pip packages beyond ComfyUI's own.
cd ComfyUI/custom_nodes
git clone https://github.com/MrYassinox/comfyui-ysnodes.git
or search comfyui-ysnodes in ComfyUI Manager, restart, and it's under YSNodes/utility.
Why you'd reach for it
Any workflow where you want one source of truth for resolution feeding both a txt2img and an img2img branch - or where you're tired of hand-computing "1024 wide at 3:2 that divides by 8." It's plumbing with opinions, in the best sense: it replaces a small arithmetic subgraph with a dropdown, and the image output lets you keep a preview node wired in so you can see exactly what size you picked. It won't make your images better, but it will make the graph smaller and the math stop being wrong.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| use_image_size | BOOLEAN | false | When True, width/height are taken from the connected image instead of aspect_ratio + megapixels. |
| fit_megapixels | BOOLEAN | false | Only applies when use_image_size=True. False → use the image's exact pixel size, unchanged. True → keep the image's aspect ratio but resize it to hit the megapixels target below. |
| aspect_ratio | COMBO | 1:1 (Square) | The aspect ratio used to compute width and height. Ignored when use_image_size=True. |
| megapixels | FLOAT | 1.00.1–16 | Target total megapixels. Used for the aspect_ratio path, and for the image path when fit_megapixels=True. |
| multiple | INT | 88–128 | Nearest multiple to round the computed width/height to. 8 = VAE-safe (recommended). |
| width_override | INT | 00–8192 | Override width in pixels. 0 = use the computed value. |
| height_override | INT | 00–8192 | Override height in pixels. 0 = use the computed value. |
| batch_size | INT | 11–4096 | — |
| latent_type | COMBO | SD / SDXL | Latent format matching your model architecture. SD / SDXL → 4ch, pixels ÷ 8 SD3 / AuraFlow → 16ch, pixels ÷ 8 Flux → 16ch, pixels ÷ 8 Flux2 → 128ch, pixels ÷ 16 |
| imageopt | IMAGE | Source image. Required when use_image_size=True. Also used for VAE encoding. | |
| vaeopt | VAE | VAE model for encoding. When not connected, latent_from_image falls back to empty latent. |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| width | INT | — |
| height | INT | — |
| batch | INT | — |
| latent_empty | LATENT | — |
| latent_from_image | LATENT | — |