Load Mask (Base64)
Load Mask (Base64)
- mask
Load Mask (Base64) solves a plumbing problem you only hit when you're driving ComfyUI from outside - from a script, an app, or a plugin rather than the web UI. Normally ComfyUI exchanges images through the filesystem: you upload a file, reference it by name, and hope it gets cleaned up eventually. That's a whole multi-step dance with its own class of "where did my file go" bugs. This node lets you skip it by embedding the mask directly into the prompt as a base64 string. No upload endpoint, no temp file, no cleanup question - the data travels inside the workflow JSON itself.
It's the mask-shaped sibling of Load Image (Base64). Same idea, single channel out. This whole pack is built around the premise of using ComfyUI as a backend for external tools, and the base64 loaders are the most literal expression of that - they're how a program hands ComfyUI an image without touching disk. That's also why you'll rarely see this node in a graph you built by clicking around the editor; there's no field to paint or upload a mask into by hand. It's meant to be filled in programmatically, where whatever code is assembling the prompt drops the encoded string into the input.
The mechanism is straightforward: you pass in the base64-encoded bytes of a PNG, and the node decodes it and returns the first channel as a mask. The README notes JPEG and other formats generally work too for the image loaders, but for a mask you want a clean single-channel PNG - that's the intended path.
Inputs and outputs are exactly one each:
- mask (STRING) - the base64 text of your PNG's binary data. It's a plain string field, so a human could paste one in, but in practice a calling program fills it.
- mask (MASK) - the decoded mask, ready to wire into an inpaint node, a Set Latent Noise Mask, a region, or anything else that eats a MASK.
Installing it comes with the pack. Search "ComfyUI Nodes for External Tooling" in ComfyUI Manager, or from your ComfyUI directory run cd custom_nodes && git clone https://github.com/Acly/comfyui-tooling-nodes.git and restart. No dependencies, no models - it's a decode-and-hand-off node.
Troubleshooting is mostly about what you feed it. The input is the base64 of the raw PNG bytes - not a data URL. If you paste in a full data:image/png;base64,... string, strip the data:..., prefix first; the node wants the payload only. A truncated or malformed string will fail to decode, and since it takes only the first channel, make sure the channel you care about actually is the first one - a mask saved with its content in the alpha channel of an otherwise-black PNG isn't what this reads. If your mask comes out empty or inverted, that channel mismatch is the first thing to check.
Honestly, if you're building workflows by hand in a browser, this probably isn't your node - you'd use Load Image or a mask editor instead. Its audience is people wiring ComfyUI into their own software, where avoiding the filesystem round-trip removes a genuine source of flakiness. For that audience it's small, boring, and exactly right. And it's worth knowing the pack's pedigree: Acly is the author behind the Krita AI Diffusion plugin, and nodes like this are the kind of quiet backend glue that lets an external app treat ComfyUI as an image engine it can just talk to.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| mask | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| mask | MASK | — |