Get Dict Mask
Pull a mask out of a dict
- DICT
- default
- MASK
Get Dict Mask pulls a MASK back out of a DICT by name. Masks define where an operation applies - the region to inpaint, the area to composite into, the part of the frame to blur - and they tend to get reused across several nodes in a workflow. Stash one in the dict bag under a key and this node hands it back wherever it's needed, so the same mask drives an inpaint pass and a later paste without you forking a MASK wire across the whole graph.
Masks are a natural fit for the dict approach because a single mask often feeds multiple stages: detect a region once, then use that region for a detail pass, a color adjustment, and a final composite. Keep it named in the shared dict and each stage reads the same mask, which is exactly what you want when they all need to line up.
How it works
It's a typed Get Dict, so per the README it behaves like the plain Get Dict with an optional default and type validation. Ask for a key; if the dict holds a real mask there, out it comes. If the key's missing or the stored value isn't a mask, you get the default instead - no broken object reaches your compositor.
The inputs and outputs that matter
- key (required, text) - the name the mask was stored under. Match the Set Dict key exactly.
- DICT (required) - the bag to read from.
- default (optional) - a MASK to fall back on if the key is missing or the wrong type.
One output: MASK. Wire it into an inpaint sampler's mask input, a composite node, or this pack's Box Blur Mask to feather it.
Installing it
Pure Python, no weights, nothing heavy - quick install. ComfyUI Manager → Install Custom Nodes → search "antrobots ComfyUI Nodepack" → Install → restart, or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/antrobot1234/antrobots-comfyUI-nodepack
then restart. It's under antrobots-ComfyUI-nodepack/dicts/get.
Common issues
Object types like masks make the optional default worth setting. If the key isn't found and the default's empty, the fallback is effectively "no mask" - and depending on the downstream node that either errors or silently applies the operation to the whole image, which looks like the mask "didn't work." Guarantee the key exists or wire a real fallback mask.
Mask dimensions also need to match whatever they're applied to; retrieving the wrong mask through a key mix-up can show up as a size mismatch rather than an obvious miss. The standard dict rules apply throughout: DICT is required, keys are case-sensitive strings, and a typo quietly returns the default instead of erroring. Check the key on both ends first when a mask misbehaves. Solo pack; genuine bugs go to the GitHub issue tracker the author asks for.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| key | STRING | — | |
| DICT | DICT | — | |
| defaultopt | MASK | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MASK | MASK | — |