ComfyUI > Nodes > comfy_Pond_Nodes > πŸ³ε›ΎεƒθƒŒζ™―ε‘«ε……

ComfyUI Node: πŸ³ε›ΎεƒθƒŒζ™―ε‘«ε……

Class Name

ImageResizeAndPadWithReference

Category
🐳Pond/image
Author
Pondowner857 (Account age: 730days)
Extension
comfy_Pond_Nodes
Latest Updated
2026-01-28
Github Stars
0.04K

How to Install comfy_Pond_Nodes

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

πŸ³ε›ΎεƒθƒŒζ™―ε‘«ε…… Description

Resizes and pads images using a reference image to ensure consistent dimensions and style.

πŸ³ε›ΎεƒθƒŒζ™―ε‘«ε……:

The ImageResizeAndPadWithReference node is designed to facilitate the resizing and padding of images by using a reference image as a guide. This node is particularly useful for ensuring that your images are resized and padded to match the dimensions of a reference image, maintaining consistency across your visual projects. It offers flexibility in how images are resized, allowing you to choose from different modes such as stretching or filling, and provides options for padding with custom colors or transparency. This node is essential for artists who need to prepare images for various outputs, ensuring that all images conform to a specific size and aesthetic, which is crucial for maintaining a cohesive visual style.

πŸ³ε›ΎεƒθƒŒζ™―ε‘«ε…… Input Parameters:

image

This parameter represents the image you wish to resize and pad. It is a tensor that contains the image data, including its height, width, and color channels. The image is processed to match the dimensions of the reference image, ensuring consistency in size and appearance.

reference

The reference parameter is a tensor that provides the target dimensions for resizing and padding the input image. It serves as a guide to ensure that the output image matches the desired size and aspect ratio, which is particularly useful when working with a series of images that need to be uniform.

resize_mode

This parameter determines how the image is resized to fit the reference dimensions. Options include "stretch" and "fill," where "stretch" adjusts the image to fit exactly within the target dimensions, potentially altering its aspect ratio, while "fill" maintains the original aspect ratio and fills any remaining space with padding.

padding_color

The padding_color parameter specifies the color used to fill any space around the resized image. This can be a specific color or "transparent" if the image has an alpha channel, allowing for creative control over the appearance of the padded areas.

position

This parameter defines the position where the resized image will be placed within the padded area. It allows you to control the alignment of the image, such as centering it or aligning it to a specific edge, providing flexibility in how the final image is composed.

custom_color

An optional parameter that allows you to specify a custom color for padding if the default options do not meet your needs. This provides additional creative control over the appearance of the padded areas, ensuring that they complement the image's aesthetic.

πŸ³ε›ΎεƒθƒŒζ™―ε‘«ε…… Output Parameters:

output

The output parameter is a tensor that contains the resized and padded image. It matches the dimensions of the reference image and includes any padding applied according to the specified parameters. This output is ready for use in further processing or as a final product, ensuring consistency and quality in your visual projects.

target_width

This parameter indicates the width of the output image, which matches the width of the reference image. It confirms that the resizing and padding process has achieved the desired dimensions.

target_height

Similar to target_width, this parameter indicates the height of the output image, ensuring that the final image conforms to the reference dimensions and is ready for use in your projects.

πŸ³ε›ΎεƒθƒŒζ™―ε‘«ε…… Usage Tips:

  • Use the "fill" resize mode to maintain the original aspect ratio of your images, which is ideal for preserving the visual integrity of your artwork.
  • Experiment with different padding colors to see how they affect the overall composition and aesthetic of your images, especially when working with transparent backgrounds.

πŸ³ε›ΎεƒθƒŒζ™―ε‘«ε…… Common Errors and Solutions:

Image dimensions mismatch

  • Explanation: This error occurs when the input image dimensions do not match the expected dimensions for processing.
  • Solution: Ensure that the input image and reference image have compatible dimensions or adjust the resize_mode to accommodate the differences.

Invalid padding color

  • Explanation: This error arises when an unsupported padding color is specified.
  • Solution: Verify that the padding_color parameter is set to a valid color option or provide a custom_color that is correctly formatted.

Unsupported resize mode

  • Explanation: This error is triggered when an invalid resize_mode is selected.
  • Solution: Check that the resize_mode parameter is set to a supported option, such as "stretch" or "fill".

πŸ³ε›ΎεƒθƒŒζ™―ε‘«ε…… Related Nodes

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

πŸ³ε›ΎεƒθƒŒζ™―ε‘«ε