ComfyUI > Nodes > Comfyui_PDuse > PDIMAGE:LongerSize

ComfyUI Node: PDIMAGE:LongerSize

Class Name

PDIMAGE_LongerSize

Category
image/transform
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

PDIMAGE:LongerSize Description

Resizes images by scaling the longer side to a specified size, preserving aspect ratio and quality.

PDIMAGE:LongerSize:

The PDIMAGE_LongerSize node is designed to resize an image by scaling its longer side to a specified size while maintaining the original aspect ratio. This functionality is particularly useful for ensuring that images fit within certain dimensions without distorting their proportions, which is crucial for maintaining visual integrity in AI-generated art. By focusing on the longer side, this node allows you to standardize image sizes efficiently, making it easier to manage and display images consistently across different platforms or applications. The node leverages advanced interpolation techniques to ensure that the resized images retain high quality, making it an essential tool for artists who need to prepare images for various outputs or further processing.

PDIMAGE:LongerSize Input Parameters:

image

This parameter represents the input image that you want to resize. It is expected to be in a specific format that the node can process, typically a tensor representing the image data. The image serves as the primary subject for the resizing operation, and its dimensions will be adjusted based on the specified size for the longer side.

size

The size parameter determines the target length for the longer side of the image. It is an integer value with a default of 512, a minimum of 1, and a maximum of 99999. This parameter directly influences the scale of the resizing operation, ensuring that the longer side of the image matches the specified size while maintaining the aspect ratio. Adjusting this value allows you to control the final dimensions of the resized image.

interpolation

This parameter specifies the interpolation method used during the resizing process. Available options include "nearest," "bilinear," "bicubic," "area," and "nearest-exact," with "bicubic" set as the default. The choice of interpolation affects the quality and smoothness of the resized image, with different methods offering varying levels of detail preservation and computational efficiency. Selecting the appropriate interpolation method can enhance the visual quality of the output image.

PDIMAGE:LongerSize Output Parameters:

IMAGE

The output of the PDIMAGE_LongerSize node is the resized image, which is returned as a tensor. This output image has its longer side adjusted to the specified size while maintaining the original aspect ratio. The resized image is ready for further processing or display, ensuring consistency in size across different images and applications.

PDIMAGE:LongerSize Usage Tips:

  • To maintain high image quality, consider using the "bicubic" interpolation method, especially for images with fine details.
  • When preparing images for web or print, set the size parameter to match the target display dimensions to ensure optimal presentation.

PDIMAGE:LongerSize Common Errors and Solutions:

ValueError: Input image must be 4-dimensional (BxHxWxC)

  • Explanation: This error occurs when the input image does not have the expected four-dimensional shape, which includes batch size, height, width, and channels.
  • Solution: Ensure that the input image is formatted correctly as a 4D tensor before passing it to the node.

ValueError: No image provided to PD:GetImageSize node

  • Explanation: This error indicates that the input image is missing or not properly passed to the node.
  • Solution: Verify that the image input is correctly specified and that the image data is not None before executing the node.

PDIMAGE:LongerSize 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.

PDIMAGE:LongerSize