Mask-Map Loader (HMN)
Turn one RGB bitmap into three attention masks
- Mask-Map
- Red (Center Piece)
- Green (Theme)
- Blue (Background)
Load Mask-Map is where Hellrunner's regional prompting starts. It opens a single RGB bitmap - a "mask-map" - and splits it into three smooth gradient masks: red, green and blue. Each becomes an attention region in your workflow. If you've fought with hard-edged binary masks that leave visible seams between prompt zones, the pitch here is gradients: smooth falloffs instead of cliffs, so regions blend instead of cutting. The author's usage guide for the system lives in a CivitAI article ("Hellrunner's Mask-Maps - Attention Masking") linked from the pack README, and the pack ships a Substance Designer file (GradiatorMaskMapper.sbsar, viewable in the free Substance Player) for generating your own.
The inputs that matter
- image - a dropdown of
.bmpfiles in your ComfyUIinputfolder, with an upload button. Only BMPs are listed, because that's the lossless-ish format the mask-maps are authored in. RGB, not RGBA. - Width / Height - both default to 0, meaning "use the source size." Set either above 0 and the map gets rescaled; set just one and the other is derived to keep aspect.
- upscale_method - which resampler to use when scaling (nearest-exact, bilinear, area, bicubic, lanczos). Lanczos is the default and is the right call for gradients - nearest would chew up your smooth falloffs into steps.
How it works
The maskIt function opens the bitmap, converts it to RGB, and pulls each channel out as a separate float mask scaled to 0–1. Each channel becomes a MASK tensor. Red is the "center piece", green the "theme", blue the "background" - that's the author's naming for how the layers stack. The whole thing is cached by file hash, so reloading the same map doesn't re-decode it. If you want a mask-map that covers 100% of the image with no dead zones, that's the design goal the tooltip calls out: gradient channels that sum to full prompt coverage.
Outputs and wiring
- Mask-Map (type MASKMAP) - the full RGB map, for nodes that want the whole thing.
- Red (Center Piece), Green (Theme), Blue (Background) - three MASK outputs you wire into anything that takes a mask.
The intended pipeline: Red/Green/Blue masks feed the mask input of Mojo Maker (or Mask-Map Prompt's strengths feed the text side), and the same map's regions become your prompt zones. A mask on its own does nothing; it needs a conditioning node that understands mask + mask_strength to become attention control.
Installing it
Same pack, one install. ComfyUI Manager → search "Hellrunner's Magical Nodes", or:
cd ComfyUI/custom_nodes
git clone https://github.com/Hellrunner2k/ComfyUI-HellrunnersMagicalNodes.git
Restart ComfyUI. No extra pip dependencies. The one "extra" is optional: if you want to author your own mask-maps, the .sbsar generator in the pack's MaskMappers/ folder needs Adobe Substance 3D Player (free) to open. You can also just download ready-made mask-maps from the pack's references.
Troubleshooting
- The dropdown is empty? You need a
.bmpinComfyUI/input/. The node deliberately lists only BMPs, so a PNG mask-map won't show up. - Scaled map looks stepped or banded? You're probably on nearest-exact. Switch to lanczos or bicubic - gradients are what this format is for.
- Nothing happens in the image even with masks wired? Check that the node downstream actually uses the mask (Mojo Maker's mask input with Mask_strength at 1.0) - a mask alone doesn't steer attention.
- Keep the source map RGB; an RGBA or indexed-color BMP can come back with unexpected channels.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | COMBO | RGB Mask-Map as bmp | |
| Widthopt | INT | 00–16384 | Width Override, >0 initializes scaling |
| Heightopt | INT | 00–16384 | Height Override, >0 initializes scaling |
| upscale_methodopt | COMBO | lanczos | Upscaling method to use if scaling |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| Mask-Map | MASKMAP | Mask-Map |
| Red (Center Piece) | MASK | Red Mask (Center Piece) |
| Green (Theme) | MASK | Green Mask (Theme) |
| Blue (Background) | MASK | Blue Mask (Background) |