04 Display Image from ZMongo
Pull an image out of a ZMongo database document and preview it
- session
- image
- status
- json
ComfyUI-ZMongo can store images inside database documents - that's the whole "asset store" promise. 04 Display Image from ZMongo is how you get one of those stored images back out and onto the canvas as a real IMAGE tensor. It's the reading half of the image pipeline: Save Image to Field writes pixels into a record, this node reads them back.
How it finds the image
You give it a session (from 00 API Key Session or 00 Local File Store Session), plus three coordinates:
collection_name- which collection holds the document (e.g.images).document_id- which document.field_path- where inside that document the image lives. Defaults toimage_data, which is the pack's convention for the image envelope.
Then it does the pragmatic thing: fetch the document, try to decode the exact field_path first, fall back to the legacy <field>.data shape, and finally try the backend's image route. master_key_hex is only needed if the stored image is encrypted; cache toggles whether the fetch result is cached; refresh_token is the standard force-rerun wiring.
The part worth knowing: it fails visibly
Instead of a misleading black frame or a hard crash, a failed lookup returns a white diagnostic image with the problem written on it, plus two text outputs to read: status (a one-line summary) and json (the full diagnostic payload). The payload includes the auth hint (base_url, username, key preview), which field paths were tried, whether a bytes envelope was found at a different path, and a list of "user checks" - like verifying the document actually holds an image, or that the session username owns the record. That diagnostic-first design is genuinely thoughtful: ImageNotFound becomes a readable message instead of a guessing game.
Outputs
image (IMAGE) wires into any preview node, VAE decode, or image consumer. status is the human summary - when it says "No ZMongo image found" plus coordinates, that's your debugging starting point. json is the full report for the serious cases.
Common issues
The most frequent miss is field_path: image_data points at the envelope, not at image_data.data - if the diagnostic says it found a bytes envelope at another path, type that path in. Second most common: the session's username doesn't own the document (check the auth hint). And remember this node talks to storage, so unlike the inline content-pack Get nodes it genuinely needs a working session - a missing session is reported as such in the diagnostic rather than silently failing.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| session | ZMONGO_API_SESSION | — | |
| collection_name | STRING | — | |
| document_id | STRING | — | |
| field_path | STRING | image_data | — |
| master_key_hexopt | STRING | — | |
| cacheopt | BOOLEAN | false | — |
| refresh_tokenopt | STRING | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| status | STRING | — |
| json | STRING | — |