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

09 ZMongo Content Pack Get Image

Rehydrate a stored image back into a real IMAGE tensor

By CentralFloridaAttorney·Created 5 months ago·Updated 2 months ago· 1
09 ZMongo Content Pack Get Image
  • content_pack
  • session
  • image
  • field_info_json
  • found
field_alias
strict_typetrue
master_key_hex

The Get family's odd one out. Strings, ints, floats and booleans are just values - but an image stored in a content pack is stored as data: inline base64, or a reference to an asset sitting in a database. Get Image is the node that turns that stored representation back into an actual IMAGE tensor you can wire into a VAE decode, a preview, or a ControlNet. It's how content packs earn the "asset store" half of their name.

How it works

Same lookup as the other getters - content_pack, field_alias, strict_type (default true) gating the type against a stored comfy_type of IMAGE. Then the decode depends on how the image was stored:

  • Inline base64 - the value itself carries the pixels as a data:image/... URI or base64 string. Decoded straight to a tensor, no session needed. This is what a Build produces with the default reference image policy when the source value is a data URI.
  • Asset reference - the field holds a pointer (collection + document id + field path) instead of pixels. Resolving it requires the optional session (a ZMONGO_API_SESSION) so the node can call fetch_image_field, plus master_key_hex if the stored asset is encrypted.

That optional session and master_key_hex pair is the tell: if your Get Image keeps failing with a message about needing a session, your image was stored as an asset reference, and you need to wire one in. Inline images need neither.

Outputs

image (IMAGE) is the tensor - feed it to a preview or anything that wants pixels. field_info_json is the field record. found says whether the alias resolved to an IMAGE field. On failure the node returns a 1x1 empty tensor rather than raising, so downstream nodes won't crash your graph - but check found and field_info_json before you trust the pixels, because an empty black 1x1 is easy to miss.

Practical notes

Keep an eye on image_policy when you Build. reference keeps inline images inline and treats dict-shaped image assets as references; copy_reference duplicates the reference; ignore drops images entirely - in which case Get Image will never find the field. If you want packs that rehydrate fully offline, make sure images are stored inline. If you're building packs that must be small, references are the trade - portability for the ability to share without shipping pixels.

CategoryZMongo/09 Content Packs/Get

Inputs (5)

NameTypeDefaultDescription
content_packZMONGO_CONTENT_PACK
field_aliasSTRING
strict_typeBOOLEANtrue
sessionoptZMONGO_API_SESSION
master_key_hexoptSTRING

Outputs (3)

NameTypeDescription
imageIMAGE
field_info_jsonSTRING
foundBOOLEAN