ComfyUI > Nodes > ComfyUI_KimNodes > 🍒Crop_Paste✀裁切粘贴

ComfyUI Node: 🍒Crop_Paste✀裁切粘贴

Class Name

Crop_Paste

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

🍒Crop_Paste✀裁切粘贴 Description

Facilitates cropping and pasting image sections for precise composite creation using PIL and NumPy.

🍒Crop_Paste✀裁切粘贴:

The Crop_Paste node is designed to facilitate the process of cropping a section from an image and pasting it onto another image. This node is particularly useful for tasks that require image manipulation, such as creating composite images or adjusting specific areas within an image. By leveraging the capabilities of the Python Imaging Library (PIL) and NumPy, the node ensures that the cropped image is accurately resized and positioned according to specified bounding box coordinates. This functionality is essential for AI artists who need to seamlessly integrate different image elements, allowing for creative freedom and precision in digital artwork.

🍒Crop_Paste✀裁切粘贴 Input Parameters:

image

The image parameter represents the base image onto which the cropped section will be pasted. It can be provided as a NumPy array or a PyTorch tensor. The node will handle the conversion and ensure the image is in the correct format for processing. This parameter is crucial as it serves as the canvas for the final composite image.

crop_img

The crop_img parameter is the image from which a section will be cropped. Similar to the image parameter, it can be provided as a NumPy array or a PyTorch tensor. The node processes this image to extract the desired section based on the bounding box coordinates.

bboxes

The bboxes parameter is a list of dictionaries, each containing the coordinates for the bounding box that defines the area to be cropped from crop_img. Each dictionary should have keys xmin, ymin, xmax, and ymax, representing the normalized coordinates of the bounding box. This parameter is essential for determining the exact portion of the image to be cropped and pasted.

🍒Crop_Paste✀裁切粘贴 Output Parameters:

image_paste

The image_paste parameter is the resulting image after the crop and paste operation. It is a composite image that includes the original image with the specified section from crop_img pasted onto it. This output is crucial for verifying the success of the operation and for further use in digital artwork or image processing tasks.

🍒Crop_Paste✀裁切粘贴 Usage Tips:

  • Ensure that the bounding box coordinates in bboxes are correctly normalized between 0 and 1 to avoid unexpected cropping results.
  • When working with PyTorch tensors, make sure to squeeze any unnecessary dimensions to prevent shape mismatches during processing.

🍒Crop_Paste✀裁切粘贴 Common Errors and Solutions:

Invalid bounding box coordinates

  • Explanation: This error occurs when the calculated coordinates for the bounding box result in a negative width or height, indicating an invalid region.
  • Solution: Verify that the xmin, ymin, xmax, and ymax values are correctly set and that xmin is less than xmax and ymin is less than ymax.

Image value range warning

  • Explanation: This warning is triggered when the pixel values of the cropped image exceed the expected range of 0 to 1.
  • Solution: Ensure that the input images are properly normalized before processing. The node will automatically clip values to the correct range, but pre-normalization can prevent this warning.

🍒Crop_Paste✀裁切粘贴 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.

🍒Crop_Paste✀裁切粘贴