Nodes/ComfyUI-ZMongo/04 Display Image from ZMongo
ComfyUI Node

04 Display Image from ZMongo

Pull an image out of a ZMongo database document and preview it

By CentralFloridaAttorney·Created 5 months ago·Updated 2 months ago· 1
04 Display Image from ZMongo
  • session
  • image
  • status
  • json
collection_name
document_id
field_pathimage_data
master_key_hex
cachefalse
refresh_token

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 to image_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.

CategoryZMongo/04 Images

Inputs (7)

NameTypeDefaultDescription
sessionZMONGO_API_SESSION
collection_nameSTRING
document_idSTRING
field_pathSTRINGimage_data
master_key_hexoptSTRING
cacheoptBOOLEANfalse
refresh_tokenoptSTRING

Outputs (3)

NameTypeDescription
imageIMAGE
statusSTRING
jsonSTRING