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

Image Size Adjuster V3

Mochi1 support and smarter rounding

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

ImageSizeAdjusterV3 is the same "compute the right dimensions for my model" calculator as V2, but it's been repointed at video. The headline change is Mochi1 support: pick that model and the node stops doing free-form math and instead snaps frames to Mochi1's fixed native sizes - 848×480 landscape or 480×848 portrait, depending on which way your frame is oriented. That's a genuinely useful convenience, because video models are even less forgiving about odd resolutions than image models, and Mochi1 is picky by design.

What changed from V2

  • model_type is trimmed to four: SD, SDXL, Cascade, and Mochi1. V2 kept the bigger roster (QWEN, WAN22, 4K/8K/16K); V3 deliberately narrowed to image-and-video staples and added Mochi1. If you need the wide list, that's V2's job - the two nodes coexist in the pack for a reason.
  • downscale_factor defaults to 8 instead of 64. Video frames live at smaller native sizes than image tiles, and 8-multiples match typical video latent constraints better. Same knob as V2, different sensible default.
  • Mochi1 gets automatic orientation detection (landscape vs portrait) and strict aspect-ratio handling - scaling_factor is ignored for Mochi1, and max dimensions are clamped to the model's constraints. The node won't hand you a size Mochi1 can't eat.

Everything else, unchanged

Same inputs otherwise - rounding_method (up/down/nearest), preserve_original (none/width/height), force_square - and the same five outputs: adjusted_width, adjusted_height (INTs), applied_scale (FLOAT), original_width, original_height. Wire the two INTs into an Empty Latent Image or a latent resize, and the resolution lands exactly where the model wants it. It never touches pixels; it's pure dimension math.

The honest take

The workflow this belongs in is the classic video-frame-prep chain: load or decode frames, run the size adjuster for Mochi1 (or SDXL), feed the dimensions to your latent setup, then encode the frames with the sampler at exactly the right size. For still-image users, the 8-default and Mochi1 branch don't change the core value - it's still "stop doing resolution math in your head." The honest warning: it computes and reports; it doesn't resize. If you want the actual frame resized to those dimensions, chain an image-scale node after it using the adjusted_width/adjusted_height outputs. There's a real pattern of people wiring the INTs into latent sizes and then wondering why the video came out letterboxed - the numbers are a target, not a transformation.

CategoryDJZ-Nodes

Inputs (9)

NameTypeDefaultDescription
imageIMAGE
model_typeCOMBO4 options: SD, SDXL, Cascade, Mochi1
downscale_factorINT81–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