09 ZMongo Content Pack Get Image
Rehydrate a stored image back into a real IMAGE tensor
- content_pack
- session
- image
- field_info_json
- found
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 defaultreferenceimage 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(aZMONGO_API_SESSION) so the node can callfetch_image_field, plusmaster_key_hexif 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.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| content_pack | ZMONGO_CONTENT_PACK | — | |
| field_alias | STRING | — | |
| strict_type | BOOLEAN | true | — |
| sessionopt | ZMONGO_API_SESSION | — | |
| master_key_hexopt | STRING | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| field_info_json | STRING | — |
| found | BOOLEAN | — |