Nodes/ComfyUI-ZMongo/09 ZMongo Content Pack Get Selected
ComfyUI Node

09 ZMongo Content Pack Get Selected

One node that pulls any field out of a content pack, whatever its type

By CentralFloridaAttorney·Created 5 months ago·Updated 2 months ago· 1
09 ZMongo Content Pack Get Selected
  • content_pack
  • session
  • string
  • int
  • float
  • boolean
  • image
  • json
  • selected_type
  • found
field_alias
data_typeSTRING
strict_typetrue
default_string
default_int0
default_float0.00
default_booleanfalse
default_json{}
master_key_hex

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, or ANY. ANY skips 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 and found goes false. Turn it off for forgiving coercion - note FLOAT also accepts INT either way, since the pack treats them as compatible.
  • Defaults - default_string, default_int, default_float, default_boolean, default_json are 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.

CategoryZMongo/09 Content Packs/Get

Inputs (11)

NameTypeDefaultDescription
content_packZMONGO_CONTENT_PACK
field_aliasSTRING
data_typeCOMBOSTRING7 options: STRING, INT, FLOAT, BOOLEAN, IMAGE, JSON, +1
strict_typeBOOLEANtrue
sessionoptZMONGO_API_SESSION
default_stringoptSTRING
default_intoptINT0-2147483648–2147483647
default_floatoptFLOAT0.00-1000000000000–1000000000000
default_booleanoptBOOLEANfalse
default_jsonoptSTRING{}
master_key_hexoptSTRING

Outputs (8)

NameTypeDescription
stringSTRING
intINT
floatFLOAT
booleanBOOLEAN
imageIMAGE
jsonSTRING
selected_typeSTRING
foundBOOLEAN