ComfyUI > Nodes > Image Resize for ComfyUI

ComfyUI Extension: Image Resize for ComfyUI

Repo Name

image-resize-comfyui

Author
palant (Account age: 5062 days)
Nodes
View all nodes(1)
Latest Updated
2024-01-18
Github Stars
0.07K

How to Install Image Resize for ComfyUI

Install this extension via the ComfyUI Manager by searching for Image Resize for ComfyUI
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter Image Resize for ComfyUI in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Image Resize for ComfyUI Description

Image Resize for ComfyUI offers tools to resize images while maintaining their proportions, eliminating the need for manual calculations. It also ensures that any accompanying mask is resized and adjusted in sync with the image.

Image Resize for ComfyUI Introduction

The image-resize-comfyui extension is a powerful tool designed to help AI artists resize images effortlessly while maintaining their original proportions. This extension is particularly useful for those who need to adjust image sizes without distorting the content, making it ideal for preparing images for various applications, such as digital art, animation, and more. By using this extension, you can resize images and their associated masks seamlessly, ensuring that your creative workflow remains smooth and efficient.

How Image Resize for ComfyUI Works

The image-resize-comfyui extension operates by providing a set of configurable options that allow you to resize images based on specific criteria. The extension ensures that the aspect ratio of the image is preserved, preventing any unwanted distortion. If a mask is present, it is resized and modified along with the image, ensuring consistency across all elements of your artwork.

Think of it as a smart resizing tool that understands the importance of maintaining the visual integrity of your images. Whether you need to scale up or down, crop, or pad your images, this extension offers the flexibility to do so without manual calculations.

Image Resize for ComfyUI Features

Action

  • Resize Only: This mode resizes the image while keeping its aspect ratio intact. The side_ratio setting is ignored in this mode.
  • Crop to Ratio: After resizing, parts of the image are removed to match the specified side_ratio.
  • Pad to Ratio: Transparent padding is added to the image after resizing to match the specified side_ratio.

Size Settings

  • Smaller Side: Sets the target size based on the smaller side of the image. For example, if the original image is 512x768 pixels and smaller_side is set to 1024, the image will be resized to 1024x1536 pixels.
  • Larger Side: Sets the target size based on the larger side of the image. For example, if the original image is 512x768 pixels and larger_side is set to 1024, the image will be resized to 683x1024 pixels.
  • Scale Factor: Allows you to set an explicit scaling factor. Values below 1.0 reduce the image size, while values above 1.0 increase it.

Resize Mode

  • Reduce Size Only: Only resizes images that are larger than the target size.
  • Increase Size Only: Only resizes images that are smaller than the target size.
  • Any: Resizes the image regardless of whether it needs to be upscaled or downscaled.

Side Ratio

This setting determines the required aspect ratio of the image when cropping or padding is enabled. The format is width:height, such as 4:3 or 2:3. You can also set an explicit size, like 512:768, to ensure the resulting image always matches these dimensions.

Crop/Pad Position

  • Crop Position: Determines which side of the image is cropped. A value of 0.0 means only the right/bottom side is cropped, while 1.0 means only the left/top side is cropped. Intermediate values distribute the cropping proportionally.
  • Pad Position: Determines where padding is inserted. A value of 0.0 means all padding is on the right/bottom side, while 1.0 means all padding is on the left/top side. Intermediate values distribute the padding proportionally.

Pad Feathering

This setting allows mask transparency to partially expand into the original image for a specified number of pixels. This helps avoid visible borders if the image is later inpainted.

Troubleshooting Image Resize for ComfyUI

Common Issues and Solutions

  1. Image Distortion: Ensure that the action setting is correctly configured to maintain the aspect ratio.
  2. Incorrect Resizing: Verify that only one of the size settings (smaller_side, larger_side, scale_factor) is enabled at a time.
  3. Unexpected Cropping/Padding: Check the crop_pad_position setting to ensure it is set as intended.

Frequently Asked Questions

  • Why is my image not resizing? Ensure that one of the size settings is enabled and set to a non-zero value.

  • How do I maintain the original aspect ratio? Use the resize only action mode to keep the aspect ratio intact.

Learn More about Image Resize for ComfyUI

For additional resources, tutorials, and community support, consider visiting the following:

  • ComfyUI Documentation
  • AI Art Community Forums
  • Video Tutorials on YouTube These resources will help you get the most out of the image-resize-comfyui extension and enhance your creative projects.

Image Resize for ComfyUI Related Nodes

RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.