ComfyUI-ImageAutosize

ComfyUI-ImageAutosize
★ 0

图像处理自动调整大小裁剪ComfyUI 节点
为 ComfyUI 提供便捷的图像缩放与裁剪功能,自动调整尺寸以满足扩散模型的输入要求,简化预处理。
💡 在扩散生成前自动调整图片尺寸与裁剪以匹配模型输入。
🍴 1 Forks💻 Python🔄 2025-11-29
📦
网盘下载
复制链接后前往夸克网盘下载
https://pan.quark.cn/s/a9fb3a59e10c
workflow_image_autotone
📄 README

ComfyUI-ImageAutosize

A node for ComfyUI that provides a convenient way of resizing or cropping an image for diffusion tasks.

This node was designed with the goal of being easy to “set and forget,” allowing you to pre-process any input image without having to frequently adjust your parameters.

Installation

Simply drag the image above into ComfyUI and use ComfyUI Manager » Install Missing Custom Nodes.

Inputs

  • image: The image to modify.
  • max_size (int): The node will resize the larger dimension of the image to this size in pixels, preserving aspect ratio.
  • min_size (int): After evaluating max_size, the node will check the smaller dimension of the image. If it’s less than min_size, the smaller dimension will be upscaled to this value, preserving aspect ratio.
  • divisible_by (int): After evaluating both max_size and min_size, the dimensions of the image will be rounded to values that are multiples of divisible_by. This is useful for diffusion models, which often expect sizes that are divisible by 32.
  • interpolation_mode (string): Name of the resizing method.
  • crop_mode (string): Cropping is often needed to satisfy divisble_by, and this input lets you choose the origin of the crop. Set it to none to disable cropping altogether.
  • Outputs

  • image (image): The modified image.
  • width (int): The resulting image width in pixels.
  • height (int): The resulting image height in pixels.
  • multiplier (float): The multiplier applied to the original image’s dimensions. Useful if you want to resize another image or mask by the same amount.

  • This node was adapted from the [img2img_autosize] shortcode of Unprompted, my Automatic1111 extension.