Nodes/comfyui-ysnodes/Size Picker Full
ComfyUI Node

Size Picker Full

A resolution picker that hands you the empty latent *and* the encoded image latent

By MrYassinox·Created 2 months ago·Updated about a month ago· 1
Size Picker Full
  • image
  • vae
  • image
  • width
  • height
  • batch
  • latent_empty
  • latent_from_image
use_image_sizefalse
fit_megapixelsfalse
aspect_ratio1:1 (Square)
megapixels1.0
multiple8
width_override0
height_override0
batch_size1
latent_typeSD / SDXL

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 to multiple (default 8, the VAE-safe rounding).
  • Image-driven mode: use_image_size = true takes the dimensions from the connected image. With fit_megapixels = false it keeps the image's exact pixel size; with fit_megapixels = true it keeps the aspect ratio but resizes to hit the megapixels target.

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 no vae is 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 a Save Image size 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.

CategoryYSNodes/utility

Inputs (11)

NameTypeDefaultDescription
use_image_sizeBOOLEANfalseWhen True, width/height are taken from the connected image instead of aspect_ratio + megapixels.
fit_megapixelsBOOLEANfalseOnly 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_ratioCOMBO1:1 (Square)The aspect ratio used to compute width and height. Ignored when use_image_size=True.
megapixelsFLOAT1.00.1–16Target total megapixels. Used for the aspect_ratio path, and for the image path when fit_megapixels=True.
multipleINT88–128Nearest multiple to round the computed width/height to. 8 = VAE-safe (recommended).
width_overrideINT00–8192Override width in pixels. 0 = use the computed value.
height_overrideINT00–8192Override height in pixels. 0 = use the computed value.
batch_sizeINT11–4096
latent_typeCOMBOSD / SDXLLatent format matching your model architecture. SD / SDXL → 4ch, pixels ÷ 8 SD3 / AuraFlow → 16ch, pixels ÷ 8 Flux → 16ch, pixels ÷ 8 Flux2 → 128ch, pixels ÷ 16
imageoptIMAGESource image. Required when use_image_size=True. Also used for VAE encoding.
vaeoptVAEVAE model for encoding. When not connected, latent_from_image falls back to empty latent.

Outputs (6)

NameTypeDescription
imageIMAGE
widthINT
heightINT
batchINT
latent_emptyLATENT
latent_from_imageLATENT