Beeble Export Mask Test
The node that shows you the exact mask Beeble will receive
- mask
- mask_image
- debug_json
Here's a quiet little node that makes no network calls at all. Beeble Export Mask Test takes a MASK from your graph, saves it as a grayscale PNG, loads it back, and hands it to you as an IMAGE so you can actually look at it. That's the entire trick - and it's more useful than it sounds.
In this pack, masks are how you tell Beeble what to keep when you use the select or custom alpha modes: the mask gets exported to a grayscale PNG and uploaded as the alpha matte. The production Beeble SwitchX Image node does that export internally with the exact same function (save_mask_as_grayscale_png). So this test node is your way to preview, frame by frame, precisely what the production node is about to send Beeble - before you spend a credit on a generation that selects the wrong thing.
How it works
The MASK tensor is converted to an 8-bit L (grayscale) PNG: values clamp to [0,1], scale to 0–255, and the first item of a batched mask is used, same MVP behavior as the rest of the pack. The invert toggle flips the matte (1 - mask) before saving - handy because white = keep in most workflows, and your mask node may hand you the opposite. The saved file is then read back as a standard IMAGE tensor so it shows up in preview and save nodes like any picture.
Because it's local-only, it works with zero configuration: no BEEBLE_API_KEY, no internet, no cost. It's also a genuinely handy general utility for sanity-checking any mask pipeline, not just Beeble ones.
Inputs and outputs
- mask (MASK) - required. The matte to export.
- invert (BOOLEAN, default false) - flip the matte before saving.
- mask_image (IMAGE) - the grayscale PNG loaded back as an image. Wire this to a Preview or Save node.
- debug_json (STRING) - the temp file path and whether inversion was applied.
Installing
cd ComfyUI/custom_nodes
git clone https://github.com/albert999-pixel/comfyui-beeble-switchx.git
Or search Beeble in ComfyUI Manager, then restart. That's it for this node - the pack's requirements.txt is empty and there's nothing to download.
Common issues
- "Saving MASK to PNG requires torch, numpy, and Pillow" - this is a plain ComfyUI environment; you already have these. If you somehow stripped Pillow, the node says exactly that.
- "MASK batch is empty" - you fed it a zero-frame mask; grab the frame you actually want first.
- Result looks inverted from what you expected - that's the invert toggle, not a bug. Toggle it and compare.
Use it as a cheap pre-flight check: whatever mask_image shows you is what the alpha pipeline will send Beeble, so make it look right here before you queue a paid job.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| mask | MASK | — | |
| invert | BOOLEAN | false | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| mask_image | IMAGE | — |
| debug_json | STRING | — |