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.
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)
| Name | Type | Default | Description |
|---|---|---|---|
| mode | BOOLEAN | true | Mode: 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_ratio | COMBO | keep | Aspect ratio: keep follows the source image; custom uses width and height. In T2I, keep acts as custom. |
| megapixels | FLOAT | 1.000.1–16 | Megapixels: total pixel count; 1.0 is about 1024×1024. Updates when width or height is typed. Not used with custom. |
| width | INT | 204816–16384 | Width: output width; with a ratio selected, typing one side sets the other. Can be connected. |
| height | INT | 115216–16384 | Height: output height; with a ratio selected, typing one side sets the other. Can be connected. |
| multiple_of | COMBO | 32 | Multiple of: width and height are rounded down to this. Qwen Image 2.1 uses 32, Flux 16, SD 8. |
| batch_size | INT | 11–64 | Batch size: number of empty latents or encoded images. Not used when samples is connected. |
| upscale_method | COMBO | lanczos | Scaling method: lanczos is the sharpest; nvidia_rtx_vsr needs an RTX GPU. Latents use bicubic for these two. |
| keep_proportion | COMBO | crop | When ratios differ: crop trims, resize fits inside, pad fills with color, pad_edge extends the edges, stretch distorts. |
| crop_position | COMBO | center | Position: the area kept when cropping, or where the image sits when padding. |
| pad_color | STRING | 0, 0, 0 | Pad color: used by pad, as R, G, B (0–255) or #RRGGBB. |
| keep_size | COMBO | original | Keep size: original crops to the multiple without resampling; megapixels targets a pixel count; long_edge / short_edge use edge_length. |
| edge_length | INT | 102416–16384 | Edge length: length in px of the long or short edge, when keep_size is long_edge or short_edge. |
| image1opt | IMAGE | Main image: sets the latent, mask, width and height; with vae connected, it is encoded into the latent. | |
| image2opt | IMAGE | Reference image: scaled with the same settings, keeping its own aspect ratio. | |
| image3opt | IMAGE | Reference image: scaled with the same settings, keeping its own aspect ratio. | |
| image4opt | IMAGE | Reference image: scaled with the same settings, keeping its own aspect ratio. | |
| maskopt | MASK | Mask: scaled together with image1; padded areas are 1. | |
| samplesopt | LATENT | Latent: an existing latent to resize; with image1 and vae connected, the image is encoded instead. Flux.2 and HunyuanImage 2.1 need vae. | |
| vaeopt | VAE | VAE: encodes image1 when connected; without an image, it builds an empty latent in the model's format. |
Outputs (8)
| Name | Type | Description |
|---|---|---|
| IMAGE1 | IMAGE | Main image: the scaled image1, exactly what was encoded. Empty in T2I or without an image. |
| IMAGE2 | IMAGE | Reference image: the scaled image2. Empty in T2I or when not connected. |
| IMAGE3 | IMAGE | Reference image: the scaled image3. Empty in T2I or when not connected. |
| IMAGE4 | IMAGE | Reference image: the scaled image4. Empty in T2I or when not connected. |
| MASK | MASK | Mask: the scaled mask, following image1; all 0 without a mask, padded areas are 1. |
| LATENT | LATENT | Latent: the encoded image1 with vae, the resized samples, or otherwise an empty latent. |
| width | INT | Width: actual output width in px. |
| height | INT | Height: actual output height in px. |