Preview Subject Mask
See what ExtractAttn actually locked onto
- latent
- subject
- mask
- latent
PreviewSubjectMask is a debug node, and for a pack this obscure, debug nodes are worth their weight in gold. Its whole job is to make the invisible visible: it pulls every foreground mask out of an ATTN subject cache and stacks them into one MASK you can actually look at. During ExtractAttn's reference pass, if you supplied an fg_condition_mask, the pack accumulates foreground-vs-background attention weights across the mask steps and stores a per-step fg_mask inside the attention data. This node is how you check that any of that actually happened, and whether the model's attention agrees with you about where the subject is.
How it works
subject (ATTN) is the cache from ExtractAttn. The node walks through every step entry in the cache, grabs anything stored under fg_mask, and concatenates them into a single mask tensor. It also takes a latent (LATENT) input and passes it straight through unchanged - the latent is just along for the ride so you can route it through the preview node without breaking your graph.
Outputs: mask (MASK) - the stacked foreground masks - and latent (LATENT), unchanged.
Why you'd actually use it
Two reasons. First, sanity-checking: run the reference pass, preview this node, and confirm the mask actually hugs your character. If it's garbage or empty, you want to know now, before you've built the whole ExtractAttn → GetCrossSim → GenConsistent chain on top of a bad mask. Second, debugging the classic silent failure: the node returns an empty tensor when the cache contains no fg_mask entries at all. That's the pack's way of telling you you never fed an fg_condition_mask into ExtractAttn, or that your mask_start_step/mask_end_step window never overlapped a real sampling step. No error, just nothing. Seeing empty here saves you an hour of wondering why the final image looks like a plain generation.
Install
Same as the rest of the pack: ComfyUI Manager → search "Comfyui_CharaConsist", or git clone https://github.com/thatname/Comfyui_CharaConsist.git into custom_nodes, restart, find it under chara_consist. No pip dependencies; Flux, Chroma, and Qwen-Image models only.
A couple of expectations to set. The mask it shows you is derived from attention weights, so it's fuzzier and less precise than a SAM segmentation - that's by design, it's the model telling you what it thinks the subject is, which is what the matching actually uses. And it's a debug view, not an output node - don't expect it to save anything. Pair it with MaskPreview to actually see the result, and treat a non-empty, subject-shaped mask as the green light that your reference pass is healthy. It's the closest thing this pack has to a status light, and you should wire it in on day one.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| latent | LATENT | — | |
| subject | ATTN | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| mask | MASK | — |
| latent | LATENT | — |