ComfyUI > Nodes > ComfyUI_KimNodes > 🍒Transparent_Area_Cropper✀透明区域裁剪

ComfyUI Node: 🍒Transparent_Area_Cropper✀透明区域裁剪

Class Name

Transparent_Area_Cropper

Category
🍒 Kim-Nodes/✂ Crop | 裁剪工具
Author
Kim (Account age: 2536days)
Extension
ComfyUI_KimNodes
Latest Updated
2025-09-22
Github Stars
0.05K

How to Install ComfyUI_KimNodes

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

🍒Transparent_Area_Cropper✀透明区域裁剪 Description

Crops images by focusing on transparent areas to enhance and refine compositions for AI artists.

🍒Transparent_Area_Cropper✀透明区域裁剪:

The Transparent_Area_Cropper node is designed to intelligently crop images by focusing on transparent areas, allowing you to refine and optimize your image compositions. This node is particularly useful for AI artists who work with images that contain transparent regions, as it helps in isolating and enhancing specific parts of an image without losing important details. By leveraging transparency, the node can effectively determine the most relevant areas to crop, ensuring that the resulting image maintains its artistic integrity and focus. This capability is essential for creating clean and professional-looking images, especially when dealing with complex compositions that require precise adjustments. The node's functionality is built to accommodate various artistic needs, making it a versatile tool in your image processing workflow.

🍒Transparent_Area_Cropper✀透明区域裁剪 Input Parameters:

orig_width

This parameter represents the original width of the image before cropping. It is crucial for calculating the extent of the crop and any potential expansion or contraction based on the percentage specified. The value is used to determine how much of the image's width should be included in the final cropped output.

orig_height

Similar to orig_width, this parameter denotes the original height of the image. It plays a vital role in defining the vertical boundaries of the crop. The height is adjusted according to the percentage expansion or contraction, ensuring that the cropped area is proportionate and maintains the desired aspect ratio.

百分比扩展 (Percentage Expansion)

This parameter allows you to specify the percentage by which the crop area should be expanded or contracted. A positive value will expand the crop area, while a negative value will contract it. This flexibility enables you to fine-tune the cropping process, either by including more of the surrounding area or by focusing more tightly on the central subject.

最小扩展像素 (Minimum Expansion Pixels)

This parameter sets a minimum threshold for the expansion of the crop area in pixels. It ensures that even if the percentage expansion is small, the crop area will still be expanded by at least this number of pixels. This is particularly useful for maintaining a consistent crop size across different images.

🍒Transparent_Area_Cropper✀透明区域裁剪 Output Parameters:

alpha_composite_tensor

This output is a tensor representation of the alpha composite image, which combines the cropped image with its transparency mask. It is essential for further processing or analysis, as it retains the transparency information that is crucial for many artistic applications.

output_tensor

The output_tensor is the tensor form of the cropped image itself. This output is used for any subsequent image processing tasks and provides a clean, focused version of the original image, cropped according to the specified parameters.

mask_tensor

This output provides the transparency mask as a tensor. It is used to understand which parts of the image are transparent and can be crucial for tasks that require precise control over image transparency, such as compositing or layering images.

🍒Transparent_Area_Cropper✀透明区域裁剪 Usage Tips:

  • Experiment with different percentage expansion values to see how they affect the composition of your image. A small positive value can help include more context, while a negative value can focus on the subject.
  • Use the minimum expansion pixels parameter to ensure that your crop always includes a certain amount of surrounding area, which can be useful for maintaining consistency across a series of images.

🍒Transparent_Area_Cropper✀透明区域裁剪 Common Errors and Solutions:

"IndexError: Crop area exceeds image dimensions"

  • Explanation: This error occurs when the calculated crop area extends beyond the boundaries of the original image.
  • Solution: Ensure that the percentage expansion and minimum expansion pixels do not result in a crop area larger than the original image dimensions. Adjust these parameters accordingly.

"ValueError: Negative dimensions are not allowed"

  • Explanation: This error is raised when the crop area is calculated to have negative dimensions, usually due to excessive contraction.
  • Solution: Check the percentage expansion parameter to ensure it is not too negative, and adjust it to maintain positive crop dimensions.

🍒Transparent_Area_Cropper✀透明区域裁剪 Related Nodes

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

🍒Transparent_Area_Cropper✀透明区域裁剪