ComfyUI > Nodes > ComfyUI-seam-carving > Image Resize (seam carving)

ComfyUI Node: Image Resize (seam carving)

Class Name

SeamCarving

Category
image
Author
spinagon (Account age: 5411days)
Extension
ComfyUI-seam-carving
Latest Updated
2025-03-14
Github Stars
0.03K

How to Install ComfyUI-seam-carving

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

Image Resize (seam carving) Description

SeamCarving intelligently resizes images by preserving key content and removing less important areas.

Image Resize (seam carving):

SeamCarving is a sophisticated image processing node designed to resize images intelligently by preserving important content while removing less significant areas. This technique, known as seam carving, allows for content-aware resizing, which means that the node can adjust the dimensions of an image without distorting or losing key visual elements. By analyzing the energy of pixels, SeamCarving identifies and removes seams—paths of least importance—thereby maintaining the integrity of the image's most critical features. This method is particularly beneficial for resizing images in a way that avoids the typical artifacts and distortions associated with traditional scaling methods. SeamCarving is ideal for applications where maintaining the visual quality of an image is paramount, such as in graphic design, photography, and digital art.

Image Resize (seam carving) Input Parameters:

pixels

The pixels parameter represents the input image data that you want to resize. It is a tensor containing the pixel values of the image. This parameter is crucial as it provides the raw data that the seam carving algorithm will process to perform the resizing operation.

width

The width parameter specifies the desired width of the output image. It determines how many pixels wide the resized image should be. This parameter is essential for defining the horizontal dimension of the final image, allowing you to tailor the output to specific size requirements.

height

The height parameter specifies the desired height of the output image. Similar to the width parameter, it defines how many pixels tall the resized image should be. This parameter is crucial for setting the vertical dimension of the final image, ensuring it meets your specific size needs.

keep_mask

The keep_mask parameter is an optional mask that indicates areas of the image that should be preserved during the resizing process. It is a tensor that highlights regions you want to protect from removal, ensuring that important content remains intact. This parameter is useful when you have specific parts of an image that must not be altered.

drop_mask

The drop_mask parameter is an optional mask that specifies areas of the image that can be removed during the resizing process. It is a tensor that marks regions that are less important and can be sacrificed to achieve the desired image dimensions. This parameter allows for more aggressive resizing by prioritizing the removal of less critical content.

Image Resize (seam carving) Output Parameters:

resized_image

The resized_image parameter is the output of the SeamCarving node, representing the resized image as a tensor. This output contains the pixel values of the image after the seam carving process has been applied, reflecting the new dimensions specified by the width and height parameters. The resized image maintains the visual integrity of important content while adjusting to the desired size.

Image Resize (seam carving) Usage Tips:

  • Use the keep_mask to protect essential parts of your image, such as faces or text, ensuring they remain unchanged during resizing.
  • Apply the drop_mask to less important areas, like backgrounds, to allow for more flexible resizing without affecting key content.
  • Experiment with different width and height values to achieve the best balance between image size and content preservation.

Image Resize (seam carving) Common Errors and Solutions:

Image Resize (seam carving): Drop mask would delete entire image, ignoring

  • Explanation: This error occurs when the drop_mask is set in such a way that it would result in the removal of the entire image, leaving no content behind.
  • Solution: Adjust the drop_mask to ensure that it does not cover the entire image. Focus on marking only the less important areas for removal, leaving significant content unmasked.

Image Resize (seam carving) Related Nodes

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