floyo logobeta logo
Powered by
ThinkDiffusion
floyo logobeta logo
Powered by
ThinkDiffusion

Hollow Preserve

1

Last updated
2025-05-15

A custom node for ComfyUI, the Hollow Preserve tool addresses the issue of inpainting models unintentionally altering enclosed regions within mask strokes. By creating strategic breaks in closed mask contours, it allows users to maintain specific areas while still utilizing inpainting techniques.

  • Automatically identifies closed loops in masks that contain areas not covered by the mask.
  • Generates clean break lines from the center of the enclosed area to the edge, ensuring precise control over inpainting.
  • Offers customizable break line thickness, enabling users to tailor the output to their specific needs.

Context

Hollow Preserve is designed to enhance the functionality of ComfyUI by preventing unwanted modifications to enclosed areas in masks during the inpainting process. This is particularly useful for users who want to preserve certain regions inside their masked selections, such as the center of a donut shape, while still applying inpainting to the rest of the mask.

Key Features & Benefits

This tool's ability to automatically detect closed loops in masks means that users can work more efficiently without manually checking for enclosed areas. The creation of break lines from the center to the edge of these contours ensures that the inpainting model does not mistakenly alter regions that should remain untouched. Additionally, the option to customize the thickness of these break lines provides further flexibility, allowing for adjustments based on the specific requirements of each project.

Advanced Functionalities

The Hollow Preserve node includes advanced capabilities such as calculating the center point of closed contours and generating break lines accordingly. This process is non-destructive, meaning it only alters masks with enclosed areas, preserving the integrity of other mask types. Furthermore, users can test the effect of their masks through a provided script, visualizing the differences between original and processed masks.

Practical Benefits

Incorporating the Hollow Preserve tool into a user's workflow significantly enhances control over the inpainting process in ComfyUI. By preventing unintended modifications to specific regions, it improves the overall quality of inpainting results, leading to more professional and polished outputs. This efficiency allows artists and developers to focus on creative aspects rather than troubleshooting issues caused by closed mask loops.

Credits/Acknowledgments

This tool is developed by the original author and contributors listed in the repository, and it is distributed under the MIT license, allowing for wide usage and modification within the open-source community.