ComfyUI > Nodes > Comfyui_PDuse > PD:image_resize_V2

ComfyUI Node: PD:image_resize_V2

Class Name

PDImageResizeV2

Category
PD/ImageProcessing
Author
7BEII (Account age: 453days)
Extension
Comfyui_PDuse
Latest Updated
2026-03-25
Github Stars
0.05K

How to Install Comfyui_PDuse

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

PD:image_resize_V2 Description

PDImageResizeV2 resizes images and masks, preserving quality and aspect ratio with advanced interpolation.

PD:image_resize_V2:

PDImageResizeV2 is a sophisticated node designed to resize images while maintaining their quality and aspect ratio. This node is particularly beneficial for AI artists who need to adjust image dimensions without compromising on detail or introducing artifacts. It employs advanced interpolation techniques to ensure that the resized images are smooth and visually appealing. The node is capable of handling optional masks, which can be resized alongside the image, making it a versatile tool for tasks that require both image and mask manipulation. By using PDImageResizeV2, you can efficiently prepare images for various applications, ensuring they meet specific size requirements while preserving their original quality.

PD:image_resize_V2 Input Parameters:

resize_mode

The resize_mode parameter determines how the image will be resized in relation to its dimensions. It can be set to either "shortest" or "longest". When set to "shortest", the image is resized such that the shortest side matches the target size, maintaining the aspect ratio. Conversely, "longest" resizes the image so that the longest side matches the target size. This parameter is crucial for ensuring that the resized image fits within the desired dimensions while preserving its original proportions.

target_size

The target_size parameter specifies the desired size for the image's shortest or longest side, depending on the resize_mode. This parameter directly influences the scale factor applied during resizing. It is important to choose a target size that aligns with your project's requirements, as it will determine the final dimensions of the resized image. There are no explicit minimum or maximum values provided, but it should be a positive integer that reflects the intended output size.

mask_optional

The mask_optional parameter allows you to provide an optional mask that will be resized along with the image. This mask should be a tensor with the shape (B, H, W), where B is the batch size, and H and W are the height and width of the mask. If no mask is provided, a default mask of zeros will be used. This parameter is particularly useful for applications that require both image and mask processing, ensuring that both elements are resized consistently.

PD:image_resize_V2 Output Parameters:

resized_image

The resized_image output is the main result of the node, providing the image that has been resized according to the specified parameters. This output maintains the quality and aspect ratio of the original image, ensuring that it meets the target size requirements without introducing distortion or artifacts. The resized image is ready for further processing or use in your projects.

resized_mask

The resized_mask output is the resized version of the optional mask provided as an input. If a mask was included, this output ensures that it has been resized to match the dimensions of the resized image, maintaining alignment and consistency. If no mask was provided, this output will be a default mask of zeros. This output is essential for tasks that involve both image and mask manipulation, ensuring that both elements are processed together.

PD:image_resize_V2 Usage Tips:

  • Ensure that the resize_mode is set appropriately based on whether you want to prioritize the shortest or longest side of the image for resizing.
  • Choose a target_size that aligns with your project's requirements to avoid unnecessary resizing and potential quality loss.
  • If working with masks, always provide the mask_optional parameter to ensure consistent resizing of both the image and mask.

PD:image_resize_V2 Common Errors and Solutions:

Invalid resize_mode

  • Explanation: The resize_mode parameter must be either "shortest" or "longest".
  • Solution: Verify that the resize_mode is set to a valid option and adjust it accordingly.

Target size not specified

  • Explanation: The target_size parameter is required to determine the scale factor for resizing.
  • Solution: Ensure that a valid target_size is provided before executing the node.

Mask shape mismatch

  • Explanation: The provided mask does not match the expected shape (B, H, W).
  • Solution: Check the shape of the mask and adjust it to match the expected dimensions before providing it as an input.

PD:image_resize_V2 Related Nodes

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