ComfyUI > Nodes > ComfyUI-WanVideoWrapper > WanVideo Image Resize To Closest

ComfyUI Node: WanVideo Image Resize To Closest

Class Name

WanVideoImageResizeToClosest

Category
WanVideoWrapper
Author
kijai (Account age: 2871days)
Extension
ComfyUI-WanVideoWrapper
Latest Updated
2026-05-05
Github Stars
6.41K

How to Install ComfyUI-WanVideoWrapper

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

WanVideo Image Resize To Closest Description

Efficiently resize video frames to closest target size while maintaining aspect ratio for video processing workflows.

WanVideo Image Resize To Closest:

The WanVideoImageResizeToClosest node is designed to efficiently resize video frames to dimensions that are closest to a specified target size while maintaining the desired aspect ratio. This node is particularly useful in video processing workflows where maintaining the quality and aspect ratio of the video frames is crucial. By calculating the optimal dimensions based on the input parameters, it ensures that the resized frames fit within the specified area constraints without unnecessary distortion. This node is beneficial for AI artists who need to prepare video frames for further processing or analysis, as it simplifies the resizing process and ensures consistency across frames.

WanVideo Image Resize To Closest Input Parameters:

image

The image parameter represents the video frame that needs to be resized. It is crucial as it serves as the input data for the resizing operation. The quality and dimensions of the input image will directly affect the output, as the node will calculate the closest valid dimensions based on this input.

generation_width

The generation_width parameter specifies the target width for the resized image. It plays a significant role in determining the final dimensions of the output image, as the node will attempt to resize the input image to a width that is closest to this value while maintaining the aspect ratio. The exact minimum, maximum, and default values are not specified, but it should be a positive integer.

generation_height

The generation_height parameter defines the target height for the resized image. Similar to the generation_width, this parameter influences the final dimensions of the output image. The node will calculate the closest valid height that aligns with this target while preserving the aspect ratio. The exact minimum, maximum, and default values are not specified, but it should be a positive integer.

aspect_ratio_preservation

The aspect_ratio_preservation parameter determines how the aspect ratio of the input image should be handled during the resizing process. It can take values such as "keep_input", "stretch_to_new", or "crop_to_new". "Keep_input" maintains the original aspect ratio, "stretch_to_new" adjusts the aspect ratio to fit the new dimensions, and "crop_to_new" centers the crop to fit the new aspect ratio. This parameter is crucial for ensuring that the resized image meets the desired visual requirements.

WanVideo Image Resize To Closest Output Parameters:

resized_image

The resized_image is the output parameter that provides the resized video frame. This image has been adjusted to the closest valid dimensions based on the input parameters, ensuring that it fits within the specified area constraints while maintaining the desired aspect ratio. This output is essential for further processing or analysis in video workflows.

w

The w parameter represents the width of the resized image. It indicates the final width after the resizing operation, which is calculated to be the closest valid dimension based on the input generation_width and aspect ratio preservation settings.

h

The h parameter denotes the height of the resized image. Similar to w, it reflects the final height after resizing, calculated to be the closest valid dimension based on the input generation_height and aspect ratio preservation settings.

WanVideo Image Resize To Closest Usage Tips:

  • Ensure that the generation_width and generation_height are set to values that align with your desired output dimensions to achieve optimal resizing results.
  • Use the aspect_ratio_preservation parameter to control how the aspect ratio is handled, depending on whether you want to maintain the original aspect ratio or adjust it to fit new dimensions.

WanVideo Image Resize To Closest Common Errors and Solutions:

Image size not divisible by 16

  • Explanation: The input image dimensions are not divisible by 16, which may cause issues in certain processing steps.
  • Solution: Adjust the input image dimensions to be divisible by 16 before processing, or allow the node to automatically resize the image to the nearest valid dimensions.

Invalid aspect ratio preservation value

  • Explanation: The aspect_ratio_preservation parameter is set to an unsupported value.
  • Solution: Ensure that the aspect_ratio_preservation parameter is set to one of the supported values: "keep_input", "stretch_to_new", or "crop_to_new".

WanVideo Image Resize To Closest Related Nodes

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

WanVideo Image Resize To Closest