LC Character Detailer (pipe) (BETA) π©Ή
Chaining Character Detailers Through the LC Pipe
- pipe
- image
- model
- vae
- positive
- inpaint_positive
- negative
- elements
- pipe
- image
- mask
What it is
Identical to LC Character Detailer - SAM 3 finds every match, exactly one gets redrawn - except you don't hand it a model, a VAE, a picture and a sampler every time. You hand it a pipe.
That matters at four characters. The plain node needs four copies of image β model β VAE β positive β sampler settings wired in, plus a "which one did I update?" problem. The pipe version takes one LC_PIPE wire already carrying picture, model, VAE, prompts and sampler settings, redraws its one character, and hands a pipe back. Chain four and you've wired four nodes to nothing but each other.
How it works
The finding and redraw code is the same as the plain node: each word gets up to 16 instances, masks are measured by centre and area, pick/number select one, extra words join only when most of their mask sits inside the picked one's box. Then crop with padding, scale to inpaint_resolution, redraw, paste back.
The difference is bookkeeping. It reads picture, model, VAE and prompts out of the pipe unless something is wired on the node, in which case the wire wins - that's how you override one character's model (their LoRA branch) while everything else inherits. It writes two things back:
- Every area any detailer has redrawn so far, merged. LC VOSR2 Upscale (pipe) later carries that to the new size as its
protectedoutput, so your skin nodes don't add texture on top of work the detailers already did. - What SAM 3 found. So the next detailer in the chain doesn't re-run detection for the same word.
Both are tagged with a checksum of the picture they were made for and ignored if the image changed - so a node mid-chain that alters the picture can't feed you stale masks.
One deliberate quirk: cfg is this node's own widget, not the pipe's. The pipe's cfg_1 is usually your main sampler's, and reusing that made redraws come out drastic, so the pipe version dropped it. It defaults to 1 and won't go below - below 1 the redraw gets speckled.
The inputs worth setting
Same knobs as the plain node, minus the sampler plumbing. Required and load-bearing:
pipe (from LC Pipe In / LC Pipe Edit in the companion LC123 pack - the node's own error message says so), prompt, sam3_model, threshold (0.5 is the sane start; lower finds more and more wrong things), pick and number, denoise (0.3 for faces).
Optional: image (only when a node outside the pipe changed the picture), model, vae, positive, inpaint_positive (a short crop-only prompt whenever positive describes the whole scene), negative (empty for cfg-1 models), tone_match (leave on unless the redraw is meant to change colour), elements (LC Bounding Boxes, for pick: in box).
Outputs are pipe, image and mask: the pipe to the next detailer or LC VOSR2 Upscale (pipe), the image and mask for this character's pass alone.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/lonecatone23/ComfyUI_LC_MaskMaker_nodes
# restart ComfyUI
Or search ComfyUI_LC_MaskMaker_nodes in ComfyUI Manager. The installer only tops up transformers and huggingface_hub when missing - no heavy dependency story. You need a ComfyUI build with built-in SAM 3 support (comfy_extras.nodes_sam3); older builds say so explicitly. First run downloads the SAM 3.1 checkpoint (1.7 GB) to models/sam3, shared across every SAM 3 node in the pack, so the second detailer in your chain is free.
If you run more than one ComfyUI install, point them all at one model folder in extra_model_paths.yaml - the pack reads a sam3 key there.
Common issues
"The pipe has no model, vae" or "No image: wire one". Your pipe is incomplete. LC Pipe In is what fills it.
The second detailer redraws a different face than expected. Check pick and number on each node. With left to right, character A is 1 and B is 2 - and the moment someone swaps sides, so does your numbering. pick: in box with wired boxes is the fix.
Every face comes back with the scene painted into it. Wire inpaint_positive. A full-composition prompt applied to a face-sized crop at denoise 0.3 and up is how you get a tiny whole scene inside a 200-pixel face.
The redraw changed the shirt colour you liked. tone_match on is what keeps a light redraw from coming back flat; turn it off only when you want new colours.
Note on scope: this is one character per node. "A detailer per character for however many people are in frame" is the Finder β Sorter β For Each chain in the same pack, which also gives each character its own seed.
Inputs (21)
| Name | Type | Default | Description |
|---|---|---|---|
| pipe | LC_PIPE | LC pipe: model, VAE, seed, steps, cfg, sampler and scheduler come from here. | |
| prompt | STRING | Face | What to detail, as simple words separated by commas: hands, face. Every match is found (both hands, every face). Add :N to cap it, e.g. face:1. |
| sam3_model | COMBO | SAM 3 model that does the finding. Pick the SAM 3.1 download, or use your own sam3.pt / sam3.safetensors in models/sam3. | |
| threshold | FLOAT | 0.500.05β0.95 | How sure SAM 3 has to be. Lower finds more (and more wrong things), higher is pickier. 0.5 is a good start. Colors are only a hint: 'red dress' can still pick a green dress. Things that are not there are not found. |
| pick | COMBO | left to right | Which match this detailer redraws (SAM 3 finds them all). With several words (face, hair) the first one picks the person and the others come along when they belong to them. left to right / right to left / top to bottom: number 1 = the first one that way. largest first: number 1 = the biggest. in box: the one inside box 'number' of LC Bounding Boxes (wire its elements): the face stays with its character even when the pose changes. |
| number | INT | 11β32 | Which one: 1 = the first. With pick on in box, the box's number as shown on LC Bounding Boxes. |
| grow | FLOAT | 4.0-64β256 | Pixels to grow (positive) or shrink (negative) the mask before inpainting. Growing a little covers the edges. |
| feather | FLOAT | 8.00β128 | Softness of the mask edge in pixels, so the redrawn area blends into the rest. 0 = hard edge. |
| blend | FLOAT | 0.800β1 | How much of the redraw is pasted in: 1 = all of it. Below 1 the old and new pixels are mixed, and features the redraw moved a little (lashes, eyelids) can show twice. For a lighter redraw, lower denoise instead. |
| padding | INT | 640β1024 | Pixels of the surrounding image included with each crop, so the model sees the context. |
| inpaint_resolution | INT | 1024256β4096 | Each crop is redrawn at about this many pixels squared (1024 = 1 megapixel), whatever its shape. Higher = more detail, slower. |
| denoise | FLOAT | 0.300β1 | How much is redrawn. Low keeps the shape and fixes details, high redraws from scratch. |
| imageopt | IMAGE | Optional. Empty = the pipe's image. Wire one when a node without a pipe changed the picture in between. | |
| modelopt | MODEL | Optional. Wire a model here to use it instead of the pipe's (with LoRAs on it, or a different model). | |
| vaeopt | VAE | Optional. Wire a VAE here to use it instead of the pipe's. | |
| positiveopt | CONDITIONING | The image's prompt. A prompt describing the whole scene can get drawn into every crop at denoise 0.3 and up (a whole tiny scene in the face): wire inpaint_positive to prevent that. | |
| inpaint_positiveopt | CONDITIONING | Optional. A prompt for the crops only, e.g. 'close-up of a woman's face, natural skin'. Used instead of positive for the redraw. Recommended whenever positive describes the whole scene. | |
| negativeopt | CONDITIONING | Optional. Leave empty for cfg 1 models; wire it for SDXL and other models that use a negative. | |
| tone_matchopt | BOOLEAN | true | On: the redraw gets the original's brightness, contrast and colour back where it is pasted, keeping the new detail. A light redraw comes back a little flat and dull without it. Turn off when the redraw is meant to change colours (a new shirt colour, a different object). |
| cfgopt | FLOAT | 1.01β30 | CFG for the redraw. 1 works for Krea 2, Flux, Z-Image and, at detailer denoise (up to about 0.4), SDXL too (tested: SDXL looked the same at cfg 1 to 7). Used instead of the pipe's cfg_1, which is usually the main sampler's. |
| elementsopt | ARRAY | LC Bounding Boxes' elements, for pick = in box. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| pipe | LC_PIPE | β |
| image | IMAGE | β |
| mask | MASK | β |