Visit ComfyUI Online for ready-to-use ComfyUI environment
Intelligently resize images by removing/inserting seams to preserve important content for content-aware resizing and object removal.
ImageSeamCarving+ is a powerful node designed to intelligently resize images by removing or inserting seams, which are paths of least importance. This technique, known as seam carving, allows you to change the dimensions of an image while preserving its most important content. The node can be particularly useful for tasks such as content-aware resizing, object removal, and aspect ratio adjustments. By analyzing the energy of the image, it ensures that the most significant parts of the image remain intact, providing a more visually appealing result compared to traditional resizing methods.
This parameter represents the input image that you want to resize using seam carving. The image should be provided in a tensor format, typically with dimensions corresponding to batch size, height, width, and channels.
This parameter specifies the target width for the resized image. It determines how many columns will be added or removed from the original image. The value should be an integer representing the desired width in pixels.
This parameter specifies the target height for the resized image. It determines how many rows will be added or removed from the original image. The value should be an integer representing the desired height in pixels.
This parameter defines the energy mode used to calculate the importance of each pixel in the image. The energy mode can be set to "backward" or "forward". The "backward" mode uses a simple gradient-based energy function, while the "forward" mode considers the cost of inserting or removing seams, providing a more accurate result.
This parameter determines the order in which seams are removed or inserted. It can be set to "width-first" or "height-first". The "width-first" option processes the image by adjusting its width first, while the "height-first" option adjusts the height first.
This optional parameter allows you to specify a mask that indicates regions of the image that should be preserved during the seam carving process. The mask should be provided in a tensor format, with the same height and width as the input image. Areas marked in the mask will have higher priority and will be less likely to be altered.
This optional parameter allows you to specify a mask that indicates regions of the image that should be removed during the seam carving process. The mask should be provided in a tensor format, with the same height and width as the input image. Areas marked in the mask will have lower priority and will be more likely to be altered.
This parameter represents the output image after the seam carving process. The output image will have the specified target width and height, with the most important content preserved. The output is provided in a tensor format, typically with dimensions corresponding to batch size, height, width, and channels.
keep_mask
parameter to protect those areas.drop_mask
parameter to mark the regions that should be removed.<operation>
for morphology. Must be one of 'erode', 'dilate', 'open', 'close', 'gradient', 'tophat', 'bottomhat'keep_mask
or drop_mask
do not match the dimensions of the input image.keep_mask
and drop_mask
have the same height and width as the input image. Use interpolation if necessary to adjust the mask dimensions.<energy_mode>
<order>
© Copyright 2024 RunComfy. All Rights Reserved.