ComfyUI > Nodes > wlsh_nodes > Image Scale by Shortside (WLSH)

ComfyUI Node: Image Scale by Shortside (WLSH)

Class Name

Image Scale by Shortside (WLSH)

Category
WLSH Nodes/upscaling
Author
wallish77 (Account age: 2229days)
Extension
wlsh_nodes
Latest Updated
2024-06-19
Github Stars
0.08K

How to Install wlsh_nodes

Install this extension via the ComfyUI Manager by searching for wlsh_nodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter wlsh_nodes 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 by Shortside (WLSH) Description

Resize images based on shorter side length to maintain aspect ratio, ideal for AI artists needing uniform upscaling.

Image Scale by Shortside (WLSH):

The Image Scale by Shortside (WLSH) node is designed to resize an image based on the length of its shorter side, ensuring that the aspect ratio is maintained. This node is particularly useful for AI artists who need to upscale images to a specific dimension while preserving the original proportions. By focusing on the shorter side, the node ensures that the image is scaled uniformly, preventing any distortion. This method is beneficial for preparing images for further processing or for achieving a consistent output size across different images. The node supports various upscaling methods, providing flexibility in how the image is resized.

Image Scale by Shortside (WLSH) Input Parameters:

original

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

upscale_method

This parameter determines the method used for upscaling the image. The available options are nearest-exact, bilinear, and area. Each method has its own characteristics: nearest-exact is fast and simple but may produce blocky results, bilinear provides smoother results by averaging pixel values, and area is suitable for downscaling as it calculates the average pixel value in the area.

shortside

This parameter specifies the desired length of the shorter side of the image after upscaling. It accepts integer values with a default of 512, a minimum of 32, and a maximum of 4096, in steps of 32. Adjusting this value will scale the image proportionally based on the shorter side.

Image Scale by Shortside (WLSH) Output Parameters:

IMAGE

This output is the upscaled image, resized according to the specified shortside length and the chosen upscaling method. The image maintains its original aspect ratio.

width

This output provides the width of the upscaled image. It is calculated based on the scaling factor applied to the original image's dimensions.

height

This output provides the height of the upscaled image. Similar to the width, it is determined by the scaling factor applied to the original image's dimensions.

Image Scale by Shortside (WLSH) Usage Tips:

  • To maintain the best quality, choose the bilinear method for smoother transitions between pixels.
  • Use the area method if you are downscaling images, as it provides better results by averaging pixel values.
  • Ensure that the shortside value is appropriate for your desired output size to avoid excessive upscaling or downscaling, which can affect image quality.

Image Scale by Shortside (WLSH) Common Errors and Solutions:

Image shape mismatch

  • Explanation: This error occurs when the input image does not have the expected dimensions or format.
  • Solution: Ensure that the input image is correctly formatted and has the appropriate dimensions before passing it to the node.

Invalid shortside value

  • Explanation: This error happens when the shortside parameter is set to a value outside the allowed range.
  • Solution: Verify that the shortside value is within the range of 32 to 4096 and is a multiple of 32.

Unsupported upscale method

  • Explanation: This error occurs if an invalid upscaling method is selected.
  • Solution: Choose one of the supported upscaling methods: nearest-exact, bilinear, or area.

Image Scale by Shortside (WLSH) Related Nodes

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