Visit ComfyUI Online for ready-to-use ComfyUI environment
Resize images to fit within specified size while maintaining aspect ratio, with high-quality resampling and batch processing capabilities.
The FS: Fit Image And Resize node is designed to help you resize images to fit within a specified maximum size while maintaining their aspect ratio. This node is particularly useful for preparing images for further processing or analysis, ensuring that they are scaled appropriately without distortion. It leverages various resampling methods to achieve high-quality resizing and can optionally upscale images if needed. Additionally, it can handle batch processing and add noise to the images, making it a versatile tool for AI artists looking to preprocess their images efficiently.
This parameter accepts the image you want to resize. The image should be in a format that the node can process, typically a tensor representation of the image.
This parameter requires a Variational Autoencoder (VAE) model, which is used to encode the image into a latent space. The VAE helps in resizing the image while preserving its essential features.
This integer parameter sets the maximum size (in pixels) for the longest dimension of the image. The default value is 768, and it can be adjusted in steps of 8. This parameter ensures that the resized image fits within the specified dimensions without exceeding them.
This parameter allows you to choose the resampling method used for resizing the image. The available options are lanczos
, nearest
, bilinear
, and bicubic
. The default method is bicubic
, which provides a good balance between quality and performance.
This boolean parameter determines whether the image should be upscaled if its dimensions are smaller than the specified max_size. The options are false
and true
, with the default being false
.
This integer parameter specifies the number of images to process in a batch. The default value is 1, with a minimum of 1 and a maximum of 64. This is useful for processing multiple images simultaneously.
This float parameter allows you to add a specified amount of noise to the image. The value ranges from 0 to 1, with a default of 0. This can be useful for data augmentation or testing the robustness of your models.
This output provides the latent representation of the resized image, encoded by the VAE. It is useful for further processing in latent space.
This output is the resized image in its tensor format. It can be used directly for visualization or further image processing tasks.
This integer output indicates the width of the resized image. It helps you understand the new dimensions of the image after resizing.
This integer output indicates the height of the resized image. It helps you understand the new dimensions of the image after resizing.
This float output provides the aspect ratio of the resized image. It is useful for maintaining the visual proportions of the image in subsequent processing steps.
bicubic
resampling method, especially for images with fine details.batch_size
parameter to match the number of images you have.add_noise
parameter to introduce variability in your dataset, which can be beneficial for training more robust models.max_size
parameter is set according to the requirements of your subsequent processing steps to avoid unnecessary resizing later.<image_path>
lanczos
, nearest
, bilinear
, or bicubic
.add_noise
parameter is set outside the range of 0 to 1.add_noise
value is between 0 and 1.© Copyright 2024 RunComfy. All Rights Reserved.