ComfyUI > Nodes > IAMCCS-nodes > Image Resize Batch Safe (IAMCCS)

ComfyUI Node: Image Resize Batch Safe (IAMCCS)

Class Name

IAMCCS_ImageResizeBatchSafe

Category
IAMCCS/Utils
Author
IAMCCS (Account age: 2204days)
Extension
IAMCCS-nodes
Latest Updated
2026-03-27
Github Stars
0.08K

How to Install IAMCCS-nodes

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

Image Resize Batch Safe (IAMCCS) Description

Batch-safe image resizing node for IAMCCS, optimizing memory and maintaining quality.

Image Resize Batch Safe (IAMCCS):

The IAMCCS_ImageResizeBatchSafe node is designed to facilitate batch-safe image resizing within IAMCCS workflows, ensuring efficient processing without causing memory spikes typically associated with concatenation operations. This node mirrors the KJ resize modes used in IAMCCS flows, providing a seamless integration into existing workflows while maintaining image quality and aspect ratio. It is particularly beneficial for AI artists who need to resize large batches of images without compromising on performance or encountering memory issues. By handling images in sub-batches, it optimizes resource usage and ensures that the resizing process is both effective and reliable.

Image Resize Batch Safe (IAMCCS) Input Parameters:

image

The image parameter is a tensor representing the batch of images to be resized. It is expected to be in NHWC format [B,H,W,C], where B is the batch size, H is the height, W is the width, and C is the number of channels. This parameter is crucial as it forms the basis of the resizing operation. There are no default values, and it is mandatory to provide this input.

mask

The mask parameter is an optional tensor that can be used to specify areas of interest within the images. If provided, it should match the dimensions of the image tensor. This parameter allows for selective resizing or processing of specific regions within the images.

width

The width parameter specifies the target width for the resized images. It is an integer value that determines the new width dimension after resizing. This parameter is essential for defining the output size of the images.

height

The height parameter specifies the target height for the resized images. Similar to the width parameter, it is an integer value that sets the new height dimension after resizing. This parameter, along with width, defines the final dimensions of the resized images.

keep_proportion

The keep_proportion parameter is a string that indicates whether to maintain the aspect ratio of the images during resizing. Options typically include "yes" or "no", affecting how the images are scaled to fit the new dimensions.

upscale_method

The upscale_method parameter determines the algorithm used for resizing the images. It is a string value that can include methods like "bilinear", "nearest", or others, impacting the quality and speed of the resizing process.

crop_position

The crop_position parameter specifies the position from which to crop the images if the aspect ratio is not maintained. It is a string value that can include options like "center", "top-left", etc., influencing the composition of the resized images.

pad_color

The pad_color parameter defines the color used to pad the images if the aspect ratio is maintained and the new dimensions require padding. It is a string representing RGB values, ensuring that the padding blends seamlessly with the image content.

divisible_by

The divisible_by parameter is an integer that ensures the dimensions of the resized images are divisible by a specified value. This is useful for compatibility with certain neural network architectures that require specific input sizes.

target_device

The target_device parameter specifies the computational device to be used for the resizing operation. It can be set to "cpu" or "gpu", affecting the performance and speed of the process.

Image Resize Batch Safe (IAMCCS) Output Parameters:

out_image

The out_image parameter is the tensor representing the resized images. It retains the NHWC format and reflects the new dimensions specified by the width and height parameters. This output is crucial as it provides the final resized images ready for further processing or analysis.

out_mask

The out_mask parameter, if applicable, is the tensor representing the resized masks corresponding to the input images. It is optional and only provided if a mask was included in the input parameters. This output is important for maintaining the integrity of masked regions after resizing.

out_w

The out_w parameter is an integer representing the final width of the resized images. It confirms the successful application of the specified width during the resizing process.

out_h

The out_h parameter is an integer representing the final height of the resized images. It confirms the successful application of the specified height during the resizing process.

Image Resize Batch Safe (IAMCCS) Usage Tips:

  • Ensure that the image tensor is in the correct NHWC format before using the node to avoid errors.
  • Use the keep_proportion parameter to maintain the aspect ratio of images when resizing to prevent distortion.
  • Select an appropriate upscale_method based on the desired balance between quality and performance.

Image Resize Batch Safe (IAMCCS) Common Errors and Solutions:

ValueError: "image is required"

  • Explanation: This error occurs when the image parameter is not provided.
  • Solution: Ensure that you supply a valid image tensor in the NHWC format as input.

ValueError: "Expected IMAGE tensor in NHWC format [B,H,W,C]"

  • Explanation: The input image tensor does not match the expected format.
  • Solution: Verify that your image tensor is structured in the NHWC format and adjust if necessary.

RuntimeError: "Resize produced no output"

  • Explanation: The resizing operation did not produce any output, possibly due to incorrect input parameters.
  • Solution: Double-check all input parameters, especially width, height, and upscale_method, to ensure they are correctly specified.

Image Resize Batch Safe (IAMCCS) Related Nodes

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

Image Resize Batch Safe (IAMCCS)