Nodes/ComfyUI Prompt Control/AttentionMaskHookExperimental
ComfyUI Node

AttentionMaskHookExperimental

AttentionMaskHookExperimental — a raw attention-masking hook, explicitly for testing

By asagi4·Created 3 years ago·Updated about a month ago· 423
AttentionMaskHookExperimental
  • mask
  • HOOKS

Take the category and the name together - promptcontrol/_testing, and the node's own description says it outright: "Experimental attention masking hook. For testing only." This isn't a hedge, it's the pack author telling you plainly not to build a real workflow around it. It's here for completeness and for people specifically poking at Prompt Control's internals, not as a recommended regional-prompting path.

What it does

It takes a MASK and returns a HOOKS object - a raw hook, ComfyUI's built-in mechanism for attaching timestep- or region-conditional behavior to a model or clip, the same underlying system PCLazyLoraLoader uses for LoRA scheduling. Where the pack's documented masking path runs through PCAddMaskToCLIP and IMASK() inside your prompt text, this node exposes an alternate, lower-level route straight to a HOOKS object from a mask - presumably an early or in-progress implementation of attention masking that hasn't graduated to the documented, stable API yet.

Because it lives in _testing, treat anything about its exact behavior as unstable and subject to change without notice between pack versions - that's what the category is for.

Inputs and outputs

One required input, mask. One output, HOOKS.

Installing it

Ships with the rest of the pack:

cd ComfyUI/custom_nodes
git clone https://github.com/asagi4/comfyui-prompt-control

Or ComfyUI Manager, search "ComfyUI Prompt Control". No models to download.

The honest recommendation

Don't reach for this unless you're specifically experimenting with Prompt Control's internals or following the maintainer's own guidance in an issue thread. For actual regional prompting in a real workflow, use the documented path: attach masks with PCAddMaskToCLIP (or PCAddMaskToCLIPMany for several at once), reference them from your prompt text with IMASK(), and let PCTextEncode/PCLazyTextEncode handle the masking through the pack's stable, maintained implementation. If you're on Anima specifically, there's also a dedicated PCAnimaAttnCouplePatch model patch for that architecture's Attention Couple support - also experimental, but at least named and scoped to a specific use case rather than sitting in a bare testing bucket. Regional prompting in general is architecture-sensitive machinery that breaks on every base-model shift, and nodes still living in _testing are exactly where that instability shows up first.

It's also worth understanding why a pack like this ships a node like this at all, rather than only shipping finished features. Attention-region masking is genuinely hard to get right - the community's own hard-won lesson, learned across several rebuilds of this technique on different base models, is that masking the wrong layer (text tokens versus image tokens) produces different, equally real failure modes: mask the text side only and regions leak into each other; mask the image side and regions stop leaking but lose awareness of one another, producing uneven composition. A _testing node like this one is where that experimentation happens in the open, in public, before the pack author commits to one approach as the documented default. That's a reasonable way to build this kind of feature - just not a reason to treat an unfinished experiment as production-ready.

If you do go digging into it anyway, the zero-impression, zero-click numbers on this node are the honest tell: essentially nobody is finding or using it through search, which tracks with it being an internals-only node rather than something meant to be discovered independently.

Categorypromptcontrol/_testing

Inputs (1)

NameTypeDefaultDescription
maskMASK

Outputs (1)

NameTypeDescription
HOOKSHOOKS