09 ZMongo Content Pack Add Image
Stash a hero image inside a content pack — ZMongo 09 Content Pack Add Image
- content_pack
- image
- content_pack
- content_pack_json
- manifest_json
- preview_markdown
- aliases
- data_types
- indexed
- success
09 Content Pack Add Image is the node that stuffs a single generated image into a ZMongo content pack as a transportable asset. Content packs are the pack's bundling layer: a ZMONGO_CONTENT_PACK object that carries typed fields - text, numbers, images - so a whole generation "kit" can be moved around, saved to the database, and dropped back into a canvas later. This node is the "add one image" button for that bundle.
Concretely: you render an image, this node takes the IMAGE tensor, encodes it to an inline base64 PNG, and stores it in the content pack under a named alias - by default hero_image. The same content pack can accumulate many fields across many nodes, and when you save it (via the pack's Save Content Pack node) you get one portable record containing everything.
How it works
The node deep-copies your incoming content pack (creating a fresh one if you feed it nothing), encodes the image to a PNG data URI, and appends a typed field. The key inputs:
field_alias- the field name (defaulthero_image). This is how you address the image later.label- a human label (default "Hero Image").source_path- provenance metadata describing where the image came from in the graph (defaultload_image.image). Informational.storage_mode- currently a single choice,inline_base64_png, meaning the image lives inside the pack itself. No external file to lose.replace_existing- default true: writing to an existing alias replaces it instead of duplicating.
Outputs include the updated content_pack (chain it into the next pack node), plus content_pack_json, manifest_json, a preview_markdown you can render, the aliases and data_types lists, indexed preview text, and a success boolean.
The inputs and outputs that matter
content_pack- the bundle, required.image- theIMAGEtensor, required.field_alias- the name you'll use to retrieve it.
The content_pack output is what you chain forward; manifest_json is your at-a-glance field inventory; success gates the rest.
Install
Standard pack install:
cd ComfyUI/custom_nodes
git clone https://github.com/CentralFloridaAttorney/ComfyUI-ZMongo
cd ComfyUI-ZMongo
pip install -r requirements.txt
or ComfyUI Manager → "ComfyUI-ZMongo" → restart. This node needs no session and no model downloads - it's pure in-memory pack manipulation.
Troubleshooting
success: false- the image encode failed (the error shows inpreview_markdown). Usually an odd image tensor shape; feed it a normal LoadImage/SaveImage pipeline output.- Alias collisions - if
replace_existingis off and you reuse an alias, you get duplicate fields. Keep it on unless you're deliberately building multi-entry lists. - Huge
content_pack_json- inline base64 images are large. That's the cost of portability; if you're storing many large images, the pack gets big fast, and you may want the batch variant or a smaller image. - "No valid content pack" - you fed a non-pack object. Wire
content_packfrom another pack node or let the node bootstrap a fresh one by leaving it unconnected.
Add Image is the simplest of the Content Pack V3 family, and it's the right one when you want exactly one hero shot attached to a project record - think "this render + its prompt + its settings, all in one movable object."
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| content_pack | ZMONGO_CONTENT_PACK | — | |
| image | IMAGE | — | |
| field_alias | STRING | hero_image | — |
| label | STRING | Hero Image | — |
| source_path | STRING | load_image.image | — |
| storage_mode | COMBO | inline_base64_png | 1 options: inline_base64_png |
| replace_existing | BOOLEAN | true | — |
| refresh_tokenopt | STRING | — |
Outputs (8)
| Name | Type | Description |
|---|---|---|
| content_pack | ZMONGO_CONTENT_PACK | — |
| content_pack_json | STRING | — |
| manifest_json | STRING | — |
| preview_markdown | STRING | — |
| aliases | * | — |
| data_types | * | — |
| indexed | STRING | — |
| success | BOOLEAN | — |