InpaintRegionEditor Dev 7c2b031dfd fix: Auto-close after save, single save button
- Auto-close modal 300ms after successful save
- Single 'Save Image and Mask' button (export layer mask)
- User draws mask using Photopea's built-in layer mask tools
- Simplified code structure
2026-02-27 20:15:49 +08:00

ComfyUI Inpaint Region Editor

License: MIT ComfyUI

A ComfyUI custom node that integrates Photopea (a free online Photoshop alternative) for advanced inpaint editing with mask support.

Features

  • 🎨 Full Photopea Integration - Complete Photoshop-like editing capabilities
  • 📐 Region Presets - Pre-configured sizes for SD (512×512), SDXL (1024×1024)
  • 🔄 Bidirectional Sync - Loads and saves both images and masks
  • 🎭 Layer Mask Support - Masks are loaded as Photopea layer masks

Installation

Search for "Inpaint Region Editor" in ComfyUI Manager.

Method 2: Manual Installation

cd ComfyUI/custom_nodes
git clone https://github.com/YOUR_USERNAME/ComfyUI-InpaintRegionEditor.git

Restart ComfyUI.

Usage

  1. Add the Inpaint Region Editor node
  2. Upload an image
  3. Right-click the node → "Open in Photopea"
  4. Edit your image and create/edit the mask
  5. Click "Save Image and Mask"

Node Outputs

Output Type Description
image IMAGE Edited image
mask MASK Inpaint mask
region_top INT Region top coordinate
region_left INT Region left coordinate
region_width INT Region width
region_height INT Region height

Concept: Mask vs Region

Concept Purpose
Mask Define inpaint area (what to repaint)
Region Define reference area (AI context)

Constraint: Region size must be ≥ mask size.

Technical Details

  • Uses Photopea postMessage API
  • All message origins are verified for security
  • Images processed locally in browser

Limitations

  • Requires internet (Photopea loaded from CDN)
  • First load ~10MB, then cached

Acknowledgments

License

MIT License - see LICENSE file.

Photopea Usage

  • Free API for any purpose (including commercial)
  • Your work belongs entirely to you
  • No attribution required (but appreciated)

Changelog

See CHANGELOG.md for details.

S
Description
No description provided
Readme MIT
897 KiB
Languages
JavaScript 90.5%
Python 9.5%