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

09 ZMongo Content Pack Add Image

Stash a hero image inside a content pack — ZMongo 09 Content Pack Add Image

By CentralFloridaAttorney·Created 5 months ago·Updated 2 months ago· 1
09 ZMongo Content Pack Add Image
  • content_pack
  • image
  • content_pack
  • content_pack_json
  • manifest_json
  • preview_markdown
  • aliases
  • data_types
  • indexed
  • success
field_aliashero_image
labelHero Image
source_pathload_image.image
storage_modeinline_base64_png
replace_existingtrue
refresh_token

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 (default hero_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 (default load_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 - the IMAGE tensor, 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 in preview_markdown). Usually an odd image tensor shape; feed it a normal LoadImage/SaveImage pipeline output.
  • Alias collisions - if replace_existing is 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_pack from 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."

CategoryZMongo/09 Content Packs

Inputs (8)

NameTypeDefaultDescription
content_packZMONGO_CONTENT_PACK
imageIMAGE
field_aliasSTRINGhero_image
labelSTRINGHero Image
source_pathSTRINGload_image.image
storage_modeCOMBOinline_base64_png1 options: inline_base64_png
replace_existingBOOLEANtrue
refresh_tokenoptSTRING

Outputs (8)

NameTypeDescription
content_packZMONGO_CONTENT_PACK
content_pack_jsonSTRING
manifest_jsonSTRING
preview_markdownSTRING
aliases*
data_types*
indexedSTRING
successBOOLEAN