ComfyUI > Nodes > Comfy_Felsirnodes > RescaleMaintainAspect

ComfyUI Node: RescaleMaintainAspect

Class Name

Rescale Maintain Aspect

Category
Felsir
Author
Felsir (Account age: 3861days)
Extension
Comfy_Felsirnodes
Latest Updated
2026-03-10
Github Stars
0.02K

How to Install Comfy_Felsirnodes

Install this extension via the ComfyUI Manager by searching for Comfy_Felsirnodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter Comfy_Felsirnodes 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
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

RescaleMaintainAspect Description

Resizes images while preserving aspect ratio, with alignment and background fill options.

RescaleMaintainAspect:

The Rescale Maintain Aspect node is designed to resize images while preserving their original aspect ratio, ensuring that the image does not appear stretched or distorted. This node is particularly useful when you need to fit an image into a specific dimension without altering its proportions. It achieves this by calculating the optimal dimensions that maintain the aspect ratio and then resizing the image accordingly. The node also allows you to specify how the resized image should be aligned within the new dimensions, providing options for horizontal and vertical alignment. Additionally, you can choose a fill color for the background, which will be visible in the areas not covered by the resized image. This functionality is essential for maintaining the visual integrity of images in various applications, such as graphic design, web development, and digital art.

RescaleMaintainAspect Input Parameters:

image_in

This parameter accepts the input image(s) that you want to resize. It is crucial as it serves as the source material for the node's operations. The node can handle multiple images, processing each one to maintain its aspect ratio.

width

This integer parameter specifies the target width for the resized image. The node will adjust the image dimensions to fit within this width while maintaining the aspect ratio. The default value is 512, with a minimum of 16 and a maximum of 2048.

height

This integer parameter defines the target height for the resized image. Similar to the width, the node will ensure the image fits within this height, preserving the aspect ratio. The default value is 512, with a minimum of 16 and a maximum of 2048.

halign

This parameter determines the horizontal alignment of the resized image within the new dimensions. Options include "center," "left," and "right." This setting affects where the image will be placed horizontally if there is extra space due to aspect ratio preservation.

valign

This parameter specifies the vertical alignment of the resized image within the new dimensions. Options are "center," "top," and "bottom." It controls the vertical positioning of the image when there is additional space.

fillcolor

This parameter allows you to choose the background color for the areas not covered by the resized image. Options include "black," "white," and "transparent." This setting is important for ensuring the final image appearance matches your design requirements.

RescaleMaintainAspect Output Parameters:

IMAGE

The output is the resized image(s) with the maintained aspect ratio. The image is adjusted to fit within the specified dimensions, aligned according to the chosen settings, and with the selected fill color applied to any uncovered areas. This output is crucial for applications requiring precise image dimensions without distortion.

RescaleMaintainAspect Usage Tips:

  • To maintain the original look of an image while fitting it into a specific size, ensure that the width and height parameters are set to the desired dimensions, and choose the appropriate alignment settings to control the image's placement.
  • Use the fillcolor parameter to match the background of the resized image with your project's color scheme, especially when the image does not cover the entire specified dimensions.

RescaleMaintainAspect Common Errors and Solutions:

Invalid horizontal alignment. Use 'center', 'left', or 'right'.

  • Explanation: This error occurs when an invalid value is provided for the halign parameter.
  • Solution: Ensure that the halign parameter is set to one of the valid options: "center," "left," or "right."

Invalid vertical alignment. Use 'center', 'top', or 'bottom'.

  • Explanation: This error is triggered when an incorrect value is given for the valign parameter.
  • Solution: Verify that the valign parameter is set to a valid option: "center," "top," or "bottom."

RescaleMaintainAspect Related Nodes

Go back to the extension to check out more related nodes.
Comfy_Felsirnodes
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.