Nodes/ComfyUI-GeN13/Resize (GeN13)
ComfyUI Node

Resize (GeN13)

Sets the latent size in one node: an empty latent, an encoded image, or a resized existing latent. Images and masks are scaled along, with crop, pad or stretch.

By heigen13·Created 3 days ago·Updated about 21 hours ago· 1
Resize (GeN13)
  • image1
  • image2
  • image3
  • image4
  • mask
  • samples
  • vae
  • IMAGE1
  • IMAGE2
  • IMAGE3
  • IMAGE4
  • MASK
  • LATENT
  • width
  • height
◄modetrue►
◄aspect_ratiokeep►
◄megapixels1.00►
◄width2048►
◄height1152►
◄multiple_of32►
◄batch_size1►
◄upscale_methodlanczos►
◄keep_proportioncrop►
◄crop_positioncenter►
◄pad_color0, 0, 0►
◄keep_sizeoriginal►
◄edge_length1024►
CategoryGeN13/latent

Inputs (20)

NameTypeDefaultDescription
modeBOOLEANtrueMode: I2I (image to image) scales from the input image. T2I (text to image) outputs no image; size comes from the ratio or width and height.
aspect_ratioCOMBOkeepAspect ratio: keep follows the source image; custom uses width and height. In T2I, keep acts as custom.
megapixelsFLOAT1.000.1–16Megapixels: total pixel count; 1.0 is about 1024×1024. Updates when width or height is typed. Not used with custom.
widthINT204816–16384Width: output width; with a ratio selected, typing one side sets the other. Can be connected.
heightINT115216–16384Height: output height; with a ratio selected, typing one side sets the other. Can be connected.
multiple_ofCOMBO32Multiple of: width and height are rounded down to this. Qwen Image 2.1 uses 32, Flux 16, SD 8.
batch_sizeINT11–64Batch size: number of empty latents or encoded images. Not used when samples is connected.
upscale_methodCOMBOlanczosScaling method: lanczos is the sharpest; nvidia_rtx_vsr needs an RTX GPU. Latents use bicubic for these two.
keep_proportionCOMBOcropWhen ratios differ: crop trims, resize fits inside, pad fills with color, pad_edge extends the edges, stretch distorts.
crop_positionCOMBOcenterPosition: the area kept when cropping, or where the image sits when padding.
pad_colorSTRING0, 0, 0Pad color: used by pad, as R, G, B (0–255) or #RRGGBB.
keep_sizeCOMBOoriginalKeep size: original crops to the multiple without resampling; megapixels targets a pixel count; long_edge / short_edge use edge_length.
edge_lengthINT102416–16384Edge length: length in px of the long or short edge, when keep_size is long_edge or short_edge.
image1optIMAGEMain image: sets the latent, mask, width and height; with vae connected, it is encoded into the latent.
image2optIMAGEReference image: scaled with the same settings, keeping its own aspect ratio.
image3optIMAGEReference image: scaled with the same settings, keeping its own aspect ratio.
image4optIMAGEReference image: scaled with the same settings, keeping its own aspect ratio.
maskoptMASKMask: scaled together with image1; padded areas are 1.
samplesoptLATENTLatent: an existing latent to resize; with image1 and vae connected, the image is encoded instead. Flux.2 and HunyuanImage 2.1 need vae.
vaeoptVAEVAE: encodes image1 when connected; without an image, it builds an empty latent in the model's format.

Outputs (8)

NameTypeDescription
IMAGE1IMAGEMain image: the scaled image1, exactly what was encoded. Empty in T2I or without an image.
IMAGE2IMAGEReference image: the scaled image2. Empty in T2I or when not connected.
IMAGE3IMAGEReference image: the scaled image3. Empty in T2I or when not connected.
IMAGE4IMAGEReference image: the scaled image4. Empty in T2I or when not connected.
MASKMASKMask: the scaled mask, following image1; all 0 without a mask, padded areas are 1.
LATENTLATENTLatent: the encoded image1 with vae, the resized samples, or otherwise an empty latent.
widthINTWidth: actual output width in px.
heightINTHeight: actual output height in px.