Visit ComfyUI Online for ready-to-use ComfyUI environment
Automatically adjust image dimensions to fit specified constraints for video production, maintaining aspect ratio and offering cropping flexibility.
The ConstrainImageforVideo| Constrain Image for Video 🐍
node is designed to adjust the dimensions of an image to fit within specified maximum and minimum width and height constraints while maintaining the original aspect ratio. This node is particularly useful for preparing images for video production, ensuring that they meet specific size requirements without distortion. It offers the flexibility to crop images if necessary to fit within the desired dimensions, making it a versatile tool for AI artists who need to standardize image sizes for consistent video output. By using this node, you can automate the process of resizing and cropping images, saving time and ensuring uniformity across your video projects.
This parameter accepts a list of images that you want to constrain. Each image will be processed to fit within the specified size constraints while maintaining its aspect ratio.
This integer parameter sets the maximum allowable width for the images. The default value is 1024, and it must be a non-negative integer. If an image's width exceeds this value, it will be resized down to fit within this limit.
This integer parameter sets the maximum allowable height for the images. The default value is 1024, and it must be a non-negative integer. If an image's height exceeds this value, it will be resized down to fit within this limit.
This integer parameter sets the minimum allowable width for the images. The default value is 0, and it must be a non-negative integer. If an image's width is below this value, it will be resized up to meet this minimum requirement.
This integer parameter sets the minimum allowable height for the images. The default value is 0, and it must be a non-negative integer. If an image's height is below this value, it will be resized up to meet this minimum requirement.
This parameter is a choice between "yes" and "no", with the default value being "no". If set to "yes", the node will crop the images to fit within the specified maximum dimensions if resizing alone is insufficient. This ensures that the images meet the exact size requirements.
The output is a list of images that have been resized and possibly cropped to fit within the specified maximum and minimum width and height constraints. Each image maintains its original aspect ratio unless cropping is required to meet the size limits.
max_width
and max_height
to match your video resolution.crop_if_required
to "no".min_width
and min_height
parameters to avoid images becoming too small and losing detail.max_width
or max_height
.max_width
and max_height
parameters are set correctly and consider enabling cropping by setting crop_if_required
to "yes".min_width
or min_height
.min_width
and min_height
parameters to appropriate values that match your requirements.max_width
, max_height
, min_width
, min_height
) are non-negative and within a reasonable range.© Copyright 2024 RunComfy. All Rights Reserved.