Save 4 hours! We auto-setup your workflow! Free!

Drop your workflow.json — we handle every dependency, custom node, and model. Just open the link and run.

Auto-Setup Workflow Json (Free) Now!
ComfyUI > Nodes > comfyui-klein-edit-composite > Klein Edit Composite

ComfyUI Node: Klein Edit Composite

Class Name

KleinEditComposite

Category
image/Klein
Author
supermansundies (Account age: 1178days)
Extension
comfyui-klein-edit-composite
Latest Updated
2026-03-23
Github Stars
0.08K

How to Install comfyui-klein-edit-composite

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

Klein Edit Composite Description

Sophisticated image editing node with advanced alignment and blending techniques for seamless integration of edits.

Klein Edit Composite:

KleinEditComposite is a sophisticated node designed to seamlessly integrate edits into an original image, providing a robust solution for AI artists looking to enhance their visual creations. This node leverages advanced techniques such as MAGSAC SIFT alignment and Gradient+LAB structure difference to ensure precise alignment and blending of images. One of its standout features is the optional Poisson Blending, which allows for seamless lighting transitions, making the edits appear natural and cohesive with the original image. The node is equipped with full debug visualization capabilities, enabling users to understand and refine the compositing process. By using KleinEditComposite, you can achieve high-quality image composites that maintain the integrity and aesthetic of the original artwork while incorporating new elements.

Klein Edit Composite Input Parameters:

orig_np

This parameter represents the original image in the form of a NumPy array. It serves as the base onto which the generated edits will be composited. The quality and resolution of this image directly impact the final output.

gen_np

This parameter is the generated image or edit that you wish to composite onto the original image. It is also provided as a NumPy array and should be aligned in terms of dimensions with the original image for optimal results.

delta_e_threshold

This float parameter sets the threshold for color difference, influencing how closely the colors of the generated image need to match the original. A lower value results in stricter color matching, while a higher value allows for more variation. Typical values range from 0 to 100.

flow_preset

This integer parameter determines the optical flow preset used for motion estimation between images. Options include ultrafast, fast, and medium, each offering a trade-off between speed and accuracy.

occlusion_threshold

A float parameter that sets the threshold for detecting occlusions in the image. It helps in identifying areas where the generated image might not align perfectly with the original, allowing for adjustments to be made.

grow_px

This integer parameter specifies the number of pixels by which the mask should be grown. It helps in ensuring that the edges of the composite are smooth and blend well with the original image.

close_radius

This integer parameter defines the radius for morphological closing operations, which helps in closing small holes in the mask, ensuring a more solid composite.

feather_px

A float parameter that determines the amount of feathering applied to the edges of the composite. Feathering helps in creating a smooth transition between the original and generated images.

color_match_blend

This float parameter controls the blending ratio for color matching between the original and generated images. A higher value results in more aggressive color matching.

noise_removal_px

An integer parameter that specifies the size of noise removal operations. It helps in cleaning up small artifacts in the composite, ensuring a cleaner final image.

max_islands

This integer parameter limits the number of disconnected regions or "islands" in the composite mask. It helps in maintaining a cohesive composite by reducing fragmentation.

fill_holes

A boolean parameter that, when enabled, fills small holes in the composite mask, ensuring a more complete and solid composite.

use_occlusion

This boolean parameter enables the use of occlusion detection, which helps in identifying and correcting areas where the generated image does not align perfectly with the original.

fill_borders

A boolean parameter that, when enabled, fills the borders of the composite to ensure that the edges are smooth and blend seamlessly with the original image.

custom_mask

This parameter allows you to provide a custom mask as a NumPy array, which defines the specific areas of the image to be composited. It offers greater control over the compositing process.

custom_mask_mode

A string parameter that determines how the custom mask is applied. Options include "replace" and other modes that define how the custom mask interacts with the automatically generated mask.

poisson_blend_edges

A boolean parameter that, when enabled, applies Poisson Blending to the edges of the composite, ensuring seamless lighting transitions and a more natural appearance.

debug

This boolean parameter enables debug mode, providing detailed visualizations and reports of the compositing process, which can be invaluable for troubleshooting and refining the composite.

Klein Edit Composite Output Parameters:

result

The final composited image, returned as a NumPy array. This image represents the seamless integration of the generated edits onto the original image, with all specified adjustments and blending applied.

composite_mask

A NumPy array representing the mask used for compositing. It shows the areas of the original image that were affected by the compositing process, providing insight into the blending and alignment.

stats

A dictionary containing various statistics and information about the compositing process, such as resolution and whether Poisson Blending was used. This information can be useful for understanding the effectiveness of the composite.

debug_images

A dictionary of debug images that provide visual insights into different stages of the compositing process. These images can help in diagnosing issues and understanding how different parameters affect the final output.

Klein Edit Composite Usage Tips:

  • Experiment with the delta_e_threshold to achieve the desired level of color matching between the original and generated images. Lower values ensure closer color matching.
  • Use the flow_preset to balance between speed and accuracy based on your needs. For quick previews, ultrafast might be suitable, while medium offers better accuracy for final outputs.
  • Enable poisson_blend_edges for seamless lighting transitions, especially when the generated image has different lighting conditions than the original.
  • Utilize the debug mode to visualize the compositing process and make informed adjustments to parameters for optimal results.

Klein Edit Composite Common Errors and Solutions:

"Dimension mismatch between original and generated images"

  • Explanation: This error occurs when the dimensions of the original and generated images do not match.
  • Solution: Ensure that both images have the same dimensions before passing them to the node.

"Invalid flow preset value"

  • Explanation: The flow preset value provided is not recognized.
  • Solution: Use one of the predefined flow presets: ultrafast, fast, or medium.

"Custom mask dimensions do not match original image"

  • Explanation: The custom mask provided does not have the same dimensions as the original image.
  • Solution: Resize the custom mask to match the dimensions of the original image before using it in the node.

Klein Edit Composite Related Nodes

Go back to the extension to check out more related nodes.
comfyui-klein-edit-composite
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.

Klein Edit Composite