Attention Region Mask
A mask of what the model was actually looking at
- latent
- latent
- mask
Most masks come from detectors or your own brush. This one comes from somewhere stranger: the cross-attention maps of the sampler that already made your image. Give it a latent from a past generation pass and a concept like hair, and it returns a soft mask of the pixels that model actually associated with "hair" while denoising. No GroundingDINO, no SAM, no drawing. If the concept never rendered, the mask knows - because the attention was never there.
How it works
It belongs to SimpleSyrup's attention-capture family, and understanding one of them is understanding all of them. While the upstream sampler ran, the pack recorded which spatial regions attended to which prompt tokens (see Attention Capture Model for the plumbing). This node walks your graph backward from the connected latent, finds that sampler, reads the captured evidence for the concepts you asked about, and renders it into a mask.
Two things to notice about the output. It's a soft, latent-resolution mask - the union of every matched region, with alpha shaped by the matte_solidity and edge_feather controls. And the latent input passes through unchanged, so you can insert this node into a wire without rerouting anything.
Inputs that matter
concepts- the concept or concepts whose attention becomes the mask, separated by|. Default issubject. These should match words that actually appear in the positive prompt of the sampler that made the image.girl | pink hair | catis the shape the tooltips use.sampler_stage- which sampler in the chain to read.1is the first,2the second,0or-1grabs the last. If your image came from a plain first pass, leave it at1.capture_start/capture_end- which slice of denoising counts as evidence. Later starts skip the initial composition phase; earlier ends ignore late refinement. The defaults (0 → 1) take everything, which is usually right.minimum_strength- the main quality knob. It's the minimum normalized attention retained per region; raise it to narrow the silhouette toward the concept's semantic core, lower it to keep its halo.
The rest of the knobs (minimum_consensus, geometry_recall, split_sensitivity, instance_recall, minimum_region_size, keep_only, keep_by, combine_segs, evidence_mode, capture_profile) are shared across the whole family and tuned well enough at defaults that beginners can ignore them. evidence_mode is the one worth knowing: default concept isolation gives a cleaner stable region, while raw attention shows the captured probabilities unprocessed.
What to do with it
The mask output is a plain MASK, so it feeds everything mask-based: a mask-blur before an img2img pass, a Set Mask for inpainting, conditioning a detailer, or as the "only this region" boundary for a regional sampler. Wire the latent passthrough straight through and put the mask where masks go. It's the cheapest route to a "refine only what the prompt controlled" mask you'll find.
Where people stumble
The big one is provenance: the latent has to trace back to the sampler in the same graph, unmodified by editing, cropping, or resampling between. The node resolves the sampler from the graph, and if it can't recover one you get nothing - no crash, just an empty result. Second, if a concept wasn't in the positive prompt, or the sampler never really attended to it, the region is empty or tiny; check your spelling and that the concept rendered. And keep expectations set: these are soft, latent-resolution silhouettes, not pixel-hairline mattes. That's a feature for conditioning work and a limitation for cutout work.
It ships in SimpleSyrup - Manager search SimpleSyrup, or clone into custom_nodes and install requirements.txt. No model downloads for this node; the pack's heavier dependencies (Ultralytics, ONNX, SAM) serve its detector nodes, not this one.
Inputs (18)
| Name | Type | Default | Description |
|---|---|---|---|
| latent | LATENT | Latent whose graph provenance identifies the upstream sampler; the latent is returned unchanged. | |
| concepts | STRING | subject | Concepts whose attention becomes the mask, separated by |. |
| sampler_stage | INT | 1-1–1024 | Selects the connected sampling stage: 1 is first, 2 is second, and 0 or -1 selects the last; oversized values use the last. |
| capture_start | FLOAT | 0.000–0.99 | Start of denoising evidence to include; later values ignore more of the initial composition phase. |
| capture_end | FLOAT | 1.000.01–1 | End of denoising evidence to include; earlier values ignore more late refinement attention. |
| minimum_strength | FLOAT | 0.150–1 | Minimum normalized attention association retained in a region; higher values narrow the silhouette toward its semantic core. |
| minimum_consensus | FLOAT | 0.250–1 | Fraction of selected observations that must support a pixel; higher values keep more persistent regions. |
| geometry_recall | FLOAT | 0.850–1 | Higher values recover fainter connected object extent from exact attention, preserving tails and shafts but admitting more halos. |
| split_sensitivity | FLOAT | 0.000–1 | Sensitivity to divide one connected region around separate peaks; higher values can split a soft silhouette into multiple instances. |
| instance_recall | FLOAT | 0.650–1 | Higher values retain weaker disconnected instances relative to the strongest one, which helps repeated sparse concepts. |
| minimum_region_size | INT | 5121–1048576 | Discard attention components smaller than this many pixels. |
| keep_only | INT | 10–1024 | Keep the best N instances per concept; 1 keeps the largest and 0 keeps all. |
| keep_by | COMBO | largest size | Ranks retained instances by area or attention confidence. |
| combine_segs | BOOLEAN | false | Combines retained instances of each concept into one SEG. |
| matte_solidity | FLOAT | 0.750–1 | Higher values flatten accepted interiors toward fully opaque alpha. |
| edge_feather | INT | 80–4096 | Width in output pixels of the matte boundary transition. |
| capture_profile | COMBO | fast | Controls observation density: fast minimizes overhead, balanced adds temporal evidence, and exhaustive retains every eligible call. |
| evidence_mode | COMBO | concept isolation | Concept isolation derives a cleaner stable region; raw attention shows the captured model probabilities without isolation weighting. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| latent | LATENT | Unchanged connected latent. |
| mask | MASK | Soft latent-resolution union of matched regions. |