ComfyUI Node
XImageResize
Automatic image resize with batch-unified scaling and divisible adjustment support
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)
| Name | Type | Default | Description |
|---|---|---|---|
| image_or_mask | COMFY_MATCHTYPE_V3 | Input image or mask | |
| use_passed_settings | BOOLEAN | true | When 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_settings | BOOLEAN | true | When disabled, resize_settings_out outputs empty value, equivalent to leaving this port unconnected. |
| scale_mode | COMBO | Bilinear | Select 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_mode | COMBO | Long | Select scaling mode: Long=long edge, Short=short edge, Megapixels=target pixels, Scale Multiplier=scale by multiplier |
| resize_condition | COMBO | Always | Resize 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_edge | INT | 128064–8192 | Target edge length in pixels (ignored in Megapixels and Scale Multiplier modes) |
| megapixels | FLOAT | 1.00.1–100 | Only used in Megapixels mode as target value (must be >0) |
| scale_multiplier | FLOAT | 1.00.1–10 | Scale multiplier (only used in Scale Multiplier mode) |
| divisible_mode | COMBO | Disabled | How to adjust resolution to be divisible: Disabled=no adjustment, Nearest=round to nearest multiple, Up=round up, Down=round down |
| divisible | INT | 161–128 | Make resolution divisible by this number (set to 1 to disable, common values: 8, 16, 32, 64) |
| width_offset | INT | 0-128–128 | Add offset to output width (positive=increase, negative=decrease, default=0) |
| height_offset | INT | 0-128–128 | Add offset to output height (positive=increase, negative=decrease, default=0) |
| resize_settings_inopt | XZ3R0_RESIZE_SETTINGS | Optional resize settings from previous XImageResize node |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| Processed_Data | COMFY_MATCHTYPE_V3 | Resized image or mask output tensor |
| width | INT | Output resolution width |
| height | INT | Output resolution height |
| resize_settings_out | XZ3R0_RESIZE_SETTINGS | Settings passed to downstream nodes. If valid upstream settings exist, this output keeps forwarding the chain-origin settings. |