Get Boolean from Image
Pull a true/false straight out of an image's metadata
- image
- BOOLEAN
Ever want a workflow to behave differently depending on which image you dropped into it? That's the whole job of Get Boolean from Image. It's one of the eight metadata-reading nodes in shinich39's comfyui-get-meta pack, and it's the one that turns an image into a conditional: true if the thing you queried was on, false if it was off.
The name is a small lie, and it's worth knowing upfront. Nothing here reads image pixels. ComfyUI stuffs a full copy of the graph that made an image into the file itself - the prompt and workflow JSON live in the PNG's text chunks (or the EXIF of a WebP, if it was saved by A1111/Forge). This node reads that metadata, not the picture. The file is basically a tiny database keyed by node and widget, and Get Boolean from Image is your query.
How it works
The Python class is a stub that just echoes a widget back. The real work happens in the browser: the pack's frontend extension traces the image loader wired into the image input, POSTs the file's path to a local endpoint (/shinich39/comfyui-get-meta/read-metadata), Pillow opens the file and returns the embedded metadata, and JavaScript parses the stored JSON, finds the widget your query asks for, and writes Boolean(value) into the boolean widget. When you queue a run the node re-executes every time - the author hardcodes IS_CHANGED to always-true - so whatever it just pulled actually flows downstream.
The extraction happens when the graph connection changes or when a prompt is queued. It's not continuous magic; it's "look, then run."
The inputs and output that matter
Three inputs, and you only really set one:
- image - wire this from a supported loader: core
LoadImageorLoadImageMask, or the metadata-aware loaders from Inspire Pack, Crystools, or WAS Node Suite. - query - the interesting one. Point at a boolean widget in the saved graph, like
#5.add_noiseorKSampler.add_noise. The#prefix means node ID; you can also match by node type, title, orNODE_TYPE[NODE_INDEX]. - boolean - the result lands here (default
False). Leave it alone; a fresh run overwrites whatever you typed.
The single output, BOOLEAN, wires into any toggle: switch nodes, bypass/mute logic, conditioning on/off, a boolean that picks between two branches.
Installing it
ComfyUI Manager → search comfyui-get-meta → Install, then restart. Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/shinich39/comfyui-get-meta
Then restart ComfyUI. That's the whole install - no models to download, no requirements.txt, nothing but Pillow (which ComfyUI already requires) and a bundled JSON5 parser. Refreshingly light for a custom node.
Where people get burned
- No metadata, no value. If the image was saved with a "without metadata" node, re-uploaded through a web app, or is a screenshot, the widget stays at
False. This is the #1 trap and it's not the node's fault - the metadata simply isn't in the file. - Wrong loader. Wire from an unsupported loader (a VHS frame, a URL fetcher, a folder batch) and there's no file path to read, so nothing fills.
- It's frontend-driven. In a pure headless API run, nothing auto-fills the widget. This is a tool for the UI, full stop.
Honest take: this is a niche node in a niche pack. You reach for it when you're automating or building conditionals around existing images - if you're not doing that, you won't miss it. But when you need a binary decision based on what made a picture, it's the cleanest way to get one.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| query | STRING | — | |
| boolean | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| BOOLEAN | BOOLEAN | — |