[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-80179":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":14,"stars7d":13,"stars30d":12,"stars90d":15,"forks30d":15,"starsTrendScore":16,"compositeScore":17,"rankGlobal":9,"rankLanguage":9,"license":9,"archived":18,"fork":18,"defaultBranch":19,"hasWiki":20,"hasPages":18,"topics":21,"createdAt":9,"pushedAt":9,"updatedAt":22,"readmeContent":23,"aiSummary":24,"trendingCount":15,"starSnapshotCount":15,"syncStatus":13,"lastSyncTime":25,"discoverSource":26},80179,"ComfyUI-Angelo","shootthesound\u002FComfyUI-Angelo","shootthesound","Click-to-refine + smart inpaint sampler node for ComfyUI (FLUX 2 Klein). One node: generate, then click \u002F paint \u002F drag to refine, or do location-guided whole-image edits.",null,"JavaScript",101,11,2,1,0,3,44.34,false,"main",true,[],"2026-06-12 04:01:27","# Angelo\n\n**A click-to-refine sampler for ComfyUI.** Generate an image, then click or paint on regions you want improved. Each click refines just that area while the rest stays bit-exact. One node replaces the standard `KSampler` + post-processing chain. Works with **FLUX 2 Klein 9B** and **Qwen-Image-Edit** as first-class edit models — plus any other sampler-compatible model (FLUX 1, SDXL, SD 1.5).\n\n\u003Ca href=\"https:\u002F\u002Fbuymeacoffee.com\u002Florasandlenses\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FBuy%20me%20a%20coffee-FFDD00?style=for-the-badge&logo=buy-me-a-coffee&logoColor=black\" alt=\"Buy Me A Coffee\">\u003C\u002Fa>\n\n![Angelo in Edit Mode](screenshots\u002Ftoolbar-edit-mode.png)\n\n## What it does in one screen\n\n```\n                                  ┌─────────────────────────────┐\n   Model ──────────►              │     Angelo Node             │\n                                  │  ┌───────────────────────┐  │\n   Empty Latent ─►                │  │ Mode Steps CFG Sampler│  │  ← gen config row\n                   AngeloRefine   │  │ Smpl Seed \u002F Ctrl ...  │  │  ← sampler-seed row\n   positive ────►                 │  │ [Reset][Undo] Inpaint▾│  │  ← refine actions\n                                  │  │ [Click R][Feather]... │  │  ← refine values\n   negative ────►                 │  ├───────────────────────┤  │\n                                  │  │ Area Prompt: [______] │  │  ← in-node text box\n   vae ─────────►                 │  ├───────────────────────┤  │\n                                  │  │                       │  │\n   clip ────────►                 │  │   Preview canvas      │  │  ← click \u002F paint \u002F drag\n                                  │  │   (fits the node)     │  │\n                                  │  └───────────────────────┘  │\n                                  └────────────┬────────────────┘\n                                               │\n                                 image · latent · source_image outputs\n```\n\nThat's the entire workflow. No KSampler upstream, no ADetailer downstream, no Image-to-Mask plumbing in between. Generate, click, done. The image always scales to fit the node — resize the node and the preview tracks it.\n\n![Angelo wired into a graph](screenshots\u002Fworkflow-overview.png)\n\n## Why you'd want it\n\nComfyUI's standard \"fix the bad hand\" workflow is: generate, save the image, open MaskEditor, paint a mask, route the mask + image + a new sampler config back into the graph, re-queue. It works but it's friction-heavy.\n\nAngelo collapses that into:\n\n- **Click** a region. It refines with your main prompt, in place, immediately.\n- **Load Image** to edit an existing photo directly in the node — no Empty Latent + `VAEEncode` chain to wire (you still connect the `vae` input as normal; Angelo does the encode itself). Or just **drag-drop an image file** onto the node; **right-click** the preview to copy it or open it in a new tab.\n- **Paint** a freeform stroke with mouse-down + drag. Same thing but custom shape.\n- **Type an Area Prompt** right in the node to refine a region with a different prompt (e.g. main prompt = \"person in forest\", area prompt = \"detailed photorealistic face\") — no second CLIP Text Encode node needed.\n- **Toggle Xtra-Fine** to refine small regions at much higher effective resolution (the ADetailer move, but with full prompt control).\n- **Smart Inpaint** — drag a rectangle and add brand-new content with an edit model (FLUX 2 Klein 9B or Qwen-Image-Edit).\n- **Smart Guided Inpaint** — no drawing at all: pick a location from a dropdown (\"top left\", \"center\", …) + describe what to add, and the edit model places it.\n- **Detect** a region by *describing* it (optional SAM 3) — type \"the face\", click the highlight, and it masks the silhouette for you. No painting. Nudge the mask in\u002Fout, or Shift\u002FAlt-drag to touch it up by hand.\n- **Re-roll** the last edit with a fresh seed on the same mask + original image, or **toggle Persistent Mask** to keep evolving a region over repeated Queues.\n- **Undo \u002F Redo** to step back and forward through your refines.\n- **`source_image` output** emits the original pre-edit base, ready to wire straight into a compare node.\n\nAll in one node. All without re-queueing the whole workflow manually for each fix.\n\n## Model compatibility\n\nAngelo treats **FLUX 2 Klein 9B** and **Qwen-Image-Edit** as its two first-class edit models — both get the full feature set, including the Smart inpaint modes. It also works with any other sampler-compatible model: FLUX 1, SDXL, SD 1.5, and standard checkpoints (for **Refine**, Xtra-Fine, and Area Prompt — the Smart modes need an edit-trained model).\n\nTwo latent layouts are handled transparently. **Standard 4D models** (FLUX, SDXL, SD) use `[B, C, H, W]` latents. **Temporal \u002F video-derived models** (Qwen Image Edit, Wan) use 5D `[B, C, T, H, W]` latents — their VAEs carry an extra frame axis. Angelo normalises latent shape at a single VAE boundary and feeds each model the dimensionality it expects before sampling (the same step ComfyUI's stock KSampler does), so you don't need a model-specific latent node — wire `model`, `vae`, and `clip` as usual.\n\nFor the **Smart** inpaint modes, use an **edit-trained** checkpoint — **FLUX 2 Klein 9B** or **Qwen-Image-Edit** (not plain Qwen-Image, which has the reference code path but isn't trained for it; see [Inpainting Mode](#inpainting-mode-refine--smart-inpaint--smart-guided-inpaint)). **Refine** (incl. Xtra-Fine and Area Prompt) works on any model.\n\n## Install\n\nClone into your `ComfyUI\u002Fcustom_nodes\u002F`:\n\n```bash\ncd ComfyUI\u002Fcustom_nodes\u002F\ngit clone https:\u002F\u002Fgithub.com\u002Fshootthesound\u002FComfyUI-Angelo.git\n```\n\nRestart ComfyUI. No additional Python dependencies for the core node. (The optional **Detect** feature adds SAM 3 — see [Detect](#detect--auto-segment-with-sam-3-optional) for its one-time opt-in installer.)\n\n## Quick start\n\n### FLUX 2 Klein 9B distilled\n\n**Just want it running?** Drag [`workflows\u002FKlein9b-example.json`](workflows\u002FKlein9b-example.json) onto the ComfyUI canvas — it's a complete FLUX 2 Klein 9B graph (UNet \u002F CLIP \u002F VAE loaders → Angelo → Save Image) wired and ready. Point the loaders at your model files and queue.\n\nTo wire it from scratch instead:\n\n1. Add the **Angelo — click to refine** node from the `sampling\u002FAngelo` category.\n2. Wire it up:\n   - `model` ← Load Checkpoint \u002F FLUX model loader\n   - `latent` ← Empty Latent Image\n   - `positive` \u002F `negative` ← CLIP Text Encode nodes\n   - `vae` ← Load VAE \u002F your VAE source\n   - `clip` ← your CLIP \u002F text encoder (optional, but required for the in-node **Area Prompt** and the Smart modes). Wire the same CLIP that feeds your CLIP Text Encode nodes.\n3. Defaults are tuned for Klein 9B distilled: `steps=4`, `cfg=1.0`, `sampler=euler`, `scheduler=simple`. All sampler\u002Fgeneration settings live in the node's toolbar (no native widget rows). Adjust for other models.\n4. Mode defaults to **Sampler Mode**. Queue the workflow — Angelo generates the base image.\n5. Flip **Mode** to **Edit Mode** (top-left of the toolbar). The refine controls un-grey; cursor becomes a crosshair.\n6. Click a region on the preview. Angelo refines that spot.\n\nThat's the loop. Click → refine → click → refine. Undo if needed. Reset to start over from the cached base.\n\n### Qwen-Image-Edit\n\n**Just want it running?** Drag [`workflows\u002FQwen Edit 2511 example.json`](workflows\u002FQwen%20Edit%202511%20example.json) onto the ComfyUI canvas — a complete Qwen-Image-Edit 2511 graph wired to Angelo. Point the loaders at your model files and queue.\n\nTo wire it from scratch, do it exactly the same way as Klein — `model` \u002F `vae` \u002F `clip` \u002F `positive` \u002F `negative` — but point the loaders at a **Qwen-Image-Edit** checkpoint, its VAE, and its text encoder. There's no Qwen-specific latent node to add; Angelo normalises the latent shape internally.\n\nQwen-Image-Edit isn't distilled like Klein, so adjust the toolbar generation settings to suit it — typically more steps and CFG > 1 (or a low-step Lightning \u002F Lightx2v LoRA if you run one, which lets you drop back toward 4–8 steps at CFG ≈ 1). Everything else is identical: Sampler Mode to generate, then Edit Mode for Refine \u002F Xtra-Fine \u002F Area Prompt \u002F Smart Inpaint \u002F Smart Guided Inpaint.\n\n## The two modes\n\n### Sampler Mode\n\nAngelo acts as a normal sampler — generates the base image from the incoming latent. The refine control rows are greyed; canvas clicks do nothing. The generation config row (Mode \u002F Steps \u002F CFG \u002F Sampler \u002F Sched) and the Sampler-seed row stay active here:\n\n- **Mode** — flip between Sampler \u002F Edit.\n- **Smpl Denoise** — denoise level for the base gen (1.0 = full regenerate from noise, like a normal KSampler).\n- **Smpl Seed** + **Smpl Ctrl** — seed value + after-generate control (`fixed` \u002F `randomize` \u002F `increment` \u002F `decrement`).\n\nWhen you flip Mode to Edit Mode, `Smpl Ctrl` auto-locks to `fixed` and `Smpl Seed` snaps to the seed that actually produced the cached image (preserves it across the mode switch). The Sampler-seed row greys out in Edit Mode.\n\n![Mode dropdown](screenshots\u002Fmode-dropdown.png)\n\n### Edit Mode\n\nThe refine control rows come alive. Click, paint, or drag on the preview to refine, depending on the Inpaint mode.\n\nCursor changes by mode:\n- **Crosshair** = single-click refine (Refine) or rectangle drag (Smart Inpaint)\n- **Cell** = paint mode active (drag to draw a freeform stroke, Refine only)\n- **Default arrow** = Smart Guided Inpaint (no canvas interaction — driven by the location dropdown + Generate button)\n\nPaint Mode lets you brush a freeform region to refine instead of single-circle clicks:\n\n![Paint Mode — freeform brushed region](screenshots\u002Fpaint-mode.png)\n\n## Load Image (edit an existing photo)\n\nWant to edit a photo rather than something you generated? Hit **🖼 Load Image** in the toolbar, pick a file, and it becomes the base — no Empty Latent or separate `VAEEncode` node to wire. The `latent` input is **optional**; Load Image is all you need.\n\n> **Still wire the `vae` input as normal.** Angelo encodes the loaded photo (and decodes previews) with it — it just does the encode internally, so you don't need a standalone `VAEEncode` node feeding `latent`.\n\nOn load you're asked how to size it:\n\n- **Keep current resolution** — encode the photo as-is.\n- **Resize to _X_ MP** — scale to a target megapixel (good for taming huge phone photos \u002F saving VRAM).\n\nEither way the dimensions are rounded to a multiple of 16 so any supported VAE is happy. The node then VAE-encodes the photo with the wired `vae`, installs it as the **base**, and switches to **Edit Mode** so you can click \u002F paint \u002F inpaint straight away.\n\nNotes:\n- **Reset and Undo return to the loaded photo** (it's the base).\n- **While an image is loaded, the `latent` input is ignored.** Hit **✕ Unload** (appears next to Load Image while one is loaded) to clear it and hand the base back to the wired latent.\n- The base is in-process state, so a ComfyUI restart clears it — but Load Image re-encodes from the uploaded file, so re-loading is one click.\n\n### Using Angelo as a standalone image editor\n\nHeads-up on how ComfyUI runs things: *any* Angelo action — Load Image, a refine click, a paint stroke — triggers ComfyUI's normal **queue**, which re-executes every output node on the canvas plus anything with a randomised seed. That's a ComfyUI behaviour, not something a custom node can opt out of (there's no \"run just this node\" API). So if you've got a sampler set to `randomize` or other Save Image chains hanging around, they fire on every edit too — which feels slow.\n\nIf you're using Angelo to **edit existing images**, keep it snappy by running it on a **minimal graph** — `Load Checkpoint \u002F loaders → Angelo → Save Image` — or **mute \u002F bypass (Ctrl+M)** the other generation chains while you edit. Then a load or click only runs Angelo and its loaders (which are cached), and nothing else re-fires.\n\n## Toolbar\n\nThe toolbar holds everything — there are no native widget rows. Top to bottom, grouped into a centred Mode switch, a generation block, and an edit block:\n\n```\n                 ┌─────────────────┐\n                 │  Mode: [Edit ▾] │            ← centred at the top\n                 └─────────────────┘\n  [Steps] [CFG] [Sampler ▾] [Sched ▾]            ← shared generation config (always active)\n  [Smpl Seed] [Smpl Ctrl ▾] [Smpl Denoise]       ← base-gen seed (greys in Edit Mode)\n ─────────────────────────────────────────\n  [Reset] [Undo] [Redo] [Re-roll] | [Persistent Mask] [Area Prompt] [Paint Mode] [Xtra-Fine] | [Inpaint ▾]\n  [Click R] [Feather] [Denoise] [Seed] [Ctrl ▾] | [MP] [Max] [Method ▾]    ← edit block (greys in Sampler Mode)\n```\n\nThe **Mode** switch sits centred up top. Below it, the generation block (always active, base-gen seed greys in Edit Mode); below the divider, the edit block (greys entirely in Sampler Mode). Every control has a hover tooltip. Quick reference:\n\n### Mode + generation block\n\n| Control | What it does |\n|---|---|\n| **Mode ▾** | Sampler Mode (generate the base) vs Edit Mode (click\u002Fpaint\u002Fdrag to refine). Centred at the top of the node |\n| **Steps \u002F CFG \u002F Sampler ▾ \u002F Sched ▾** | Sampler config, shared by base gen and refines. Klein 9B distilled: 4 \u002F 1.0 \u002F euler \u002F simple. Qwen-Image-Edit: more steps + CFG > 1 (or a low-step Lightning LoRA) |\n| **Smpl Seed \u002F Smpl Ctrl ▾ \u002F Smpl Denoise** | Seed, after-generate control, and denoise for the base generation (Sampler Mode) |\n\n### Edit block — actions + toggles\n\n| Control | What it does |\n|---|---|\n| **Reset** | Discard cached refinements + history, start fresh from the Sampler-Mode base |\n| **Undo** | Pop the most recent refine off the history stack (up to 10 deep) |\n| **Redo** | Re-apply the most recent refine that Undo removed. A new edit clears the redo history. Button-only (no Ctrl-Z\u002FY — those clash with ComfyUI's graph undo) |\n| **Re-roll** | Redo the most recent edit with a fresh seed on the **same mask + same starting image**, replacing the last attempt — cycle seeds on one edit without reset → re-mask → rerun. Works for click \u002F paint \u002F rectangle \u002F detected masks |\n| **Persistent Mask** | Hold the last mask, then hit Queue repeatedly to keep refining that region on the **latest** result — each press builds further, so you can gradually morph it (pair with `Ctrl=randomize`). For variations on the *original* image instead, use **Re-roll**. Locked OFF in Smart Guided Inpaint (no mask) |\n| **Area Prompt** | Refine with the Area Prompt text typed in the box above the canvas (encoded with the connected `CLIP`) instead of the main prompt. Requires a `CLIP` input + non-empty text. The box only appears when this is ON. Forced ON in both Smart modes |\n| **Paint Mode** | Hold + drag to paint a freeform stroke as the mask, instead of single-circle clicks (Refine only) |\n| **Xtra-Fine** | Crop the painted region, upscale via VAE + image upscale, refine at high effective resolution, composite back. ADetailer-style. Forced ON in Smart Inpaint, OFF in Smart Guided Inpaint |\n| **Inpaint ▾** | `Refine` \u002F `Smart Inpaint` \u002F `Smart Guided Inpaint`. See \"Inpainting Mode\" below |\n\n### Edit block — refine values\n\n| Control | What it does |\n|---|---|\n| **Click R** | Pixel radius for single-click refines + brush size in Paint Mode |\n| **Feather** | Pixel-space gaussian feathering on the mask edge for smooth transitions. Defaults to 15 (and is adjustable) in Smart Inpaint for a soft blend; disabled in Smart Guided Inpaint |\n| **Denoise** | How much trajectory to run on the refine (0.3 = subtle, 0.6 = real redo, 0.9+ = regenerate). Locked to 1.0 in both Smart modes |\n| **Seed** + **Ctrl ▾** | Seed for the refine pass + after-generate control. Defaults to `randomize` so each refine is a fresh variation |\n| **MP** | (Xtra-Fine only) Target megapixels for the refine pass |\n| **Max** | (Xtra-Fine only) Hard cap on linear upscale factor (8× linear = 64× area) |\n| **Method ▾** | (Xtra-Fine only) Pixel-space upscale method. Default lanczos. |\n\n## Xtra-Fine (the killer feature)\n\nStandard refine runs the model on the full latent. The mask only decides where output is written; the model sees the whole image as context. That's great for general refinement but it means a small region (a face, a hand) is only ~64 latent units wide — well below where FLUX renders detail well.\n\nXtra-Fine does what ADetailer does, but inside the same Angelo loop:\n\n1. Compute the painted-mask bbox + a context-padding band of surrounding pixels for context.\n2. VAE-decode the cached latent to pixels.\n3. Crop the pixel image to that padded bbox.\n4. Upscale the crop in pixel space to hit `MP` megapixels (capped at `Max` linear scale).\n5. VAE-encode the upscaled crop → high-resolution latent.\n6. Refine just the painted shape inside it via the standard noise-injection inpaint path.\n7. VAE-decode, downscale, composite back into the cached pixel image.\n8. VAE-encode the composited image AND blend with the cached latent using the mask as alpha — so the unaltered regions stay bit-exact (no VAE round-trip drift).\n\nThe result: a face that was 64 latent units gets refined at ~1000 latent units (depends on `MP` + `Max`). The model finally has room to render fingers, eyes, teeth correctly.\n\n**Pair with Area Prompt** for a workflow Lightroom users will recognise: paint a region, type \"detailed photorealistic face\" in the Area Prompt box, click. Same image, that region transformed at full quality with the override prompt.\n\n### When to use Xtra-Fine — and the size floor\n\n**Rule of thumb: if the thing you're improving is small, turn Xtra-Fine ON.** A distant face, an eye, a hand, jewellery, text on a sign — anything that occupies only a small slice of the frame. In plain Refine those pixels map to just a handful of latent cells and the model has no room to render detail; Xtra-Fine crops them out and enlarges them to a full working canvas (the `MP` target, default ~1 MP ≈ 1024²) before refining, then composites back. For large regions plain Refine is already fine and faster.\n\n**Mind the VAE size floor.** The VAE downsamples by **16× on FLUX 2** (8× on FLUX 1 \u002F SDXL \u002F SD 1.5), so the region the model actually works on needs enough latent cells to encode meaningful detail. Practical guidance:\n\n- Aim for the refined region to land at **roughly 512–1024 px on its short edge** after the Xtra-Fine enlarge. On FLUX 2 that's ~32–64 latent cells — enough for coherent detail. The default `MP` ≈ 1024² gets you there for most paints.\n- The enlarge is **capped at `Max` linear scale (default 8× = 64× area)**. So an extremely tiny paint can't be blown up without limit: a ~40 px region maxes out around ~320 px even at 8×, which is near the floor and will look soft. **Paint a little wider** (or raise `Max`) so the crop — and the VAE — have room to work.\n- Below ~256 px effective working size, expect mush: there simply aren't enough latent cells for the model to put detail into, no matter the prompt.\n\nIn short: Xtra-Fine is what makes *small* fixes possible at all, but it can't conjure resolution from nothing — give it a crop that enlarges to a few hundred pixels minimum.\n\n## Re-roll vs Persistent Mask (iterating on a region)\n\nTwo complementary ways to keep working a region without re-masking:\n\n**Re-roll** (button, next to Undo) redoes your most recent edit with a fresh seed on the **same mask and the same starting image**, swapping the result in place of the last attempt. Mash it to cycle seeds on one edit until you like a result — it doesn't stack on top of itself. Works for click, paint, rectangle and detected masks. (It does this by popping the last attempt, so `Undo` afterwards still steps back through your history as expected.)\n\n**Persistent Mask** (toggle) holds the last mask; each press of the standard ComfyUI Queue button re-runs it on the **latest** result, so the region builds *further* every time — use it to gradually morph something into something else over several presses:\n\n- `Ctrl=randomize` + Queue, Queue, Queue → a varied walk, each step building on the last\n- `Ctrl=fixed` + Queue, Queue, Queue → push the same direction deterministically\n\nA new click while Persistent Mask is on commits a new region to keep building from.\n\nIn short: **Re-roll** = \"try this edit again on the original\"; **Persistent Mask** = \"keep evolving from where I am now.\"\n\n## Inpainting Mode (Refine \u002F Smart Inpaint \u002F Smart Guided Inpaint)\n\nThree options for how a region is treated. The two Smart modes need an **edit-trained model** (FLUX 2 Klein 9B, **Qwen-Image-Edit**, etc.) and a wired `CLIP`. They work by injecting `reference_latents`, so a **base** text-to-image checkpoint (e.g. plain Qwen-Image, not the *Edit* variant) will produce colour-distorted output — it has the reference code path but its weights were never trained for it. Use the Edit variant for Smart Inpaint \u002F Smart Guided Inpaint; **Refine** works on any model.\n\n![Inpaint mode dropdown](screenshots\u002Finpaint-modes.png)\n\n| Mode | What it does | Use for |\n|---|---|---|\n| **Refine** (default) | Painted\u002Fclicked region is the starting state — the model partially denoises the existing pixels per the denoise level. Mask is a click circle or a paint stroke. | Face\u002Fhand fixes, polish, style adjustments, **editing what's already there** |\n| **Smart Inpaint** | Drag a rectangle (click + hold one corner, release at the opposite). Locks `denoise=1.0`, `Xtra-Fine=ON`, `Area Prompt=ON`. Injects `reference_latents` so an edit model's edit branch activates, then zeros the masked latent so the region regenerates from full noise. | **Adding new content** in a specific drawn region |\n| **Smart Guided Inpaint** | No painting or boxes. Pick a **location** from a dropdown (\"Top left\", \"Center\", \"Bottom half\", …); it's prepended to your Area Prompt at run time (e.g. *\"In the top left of the image, a red car\"*) and the edit model places it across the whole image. Locks `denoise=1.0`, `Xtra-Fine=OFF`, `Area Prompt=ON`; press **Generate Guided Edit** to run. | **Adding new content** when you don't want to draw — quick, coarse placement |\n\n### Why Smart Inpaint exists\n\nAn edit model like FLUX 2 Klein or Qwen-Image-Edit has no concept of a mask — it takes a reference image + a prompt and produces an edited image. The painted shape only constrains *where the result is composited*, not what the model generates. Smart Inpaint addresses this by (a) cropping to the dragged rectangle so the model's working region is the area you care about, (b) injecting **that cropped region** as `reference_latents` so the edit branch sees the local context (the reference is the crop only — never the whole image), and (c) zeroing the masked latent so the model fills it as new content rather than refining what was there.\n\nTypical \"add a person on the road\" workflow:\n\n1. **Inpaint Mode: Smart Inpaint** (auto-locks denoise=1.0 \u002F Xtra-Fine=ON \u002F Area Prompt=ON)\n2. **Drag a rectangle** roughly where the person should go — make it generously larger than the subject so the body isn't clipped at the rectangle edge\n3. Type the **Area Prompt** (the box appears above the canvas): `\"a person walking, full body, realistic, matching the scene's lighting\"`\n4. **Queue**\n\nRectangles beat tight silhouettes here: the composite keeps only what lands inside your shape, so a person-shaped mask clips any body part the model drew outside it. A generous rectangle gives the model room to compose a complete subject.\n\nExample — drag a rectangle over the wheel, prompt `\"wheel engulfed in flames\"`, run:\n\n\u003Ctable>\n\u003Ctr>\u003Ctd align=\"center\">\u003Cb>Before\u003C\u002Fb> (rectangle + prompt)\u003C\u002Ftd>\u003Ctd align=\"center\">\u003Cb>After\u003C\u002Fb>\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>\u003Cimg src=\"screenshots\u002Fsmart-inpaint-before.png\" width=\"400\" alt=\"Smart Inpaint before\">\u003C\u002Ftd>\u003Ctd>\u003Cimg src=\"screenshots\u002Fsmart-inpaint-after.png\" width=\"400\" alt=\"Smart Inpaint after\">\u003C\u002Ftd>\u003C\u002Ftr>\n\u003C\u002Ftable>\n\n### Smart Guided Inpaint — placement by words, not boxes\n\nThe same edit-model plumbing as Smart Inpaint, but the spatial \"where\" comes from a dropdown + prompt phrasing instead of a drawn region. There's no mask at all — the whole image is edited, with `reference_latents` keeping the rest faithful and the location prefix telling the model where to put the new content.\n\n1. **Inpaint Mode: Smart Guided Inpaint**\n2. Pick a **Location** from the dropdown above the Area Prompt box (corners, middles, center, edges, halves, top\u002Fbottom)\n3. Type what to add in the **Area Prompt** box\n4. Press **Generate Guided Edit**\n\nExample — Location `Right edge`, prompt `\"A sheep jumping up and down\"`, hit Generate Guided Edit:\n\n\u003Ctable>\n\u003Ctr>\u003Ctd align=\"center\">\u003Cb>Before\u003C\u002Fb> (location + prompt)\u003C\u002Ftd>\u003Ctd align=\"center\">\u003Cb>After\u003C\u002Fb>\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>\u003Cimg src=\"screenshots\u002Fsmart-guided-before.png\" width=\"400\" alt=\"Smart Guided before\">\u003C\u002Ftd>\u003Ctd>\u003Cimg src=\"screenshots\u002Fsmart-guided-after.png\" width=\"400\" alt=\"Smart Guided after\">\u003C\u002Ftd>\u003C\u002Ftr>\n\u003C\u002Ftable>\n\nHonest expectations: text-based placement is fuzzy by nature. Coarse regions (\"top half\", \"bottom of the image\", \"center\") land most reliably; fine ones are looser. FLUX 2 Klein and Qwen-Image-Edit honor these phrases well in practice. Use Smart Inpaint when you need *precise* placement, Smart Guided when you want a *quick, no-draw* edit.\n\n**Insert Smart Phrasing** (a button under the Area Prompt box, shown in both Smart modes) opens a popup of edit-preservation constraints — *keep the lighting \u002F pose \u002F clothes \u002F faces the same* — and appends the ticked ones to your Area Prompt. Handy for keeping the rest of the subject stable while changing one thing.\n\n\u003Ctable>\n\u003Ctr>\u003Ctd align=\"center\">\u003Cb>Tick the constraints\u003C\u002Fb>\u003C\u002Ftd>\u003Ctd align=\"center\">\u003Cb>Appended to the Area Prompt\u003C\u002Fb>\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>\u003Cimg src=\"screenshots\u002Fsmart-phrasing-popup.png\" width=\"400\" alt=\"Insert Smart Phrasing popup\">\u003C\u002Ftd>\u003Ctd>\u003Cimg src=\"screenshots\u002Fsmart-phrasing-applied.png\" width=\"400\" alt=\"Smart Phrasing appended to prompt\">\u003C\u002Ftd>\u003C\u002Ftr>\n\u003C\u002Ftable>\n\n…and the run (Location `Left edge`, *\"a magical glowing whole in the ground, Keep the lighting the same\"*) puts the glow on the left while leaving the rest of the scene intact:\n\n![Smart Guided Inpaint — glow placed on the left edge](screenshots\u002Fsmart-guided-left-edge.png)\n\n## Detect — auto-segment with SAM 3 (optional)\n\nInstead of painting or dragging a region, let **SAM 3** find it for you by *describing* it. In **Refine** or **Smart Inpaint**, a **🔍 Detect** row appears in the toolbar:\n\n- **Type a concept** — \"the face\", \"the red car\", \"her left hand\" — and hit **Detect**; or\n- Use the **Quick Detect…** dropdown of common subjects, grouped into People \u002F Body \u002F Clothing \u002F Animals \u002F Scene \u002F Objects (face, hands, hair, clothing, sky, car, …). Picking one runs immediately and doesn't touch the text box.\n\nAngelo highlights every match on the preview and you enter **detect mode** — nothing changes until you click. **Click a highlight** to edit that object; the others stay up so you can **work through each one in turn** without re-detecting. Edited candidates turn **green** (so you can track progress), the hovered one is **yellow**.\n\nPer mode, the confirmed detection becomes:\n- **Refine** → the exact **silhouette** mask (a latent-space inpaint — see below).\n- **Smart Inpaint** → the detection's **bounding box** as the rectangle.\n- **Smart Guided Inpaint** → Detect is hidden (no mask there).\n\nYour **Area Prompt** applies to whatever candidate you click (toggle it on in Refine; it's forced on in Smart Inpaint) — so you can detect \"person\", set a prompt, and apply it to each one in turn.\n\n**Detect-mode controls** — a floating panel pins to the top-right (beside the Mode switch) while candidates are up:\n- **✕ Cancel Detect**, **Esc**, or **Space** leaves detect mode. Empty-space clicks do *nothing*, so you can't accidentally drop out mid-batch.\n- A **highlight-opacity slider** — drag it down to fade the overlays and inspect the edges of what you just generated; candidates stay clickable, and it resets to full when you exit.\n- **Conf** (in the Detect row) tunes the match threshold (≈0.2–0.3 finds more \u002F fainter matches).\n\n**Tidying up a detection.** SAM is usually close but not perfect — two tools fix it without re-detecting:\n- **Mask `[−] \u002F [+]`** (after the Quick Detect dropdown) grows or shrinks **every** detected mask together, 2px at a time — handy when a silhouette is a touch tight or loose all over. The number shows the current offset; it resets on each new detect.\n- **Touch-up brush (Refine only).** Hold **Shift** and drag on the preview to **add** to the mask you start over (e.g. pull in a missed chunk of hair); hold **Alt** and drag to **subtract** — including punching a hole right in the middle. The brush size is your **Click R**, with a live green (add) \u002F red (subtract) preview, and it works whether or not Paint Mode is on. Then click the candidate to apply the edited shape. (Brushing freezes that candidate's shape, so do any +\u002F− grow first.)\n\n**While it works** a *\"Loading SAM 3…\"* overlay covers the preview — the **first** Detect of a session builds and caches the model (several seconds), so this is just busy feedback rather than a frozen-looking canvas. It clears itself the moment results come back; if a request ever hangs, a **✕** on the overlay closes it manually. Anything you need to read or act on — *no matches*, a bad query, or the *SAM 3 not installed* prompt — shows as a persistent in-app message bar you dismiss yourself, never a toast that flashes past.\n\n**It runs in latent space.** In standard **Refine** (Xtra-Fine off), the edit is a pure latent-space noise-mask inpaint — everything outside the silhouette stays bit-exact, with no VAE round-trip. SAM 3 runs on the decoded preview only to *produce* the shape, which is rasterised down into a latent mask. (Xtra-Fine and Smart Inpaint deliberately use the pixel-space VAE round-trip, as elsewhere.)\n\n### Enabling it (one-time, optional)\n\nDetect needs Meta's **SAM 3**, which isn't on PyPI — so it's **opt-in** and not installed with the node (Angelo's core stays dependency-free). To enable it:\n\n1. **Close ComfyUI.**\n2. Run the installer in the `ComfyUI-Angelo` folder:\n   - **Windows:** `install_sam3_support.bat`\n   - **macOS \u002F Linux:** `install_sam3_support.sh`  (`bash install_sam3_support.sh`)\n3. **Start ComfyUI again.**\n\nThe script installs SAM 3 + its dependencies into the *same* Python ComfyUI uses (it reads the interpreter path Angelo records on startup, so it works for portable, venv, or conda installs). The **SAM 3 weights (`sam3.pt`, ~GB) download automatically on first Detect** from a public mirror — no Hugging Face token needed. If `sam3` isn't installed, the Detect button just tells you to run the script; everything else in Angelo keeps working.\n\n## Area Prompt (refine with a different prompt)\n\nConnect a `CLIP` (the same one feeding your main positive\u002Fnegative). Toggle **Area Prompt** on — a text box appears between the toolbar and the canvas. Type a prompt; refines encode it with the CLIP and use it instead of the main prompt. Toggle off → the box hides and refines revert to the main prompt. Hiding the box never loses what you typed (it lives in the node and reloads), and the cached image persists across the toggle.\n\n**While Area Prompt is on, the refine uses the Area text _exclusively_ and never falls back to the main prompt — even when the Area text is left empty (empty = an empty positive prompt).** This matters for the Smart edit modes: the main positive can carry a whole-image `reference_latents` (e.g. a Klein edit workflow's ReferenceLatent), and letting it leak in made an empty-Area-Prompt Smart Inpaint reproduce the entire scene into the region instead of editing just it.\n\nThe box has a **Pos\u002FNeg** toggle that switches which prompt you're editing. Negative is optional and falls back to the main negative when empty (matters only for CFG > 1; ignored at CFG=1 \u002F distilled models like Klein — which is why it's tucked behind a toggle rather than a second always-visible box).\n\nBoth Smart modes force Area Prompt ON (it's the whole point there), and add an **Insert Smart Phrasing** button for the *keep X the same* constraints. Smart Guided Inpaint also adds the **Location** dropdown directly above the box.\n\nRecommended: use `denoise=0.7-0.9` for area-prompt refines in **Refine** mode. Lower values won't give the new prompt room to take effect against an image generated with a different prompt. (Both Smart modes lock denoise=1.0 since they're regenerating from scratch.)\n\n## Navigating the preview (zoom & pan)\n\nThe preview fits the node by default, but you can zoom in to work on fine detail:\n\n| Action | Does |\n|---|---|\n| **Mouse wheel** | Zoom in \u002F out, centered on the cursor (0.25×–8×) |\n| **Middle-mouse hold + drag** | Pan around |\n| **Double middle-click**, or **F** (cursor over node) | Reset back to fit |\n\nWhen you zoom in (>1×), a small **minimap** appears in the bottom-right corner showing the whole image with a marker for your current viewport. Click-to-refine, paint, and rectangle-drag all keep working while zoomed — clicks land on the correct image pixel at any zoom — so you can zoom into a face, click to refine, and stay zoomed for the next click.\n\nWhile you're zoomed or panned, the **auto-fit is suspended** so resizing the node won't snap your view back. A genuinely new image (or double-click reset) returns to fit; refining the *same* image keeps your zoom.\n\n## Keyboard shortcuts\n\nWhen the cursor is hovering the preview canvas AND you're in Edit Mode, these keys adjust the matching toolbar values directly:\n\n| Keys | Adjusts | Step | Convention |\n|---|---|---|---|\n| `[` \u002F `]` | Click R | 4 px | Universal brush-size (Photoshop, Krita, Procreate) |\n| `{` \u002F `}` (shift+brackets) | Feather | 4 px | Photoshop brush hardness\u002Fsoftness |\n| `,` \u002F `.` | Denoise | 0.05 | `\u003C` \u002F `>` ordering on the same keys |\n\nThe hover ring on the canvas updates live as you press `[` \u002F `]`, so you can size the brush against the actual image content. Shortcuts only fire while the cursor is on the canvas; move to the toolbar and they revert to ComfyUI's normal keybindings.\n\n## Tips\n\n- **Default denoise (0.5) is for in-place touch-ups.** Bump to 0.85+ when you want a clear redo of the region (mandatory for Area Prompt; helpful for Xtra-Fine). Both Smart modes lock it to 1.0.\n- **Click R + Feather scaling.** Feather ≈ `Click R \u002F 4` works well as a starting point.\n- **The preview always fits the node** (until you zoom). Resize the node and the image scales to fit (letterboxed), so a portrait image no longer forces a giant tall node. Wheel-zoom + middle-drag to inspect detail — see \"Navigating the preview\".\n- **Lanczos is the default for Method.** For smooth content (faces, skin), try bilinear too — sometimes preferable on very soft subjects.\n- **The refine controls grey out in Sampler Mode** (and the base-gen seed row greys in Edit Mode) so you can see at a glance which mode you're in.\n- **Lock-on-fixed seed semantics.** Switching to `fixed` always also restores the seed widget to the value Python actually used at the last run — so \"fixed\" always means \"the seed that produced the current canvas\".\n- **`Reset` discards undo history too.** Hit Undo first if you just want to roll back one refine.\n\n## Honest limits\n\n- **In-process state.** Refinements live in the running ComfyUI process. Restart = cache cleared. Workflow JSON saves widget values but not the cached refined latent.\n- **VAE round-trip cost in Xtra-Fine.** ~1.5-2 seconds per click on a 5090 for FLUX 2 Klein. Trade-off for the resolution boost; OFF mode stays fast.\n- **Crop+upscale is bounded by the model's training distribution.** Very small painted regions even at 8× upscale won't suddenly look like trained-resolution content. Paint wider so the crop carries more surrounding context.\n- **One Angelo node per ComfyUI instance is sensible.** Multiple parallel Angelo nodes would share the global queue hook and may interact in surprising ways under Persistent Mask.\n- **No multi-user safety.** Don't use this on a shared ComfyUI server expecting per-user state isolation.\n\n## Compatibility\n\n- **ComfyUI:** any reasonably modern version (the JS uses standard ComfyUI extension APIs).\n- **Models:** any sampler-compatible model. Defaults are tuned for FLUX 2 Klein 9B distilled, but works with FLUX 1, FLUX 2 Dev, SDXL, SD 1.5, etc. — change `steps` \u002F `cfg` \u002F `sampler_name` \u002F `scheduler` to match your model.\n- **VAE:** FLUX 2 (16× downscale), FLUX 1 \u002F SDXL \u002F SD 1.5 (8× downscale) handled automatically. Exotic VAEs may need a small code change.\n- **GPU:** any CUDA GPU that runs your base model. Angelo adds minimal overhead.\n\n## Credits + contact\n\nBuilt by Peter Neill ([shootthesound](https:\u002F\u002Fgithub.com\u002Fshootthesound)).\n\nBug reports, feature requests, and \"this changed how I work\" stories all welcome via GitHub issues.\n\nIf Angelo saves you time, you can support development here:\n\n\u003Ca href=\"https:\u002F\u002Fbuymeacoffee.com\u002Florasandlenses\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FBuy%20me%20a%20coffee-FFDD00?style=for-the-badge&logo=buy-me-a-coffee&logoColor=black\" alt=\"Buy Me A Coffee\">\u003C\u002Fa>\n\n## License\n\nMIT.\n","Angelo 是一个为 ComfyUI 设计的点击优化采样器节点，支持生成图像后通过点击、绘制或拖动来精细化特定区域。其核心功能包括单节点替代传统的 KSampler 及后续处理链，能够与 FLUX 2 Klein 9B 和 Qwen-Image-Edit 等模型无缝集成，并兼容其他采样器兼容模型。用户只需点击需要改进的区域即可局部优化，而无需重新生成整个图像。此外，它还支持直接加载和编辑现有图片，简化了图像编辑流程。适用于需要快速且精确地进行图像局部调整或整体编辑的场景，如艺术创作、设计预览等。","2026-06-11 03:59:32","CREATED_QUERY"]