D2 Image Resize
The resize node that also does upscale models, rotation, masks, and latent
- image
- mask
- vae
- image
- width
- height
- rescale_factor
- latent
- mask
Most resize workflows in ComfyUI are a chain: scale, then a separate rotate, then a VAE encode somewhere else, and if you've got a mask you're duplicating the whole thing for it. D2 Image Resize collapses that into one node that handles scaling, rotation, mask resizing, upscale models, and - if you hand it a VAE - latent output in a single pass. It's the D2 pack's "one resize to rule the chain" node.
The headline feature is precision: scaling is accurate to three decimal places, with a round_method of Floor, Round, Ceil, or None to control how the result is rounded. That matters when a downstream model insists on dimensions that are multiples of 8 and you want to choose how the rounding lands rather than accept whatever the sampler gives you.
The inputs that matter
mode-rescale(multiply byrescale_factor, default 2.0) orresize(explicitresize_width/resize_height, defaults 1024×1536).preset- a size preset dropdown (the same SIZE_LIST the pack's Size Selector uses); choose custom for manual numbers.rotate-None/ 90 / 180 / 270 degrees, applied as part of the same pass.round_method- how decimals are handled (defaultRound).upscale_model- pick an ESRGAN-family model from yourupscale_modelsfolder (e.g. 4x-UltraSharp, 4x-AnimeSharp) to upscale instead of interpolate. This is the real-upscalingpath: Lanczos/ESRGAN upscalers add pixels without inventing content.resampling-lanczos/nearest/bilinear/bicubicfor plain interpolation.use_tiled_vae- when avaeis connected, encode the latent in tiles to save VRAM on big images.mask- optional MASK, resized and rotated to match the image so your pairs stay aligned.
Outputs
image, width, height, the rescale_factor used, an optional latent (only when a vae is connected), and mask (only when one was given). That set means this node alone can sit between a load and a KSampler in a hires-fix-style chain.
Installing it
ComfyUI Manager → search "D2-nodes-ComfyUI" → install, or:
cd ComfyUI/custom_nodes
git clone https://github.com/da2el-ai/D2-nodes-ComfyUI
Restart. No model downloads from the pack itself, but the upscale_model dropdown only fills in with whatever's already in your models/upscale_models - drop a 4x model there if you want that path. Deps are piexif and charset-normalizer; nothing heavy. Since v32.0.0 the pack needs a recent ComfyUI (V3 schema).
Where people get burned
If upscale_model is set to something and resampling is set, the upscale model wins for the upscale - mixed settings confuse people more than either alone. And the latent output only appears when a VAE is wired in; forget the VAE and you get pixels only. One more: use_tiled_vae exists precisely because a straight VAE encode of a huge upscaled image can eat VRAM fast, so if you're pushing 4x sizes, turn it on before you OOM.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| mode | COMBO | 2 options: rescale, resize | |
| rescale_factor | FLOAT | 2.0000.1–16 | — |
| preset | COMBO | 7 options: custom, 512 x 512, 512 x 768, 1024 x 1024, 768 x 1024, 832 x 1216, +1 | |
| resize_width | INT | 10241–48000 | — |
| resize_height | INT | 15361–48000 | — |
| rotate | COMBO | 4 options: None, 90 deg, 180 deg, 270 deg | |
| round_method | COMBO | Round | 4 options: Floor, Round, Ceil, None |
| upscale_model | COMBO | 1 options: None | |
| resampling | COMBO | 4 options: lanczos, nearest, bilinear, bicubic | |
| use_tiled_vae | BOOLEAN | false | — |
| maskopt | MASK | — | |
| vaeopt | VAE | — |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| width | INT | — |
| height | INT | — |
| rescale_factor | FLOAT | — |
| latent | LATENT | — |
| mask | MASK | — |