ComfyUI Node

XImageResize

Automatic image resize with batch-unified scaling and divisible adjustment support

By Xz3r0-M·Created 7 months ago·Updated 22 days ago· 11
XImageResize
  • image_or_mask
  • resize_settings_in
  • Processed_Data
  • width
  • height
  • resize_settings_out
use_passed_settingstrue
output_resize_settingstrue
scale_modeBilinear
edge_modeLong
resize_conditionAlways
target_edge1280
megapixels1.0
scale_multiplier1.0
divisible_modeDisabled
divisible16
width_offset0
height_offset0
Category♾️ Xz3r0/Workflow-Processing

Inputs (14)

NameTypeDefaultDescription
image_or_maskCOMFY_MATCHTYPE_V3Input image or mask
use_passed_settingsBOOLEANtrueWhen enabled and settings input is connected, use passed settings for this node's resize calculation. When disabled, this node uses local panel values only.
output_resize_settingsBOOLEANtrueWhen disabled, resize_settings_out outputs empty value, equivalent to leaving this port unconnected.
scale_modeCOMBOBilinearSelect interpolation algorithm: Nearest-exact=fastest, Bilinear=fast & medium quality, Area=best for downsampling, Bicubic=medium speed & high quality, Lanczos=slow & highest quality. For MASK input, Nearest-exact is recommended to avoid edge drift.
edge_modeCOMBOLongSelect scaling mode: Long=long edge, Short=short edge, Megapixels=target pixels, Scale Multiplier=scale by multiplier
resize_conditionCOMBOAlwaysResize condition for Long/Short/Megapixels: Always=always resize, Only if Larger=resize only when image is larger than target, Only if Smaller=resize only when image is smaller than target. Ignored in Scale Multiplier mode. If the condition is not met, resizing is skipped, but divisible and offset are still applied.
target_edgeINT128064–8192Target edge length in pixels (ignored in Megapixels and Scale Multiplier modes)
megapixelsFLOAT1.00.1–100Only used in Megapixels mode as target value (must be >0)
scale_multiplierFLOAT1.00.1–10Scale multiplier (only used in Scale Multiplier mode)
divisible_modeCOMBODisabledHow to adjust resolution to be divisible: Disabled=no adjustment, Nearest=round to nearest multiple, Up=round up, Down=round down
divisibleINT161–128Make resolution divisible by this number (set to 1 to disable, common values: 8, 16, 32, 64)
width_offsetINT0-128–128Add offset to output width (positive=increase, negative=decrease, default=0)
height_offsetINT0-128–128Add offset to output height (positive=increase, negative=decrease, default=0)
resize_settings_inoptXZ3R0_RESIZE_SETTINGSOptional resize settings from previous XImageResize node

Outputs (4)

NameTypeDescription
Processed_DataCOMFY_MATCHTYPE_V3Resized image or mask output tensor
widthINTOutput resolution width
heightINTOutput resolution height
resize_settings_outXZ3R0_RESIZE_SETTINGSSettings passed to downstream nodes. If valid upstream settings exist, this output keeps forwarding the chain-origin settings.