From 810d2603efd8093ca9990e92605a95258228a475 Mon Sep 17 00:00:00 2001 From: IMGLAB Date: Wed, 1 Apr 2026 17:56:05 +0800 Subject: [PATCH] Update README.md --- README.md | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index c57c329..e1bb895 100644 --- a/README.md +++ b/README.md @@ -1,60 +1,69 @@ -# ComfyUI-AutoPickMask (IMGLAB) +# IMGLAB_ComfyUI + +IMGLAB custom nodes for ComfyUI. + +--- + +## Auto Mask (IMGLAB) A ComfyUI custom node that accepts one image and up to 8 mask inputs, compares dimensions, and outputs the first matching mask — with configurable edge-case handling and an optional fallback (else) mask. ## Installation -Drop the `ComfyUI-AutoPickMask/` folder into `ComfyUI/custom_nodes/` and restart ComfyUI. +Drop the `IMGLAB_ComfyUI/` folder into `ComfyUI/custom_nodes/` and restart ComfyUI. ``` ComfyUI/ └── custom_nodes/ - └── ComfyUI-AutoPickMask/ + └── IMGLAB_ComfyUI/ ├── __init__.py ├── nodes.py ├── README.md + ├── pyproject.toml └── js/ - └── auto_pick_mask.js + └── auto_mask.js ``` +Or install via ComfyUI Manager — search for `IMGLAB_ComfyUI`. + ## Inputs | Input | Type | Description | |---|---|---| | `image` | IMAGE | Source image — defines the target resolution | -| `on_multi_match` | combo | Behaviour when multiple masks match the image size | -| `on_no_match` | combo | Behaviour when no mask matches the image size | +| `multi_match` | combo | Behaviour when multiple masks match the image size | +| `no_match` | combo | Behaviour when no mask matches the image size | | `mask_1` … `mask_8` | MASK | Dynamic slots — next slot appears as each one is connected | -| `else_mask` | MASK | Fallback mask — only visible when `on_no_match = Use Else Mask` | +| `else` | MASK | Fallback mask — only visible when `no_match = Use Else Mask` | ## Outputs | Output | Type | Description | |---|---|---| | `image` | IMAGE | Direct passthrough of the input image | -| `matched_mask` | MASK | First mask whose dimensions match the image (or fallback) | +| `mask` | MASK | First mask whose dimensions match the image (or fallback) | | `rgba` | IMAGE | Input image with matched mask as alpha channel `[B,H,W,4]` | ## Edge Case Options -### on_multi_match — when 2+ masks share the image's exact dimensions: +### multi_match — when 2+ masks share the image's exact dimensions: | Option | Behaviour | |---|---| -| `Use First (Top Priority)` | Silently picks the lowest-numbered slot | +| `Use First Match` | Silently picks the lowest-numbered slot | | `Raise Error` | Halts the queue listing the conflicting slot numbers | -### on_no_match — when no connected mask matches the image size: +### no_match — when no connected mask matches the image size: | Option | Behaviour | |---|---| | `Output Empty Mask` | Outputs a zeroed mask (RGBA will be fully transparent) | -| `Use Else Mask` | Reveals an `else_mask` input slot; uses it as the fallback output | +| `Use Else Mask` | Reveals an `else` input slot; uses it as the fallback output | | `Raise Error` | Halts the queue listing the sizes that were connected | -> **Note:** If `Use Else Mask` is selected but `else_mask` is not connected, the node will raise an error rather than silently fail. +> **Note:** If `Use Else Mask` is selected but `else` is not connected, the node will raise an error rather than silently fail. ## Node UI - **Image slot** — shows resolution (`W×H`) in grey after execution - **Mask slots** — show resolution coloured green (match) or red (mismatch); unconnected slots show a faint grey dot -- **Else mask slot** — shows a `fallback` label in amber; only visible when `on_no_match = Use Else Mask` +- **Else slot** — only visible when `no_match = Use Else Mask` - Mask slots expand automatically as you connect them (up to 8), and collapse when disconnected