ComfyUI > Nodes > ComfyUI_KimNodes > 🍒Percentage_Cropper✀百分比裁剪

ComfyUI Node: 🍒Percentage_Cropper✀百分比裁剪

Class Name

Percentage_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

🍒Percentage_Cropper✀百分比裁剪 Description

Crops images symmetrically by percentage, focusing on central content and refining composition.

🍒Percentage_Cropper✀百分比裁剪:

The Percentage_Cropper node is designed to crop images by a specified percentage of their width and height, allowing you to focus on the central portion of an image by trimming the edges. This node is particularly useful for AI artists who want to refine their images by removing unwanted borders or emphasizing the central content. By specifying the percentage of the image to be cropped from the horizontal and vertical dimensions, you can achieve precise control over the final composition of your artwork. The node ensures that the cropping is symmetrical, maintaining the balance and integrity of the image's central area.

🍒Percentage_Cropper✀百分比裁剪 Input Parameters:

image

The image parameter is the input image tensor that you want to crop. It should be in the format (B, H, W, C), where B is the batch size, H is the height, W is the width, and C is the number of color channels. This parameter is crucial as it serves as the base upon which the cropping operation is performed.

horizontal_percent

The horizontal_percent parameter specifies the percentage of the image's width to be cropped from each side. It is a floating-point value with a default of 10.0, a minimum of 0.0, and a maximum of 100.0. Adjusting this parameter allows you to control how much of the image's width is removed, with higher values resulting in more significant cropping.

vertical_percent

The vertical_percent parameter determines the percentage of the image's height to be cropped from the top and bottom. Like horizontal_percent, it is a floating-point value with a default of 10.0, a minimum of 0.0, and a maximum of 100.0. This parameter lets you manage the vertical cropping extent, enabling you to focus on the central vertical portion of the image.

🍒Percentage_Cropper✀百分比裁剪 Output Parameters:

IMAGE

The output is an IMAGE tensor that represents the cropped version of the input image. This tensor retains the original batch size and color channels but has reduced dimensions based on the specified cropping percentages. The output image is essential for further processing or final presentation, as it reflects the refined composition achieved through the cropping operation.

🍒Percentage_Cropper✀百分比裁剪 Usage Tips:

  • To maintain the aspect ratio of the central content, use equal values for horizontal_percent and vertical_percent.
  • Start with smaller percentage values to ensure you do not crop out essential parts of the image, especially when working with images that have important details near the edges.

🍒Percentage_Cropper✀百分比裁剪 Common Errors and Solutions:

"Input image tensor is not in the correct format"

  • Explanation: This error occurs when the input image does not have the expected shape of (B, H, W, C).
  • Solution: Ensure that your input image is a 4D tensor with the correct dimensions. If necessary, add a batch dimension using unsqueeze.

"Cropping percentage exceeds image dimensions"

  • Explanation: This error happens when the specified cropping percentages result in negative or zero dimensions for the output image.
  • Solution: Verify that the horizontal_percent and vertical_percent values are set to reasonable numbers that do not exceed the image's dimensions. Adjust the percentages to ensure that the cropped dimensions remain positive.

🍒Percentage_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.