Nodes/D2 Nodes ComfyUI/D2 Image Resize
ComfyUI Node

D2 Image Resize

The resize node that also does upscale models, rotation, masks, and latent

By da2el-ai·Created 2 years ago·Updated about a month ago· 66
D2 Image Resize
  • image
  • mask
  • vae
  • image
  • width
  • height
  • rescale_factor
  • latent
  • mask
mode
rescale_factor2.000
preset
resize_width1024
resize_height1536
rotate
round_methodRound
upscale_model
resampling
use_tiled_vaefalse

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 by rescale_factor, default 2.0) or resize (explicit resize_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 (default Round).
  • upscale_model - pick an ESRGAN-family model from your upscale_models folder (e.g. 4x-UltraSharp, 4x-AnimeSharp) to upscale instead of interpolate. This is the real-upscaling path: Lanczos/ESRGAN upscalers add pixels without inventing content.
  • resampling - lanczos / nearest / bilinear / bicubic for plain interpolation.
  • use_tiled_vae - when a vae is 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.

CategoryD2

Inputs (13)

NameTypeDefaultDescription
imageIMAGE
modeCOMBO2 options: rescale, resize
rescale_factorFLOAT2.0000.1–16
presetCOMBO7 options: custom, 512 x 512, 512 x 768, 1024 x 1024, 768 x 1024, 832 x 1216, +1
resize_widthINT10241–48000
resize_heightINT15361–48000
rotateCOMBO4 options: None, 90 deg, 180 deg, 270 deg
round_methodCOMBORound4 options: Floor, Round, Ceil, None
upscale_modelCOMBO1 options: None
resamplingCOMBO4 options: lanczos, nearest, bilinear, bicubic
use_tiled_vaeBOOLEANfalse
maskoptMASK
vaeoptVAE

Outputs (6)

NameTypeDescription
imageIMAGE
widthINT
heightINT
rescale_factorFLOAT
latentLATENT
maskMASK