Resize (GeN13)
Resize (GeN13) replaces three size nodes, and the multiple-of-32 thing is why
- image1
- image2
- image3
- image4
- mask
- samples
- vae
- IMAGE1
- IMAGE2
- IMAGE3
- IMAGE4
- MASK
- LATENT
- width
- height
Most ComfyUI graphs end up with the same little cluster around the sampler: an Empty Latent with two magic numbers in it, a VAE Encode for img2img, an Upscale Latent for the second pass, and three different places where you have to remember that Flux wants multiples of 16 and SD wants 8 and Qwen Image wants 32. Change the aspect ratio and you edit four nodes.
Resize (GeN13) collapses that. One node that produces a latent three different ways - empty for text-to-image, encoded from an image, or rescaling an existing latent - with the aspect ratio, megapixel count, width, height and multiple all tied together so typing one field updates the others.
The mode toggle is a boolean, not a dropdown
First thing to know, because it looks like a bug: mode is ON/OFF, where ON is I2I (image-to-image, size derived from the input image) and OFF is T2I (text-to-image, size from ratio or width/height, and no image output). It's a switch, not a menu.
Everything else follows from that. In I2I, keep really does follow your source image. In T2I, keep behaves like custom because there's no source to follow, and IMAGE1 comes out empty - so don't wire the image output into a preview and wonder why it's black.
How the size actually gets decided
There are two competing descriptions of size and the node makes you pick which wins:
aspect_ratio- eleven choices:keep, 1:1, 3:2, 2:3, 4:3, 3:4, 16:9, 9:16, 21:9, 9:21,custom.megapixels- total pixel budget, default 1.0 (about 1024×1024). Ignored when you pickcustom, and it re-syncs when you type a width or height.width/height- with a ratio selected, typing one side sets the other.multiple_of- 8, 16, 32 or 64. Width and height are rounded down to it.
That last one is the field beginners skip and then spend an hour debugging. The tooltip gives you the cheat sheet: Qwen Image 2.1 wants 32, Flux wants 16, SD wants 8. Get it wrong and you don't get an error message - you get a slightly soft or subtly distorted result, because the VAE is being asked to tile a shape it doesn't like.
Mismatched shapes, and five ways to handle them
keep_proportion is the part I'd reach for this node for even if it did nothing else: crop trims to the target, resize fits inside it, pad fills with pad_color (R,G,B or #RRGGBB), pad_edge extends the edges outward, stretch distorts. crop_position picks where you keep or where the image sits when padding.
For a reference-image workflow, cropping a source photo to 9:16 with the subject in frame beats padding with black bars ninety-nine times out of a hundred - unless you're feeding an outpainting pass, in which case pad is exactly what you want and the pad colour is a deliberate choice, not a defect.
And keep_size adds a fourth axis: original crops to the multiple without resampling - the pixels you already have, just trimmed, which is the correct move when you're reusing a latent or doing a tile pass. megapixels targets a pixel count, and long_edge / short_edge use edge_length to pin one dimension and let the other follow. That's your upscale-by-long-edge dial.
Inputs and outputs worth naming
Inputs: image1 is the main one - it sets the latent, mask, width and height, and gets encoded when vae is connected. image2–image4 are references scaled with the same settings but keeping their own aspect ratio, which is what reference-conditioning workflows with several crops need. mask scales along with image1, padded areas set to 1. samples is an existing latent to resize. vae encodes image1, or builds an empty latent in the model's own format when there's no image.
One trap in that list: if samples and image1 + vae are all connected, the image wins and your latent gets re-encoded instead of resized. Pick one path. Also, Flux.2 and HunyuanImage 2.1 need vae connected to build a correct empty latent.
Outputs: IMAGE1–IMAGE4 (the scaled images; empty in T2I or unconnected), MASK, LATENT, and the actual width / height after all the rounding. Those last two are the ones to wire into anything that needs to know the true size, rather than trusting your own arithmetic.
upscale_method covers nearest-exact / bilinear / area / bicubic / lanczos, and lanczos is the sharpest for image work. There's also nvidia_rtx_vsr: NVIDIA hardware super-resolution, needing an RTX card and the nvidia-vfx package, and falling back to bicubic on latents because hardware VSR is an image operation.
Installing
Manager: search GeN13. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/heigen13/ComfyUI-GeN13
pip install -r ComfyUI-GeN13/requirements.txt
The only requirement is nvidia-ml-py, for the pack's monitor; Resize works without anything extra. If you want nvidia_rtx_vsr, install nvidia-vfx additionally and expect it to fail gracefully rather than loudly on a non-RTX card.
When to use this instead of the built-ins
If you're on vanilla SD and never change resolution mid-workflow, Empty Latent Image plus VAE Encode is fewer clicks. Resize earns its place when a graph does two passes at different sizes, takes user images of unknown dimensions, or needs the same crop applied to a mask and four references - which is most video and most reference-conditioning work in 2026.
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. |