Nodes/DJZ-Nodes/Image Size Adjuster V2
ComfyUI Node

Image Size Adjuster V2

The node that never touches a pixel

By MushroomFleet·Created 2 years ago·Updated 5 months ago· 78
Image Size Adjuster V2
  • image
  • adjusted_width
  • adjusted_height
  • applied_scale
  • original_width
  • original_height
model_type
downscale_factor64
rounding_method
preserve_original
force_squarefalse
scaling_factor1.0
max_width2048
max_height2048

Every model family has a "native" resolution, and feeding it the wrong size is how you get baked-in artifacts, weird crops, or that subtle quality loss you can't quite name. ImageSizeAdjusterV2 is a math node that solves exactly one problem: what size should this image be so the model is happy? It takes your image, figures out the ideal dimensions for the target model, and hands you back the width and height as numbers - it doesn't resize anything. It's the boring utility that quietly saves you from a hundred small mistakes.

The inputs that matter

  • model_type - the dropdown with ten targets: SD (512×512 territory), SDXL (1024²), QWEN, 1440x, WAN22, Cascade, 3072x, 4K, 8K, 16K. Each carries its own target pixel count, which is the whole point - you pick the model you're about to feed.
  • downscale_factor (default 64) - the number both dimensions must be divisible by. This is the real "model happy" knob: SD/SDXL latent sizes and tiled setups like multiples of 8 or 64, and sticking to them avoids the "resolution not divisible" warnings that silently degrade results.
  • rounding_method - up, down, or nearest for snapping to that multiple.
  • preserve_original (none/width/height) - keep one original dimension if it's already divisible, and only adjust the other.
  • force_square - output a square.
  • Optional: scaling_factor (0.1–10) multiplies the target pixel count for overscan or underscan, and max_width/max_height cap the result.

The outputs

Five outputs, and they're the entire value of the node: adjusted_width (INT), adjusted_height (INT), applied_scale (FLOAT - the ratio that was actually applied, useful for compensating elsewhere), original_width, and original_height. Wire adjusted_width and adjusted_height into an Empty Latent Image's size inputs, or into a latent resize / conditioning node, and the sampler gets exactly what the model wants.

How it works

It's arithmetic with aspect-ratio handling: compute the target pixel count from the model, scale by scaling_factor, derive dimensions from the aspect ratio (square if forced), preserve a dimension if asked, round to the downscale factor, clamp to the maxes, and report the scale actually applied. Deterministic, instant, no image data changes hands.

The honest take

The original ImageSizeAdjuster already did the basics; V2's additions are the extra model presets (WAN22, QWEN, 4K/8K/16K), the applied_scale output, and the preserve/max clamping. If you build workflows for multiple backbones, this is the kind of node you drop in once and stop thinking about - the "compute correct size for the model" step becomes a wire instead of a mental calculation. Just don't confuse it with a resizer: it calculates, it doesn't apply. Pair it with an ImageScale/Resize node downstream when you actually want the pixels changed.

CategoryDJZ-Nodes

Inputs (9)

NameTypeDefaultDescription
imageIMAGE
model_typeCOMBO10 options: SD, SDXL, QWEN, 1440x, WAN22, Cascade, +4
downscale_factorINT641–128
rounding_methodCOMBO3 options: up, down, nearest
preserve_originalCOMBO3 options: none, width, height
force_squareBOOLEANfalse
scaling_factoroptFLOAT1.00.1–10
max_widthoptINT204864–8192
max_heightoptINT204864–8192

Outputs (5)

NameTypeDescription
adjusted_widthINT
adjusted_heightINT
applied_scaleFLOAT
original_widthINT
original_heightINT