ef08bc1b91b3eed01d72248ac86bdedefcd1af9d
- Split into two buttons: 'Save Image' and 'Save Mask from Selection' - Add isOpen flag to prevent DOM operations after modal close - Simplify mask export: create mask directly from selection - Better error handling and status messages
ComfyUI Inpaint Region Editor
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
Method 1: ComfyUI Manager (Recommended)
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
- Add the Inpaint Region Editor node
- Upload an image
- Right-click the node → "Open in Photopea"
- Edit your image and create/edit the mask
- 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.
Languages
JavaScript
90.5%
Python
9.5%