09 ZMongo Content Pack Get Selected
One node that pulls any field out of a content pack, whatever its type
- content_pack
- session
- string
- int
- float
- boolean
- image
- json
- selected_type
- found
The V3 Get family ships one node per type: Get String, Get Int, Get Float, Get Boolean, Get JSON, Get Image. Get Selected is the version that collapses all six into a single node. You tell it which type you're expecting and it activates the matching output socket, leaving the others idle. It's the node you reach for when a content pack is a grab-bag of different types and you don't want six separate Get nodes cluttering the canvas.
Why it works like this
ComfyUI backend schemas are fixed at registration time - a node can't grow a brand-new output type based on a runtime string. So this node exposes all seven supported output types up front (string, int, float, boolean, image, json) and activates the one matching your data_type selection. That's also why the extra selected_type output exists: it tells you which type the node actually resolved, so you don't wire the wrong socket and get confused later.
What you set
content_pack- the pack (from Build, Load, or any loader).field_alias- the alias of the field you want. Case-sensitive, and it also matches source paths, labels, or a numeric index if you don't remember the alias.data_type- the dropdown:STRING,INT,FLOAT,BOOLEAN,IMAGE,JSON, orANY.ANYskips type checking and returns the value coerced to the best-fit output.strict_type- when true (default), a field whose stored type doesn't match your selection is rejected andfoundgoes false. Turn it off for forgiving coercion - noteFLOATalso acceptsINTeither way, since the pack treats them as compatible.- Defaults -
default_string,default_int,default_float,default_boolean,default_jsonare what you get back if the field is missing or the type mismatches.
One wrinkle: image retrieval can require a session and master_key_hex when the stored image is an asset reference rather than inline base64 - that's why the optional session input is here even though string/int/float don't need it.
Outputs
The active output carries your value; found says whether it actually matched; selected_type reports the resolved type. If the pack was built normally with inline storage, this node is fully offline. It's the one Get node I'd start with if a pack has mixed content - you can read it as a STRING, discover selected_type, then lock in the right type.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| content_pack | ZMONGO_CONTENT_PACK | — | |
| field_alias | STRING | — | |
| data_type | COMBO | STRING | 7 options: STRING, INT, FLOAT, BOOLEAN, IMAGE, JSON, +1 |
| strict_type | BOOLEAN | true | — |
| sessionopt | ZMONGO_API_SESSION | — | |
| default_stringopt | STRING | — | |
| default_intopt | INT | 0-2147483648–2147483647 | — |
| default_floatopt | FLOAT | 0.00-1000000000000–1000000000000 | — |
| default_booleanopt | BOOLEAN | false | — |
| default_jsonopt | STRING | {} | — |
| master_key_hexopt | STRING | — |
Outputs (8)
| Name | Type | Description |
|---|---|---|
| string | STRING | — |
| int | INT | — |
| float | FLOAT | — |
| boolean | BOOLEAN | — |
| image | IMAGE | — |
| json | STRING | — |
| selected_type | STRING | — |
| found | BOOLEAN | — |