ComfyUI  >  Nodes  >  Derfuu_ComfyUI_ModdedNodes >  Image scale to side

ComfyUI Node: Image scale to side

Class Name

DF_Image_scale_to_side

Category
Derfuu_Nodes/Modded nodes/Image
Author
Derfuu (Account age: 1829 days)
Extension
Derfuu_ComfyUI_ModdedNodes
Latest Updated
6/22/2024
Github Stars
0.3K

How to Install Derfuu_ComfyUI_ModdedNodes

Install this extension via the ComfyUI Manager by searching for  Derfuu_ComfyUI_ModdedNodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter Derfuu_ComfyUI_ModdedNodes 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 scale to side Description

Upscale images by adjusting dimensions based on specified side length, maintaining aspect ratio and offering various upscale methods.

Image scale to side:

The DF_Image_scale_to_side node is designed to upscale images by adjusting their dimensions based on a specified side length. This node allows you to scale an image proportionally by either its width, height, longest side, or shortest side, ensuring that the aspect ratio is maintained. It provides flexibility in choosing the scaling method and whether to crop the image, making it a powerful tool for AI artists who need to resize images while preserving their quality and proportions. The node supports various upscale methods, offering a range of options to achieve the desired visual effect.

Image scale to side Input Parameters:

image

This parameter accepts the image you want to upscale. The image should be in a format that the node can process, typically an image tensor.

side_length

This integer parameter specifies the target length for the chosen side (width, height, longest, or shortest). The image will be scaled proportionally based on this length. The minimum value is 0, and there is no explicit maximum value, but it should be within reasonable limits to avoid excessive scaling.

side

This parameter determines which side of the image will be scaled to the specified length. Options include "Longest", "Shortest", "Width", and "Height". Choosing "Longest" or "Shortest" will scale the image based on its longest or shortest side, respectively, while "Width" or "Height" will scale based on the specified dimension.

upscale_method

This parameter allows you to select the method used for upscaling the image. Available options are "nearest-exact", "bilinear", "bicubic", "bislerp", "area", and "lanczos". Each method offers different trade-offs between speed and quality, with "lanczos" generally providing the highest quality at the cost of processing time.

crop

This parameter specifies whether the image should be cropped after scaling. Options are "disabled" and "center". "Disabled" means no cropping will occur, while "center" will crop the image to maintain the specified aspect ratio, focusing on the center of the image.

Image scale to side Output Parameters:

IMAGE

The output is the upscaled image, returned as an image tensor. This image will have the dimensions adjusted according to the specified side length and scaling method, maintaining the aspect ratio and applying any cropping if specified.

Image scale to side Usage Tips:

  • To maintain the aspect ratio while scaling an image to fit within a specific dimension, use the "Longest" or "Shortest" side options.
  • For high-quality upscaling, consider using the "lanczos" method, especially for images with fine details.
  • If you need to ensure that the central part of the image remains in focus after scaling, use the "center" crop option.

Image scale to side Common Errors and Solutions:

"Invalid side length"

  • Explanation: The specified side length is not within a reasonable range.
  • Solution: Ensure that the side length is a positive integer and within a reasonable range for the image size.

"Unsupported upscale method"

  • Explanation: The chosen upscale method is not one of the supported options.
  • Solution: Select an upscale method from the available options: "nearest-exact", "bilinear", "bicubic", "bislerp", "area", or "lanczos".

"Image tensor dimensions mismatch"

  • Explanation: The input image tensor does not have the expected dimensions.
  • Solution: Verify that the input image is correctly formatted and has the appropriate dimensions for processing.

Image scale to side Related Nodes

Go back to the extension to check out more related nodes.
Derfuu_ComfyUI_ModdedNodes
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.