ComfyUI > Nodes > ComfyUI Easy Use > ImageInsetCrop

ComfyUI Node: ImageInsetCrop

Class Name

easy imageInsetCrop

Category
EasyUse/Image
Author
yolain (Account age: 1341days)
Extension
ComfyUI Easy Use
Latest Updated
2024-06-25
Github Stars
0.51K

How to Install ComfyUI Easy Use

Install this extension via the ComfyUI Manager by searching for ComfyUI Easy Use
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI Easy Use 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
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

ImageInsetCrop Description

Facilitates precise image cropping with inset values for alignment and consistency in 8-pixel increments.

ImageInsetCrop:

The easy imageInsetCrop node is designed to facilitate precise cropping of images by specifying inset values from the edges. This node allows you to crop images based on either pixel values or percentages, making it versatile for various artistic and technical needs. The primary goal of this node is to provide a straightforward method to remove unwanted borders or focus on specific regions within an image, enhancing the overall composition and visual appeal. By snapping the crop dimensions to 8-pixel increments, it ensures alignment and consistency, which is particularly useful for maintaining image quality and structure.

ImageInsetCrop Input Parameters:

image

This parameter represents the input image that you want to crop. It should be provided in a compatible image format that the node can process.

measurement

This parameter determines the unit of measurement for the cropping values. It can be set to either "Pixels" or "Percentage". When set to "Pixels", the cropping values are interpreted as absolute pixel values. When set to "Percentage", the cropping values are interpreted as percentages of the image's dimensions.

left

This parameter specifies the number of pixels or percentage to crop from the left edge of the image. The value should be adjusted based on the desired cropping effect. If using percentage, the value should be between 0 and 100.

This parameter specifies the number of pixels or percentage to crop from the right edge of the image. Similar to the left parameter, it should be adjusted based on the desired cropping effect. If using percentage, the value should be between 0 and 100.

top

This parameter specifies the number of pixels or percentage to crop from the top edge of the image. Adjust this value to control the amount of cropping from the top. If using percentage, the value should be between 0 and 100.

bottom

This parameter specifies the number of pixels or percentage to crop from the bottom edge of the image. Adjust this value to control the amount of cropping from the bottom. If using percentage, the value should be between 0 and 100.

ImageInsetCrop Output Parameters:

image

The output parameter is the cropped image. This image will have the specified insets removed, resulting in a new image that focuses on the desired region. The output image maintains the same format as the input image but with adjusted dimensions based on the cropping parameters.

ImageInsetCrop Usage Tips:

  • To achieve precise cropping, use pixel values for the measurement parameter. This is particularly useful when you know the exact dimensions you want to remove.
  • For more flexible and proportional cropping, use percentage values. This is helpful when working with images of varying sizes and you want to maintain a consistent cropping ratio.
  • Ensure that the cropping values do not exceed the image dimensions to avoid errors and unintended results.

ImageInsetCrop Common Errors and Solutions:

Invalid cropping dimensions top (<inset_top\>) exceeds bottom (<inset_bottom\>)

  • Explanation: This error occurs when the top cropping value is greater than the bottom cropping value, resulting in an invalid crop region.
  • Solution: Adjust the top and bottom cropping values to ensure that the top value is less than or equal to the bottom value.

Invalid cropping dimensions left (<inset_left\>) exceeds right (<inset_right\>)

  • Explanation: This error occurs when the left cropping value is greater than the right cropping value, resulting in an invalid crop region.
  • Solution: Adjust the left and right cropping values to ensure that the left value is less than or equal to the right value.

The number of original_images (<len(original_image)\>) and cropped_images (<len(crop_image)\>) should be the same

  • Explanation: This error occurs when there is a mismatch in the number of original and cropped images provided.
  • Solution: Ensure that the number of original images matches the number of cropped images to avoid this error.

ImageInsetCrop Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI Easy Use
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.