Nodes/ComfyUI-ZMongo/09 ZMongo Content Pack Load JSON File
ComfyUI Node

09 ZMongo Content Pack Load JSON File

Load a content pack back from a file on disk

By CentralFloridaAttorney·Created 5 months ago·Updated 2 months ago· 1
09 ZMongo Content Pack Load JSON File
    • content_pack
    • json
    • manifest_json
    • aliases
    • data_types
    • indexed
    • success
    content_pack_file
    validate_schematrue
    image_policyload_inline
    refresh_token

    The flip side of Export JSON File: this node reads a content-pack JSON file back off disk and turns it into a live ZMONGO_CONTENT_PACK you can feed into any Get node, the manifest preview, or another exporter. It's how you consume a pack someone sent you, or rehydrate your own archived bundles without needing the database to still be around.

    Inputs

    • content_pack_file - a path to the JSON file. It also accepts the raw JSON itself: if the string starts with {, the node treats it as inline content rather than a path. That's a nice escape hatch for pasting.
    • validate_schema (default true) - checks the schema_kind before importing. With it on, a JSON blob that isn't a recognized content pack is rejected; turn it off and the node tries to force whatever you gave it into a pack.
    • image_policy - how to treat image fields:
      • load_inline (default) - keep whatever image data is embedded.
      • ignore_images - strip image values out, leaving the fields but nulling the pixels. Good when the file is big and you only want the text/numeric fields.
      • require_images - error out if any IMAGE field is missing its data. Good when the images are the whole point.

    The loader is smart about what it accepts: it can unwrap a portable envelope or extract a pack embedded inside a workflow JSON (the format Export JSON File produces in workflow_json mode). So one node handles both the bare envelope and the workflow-wrapped version. Files go through os.path.expanduser, so ~/... paths work.

    Outputs

    content_pack is the wire format for the rest of the system, json is the rehydrated document, manifest_json the manifest. aliases and data_types are the parallel lists, indexed is the alias [type] text dump, and success tells you the load worked.

    Common issues

    The most frequent failure is a wrong path - the error message is explicit (Portable content pack file not found: ...) and the node returns an empty pack plus success: false rather than crashing, so read the json output for the real message. The second gotcha is schema validation: if someone sent you a raw JSON that isn't a pack (no zmongo_content_pack schema kind), validate_schema: true will refuse it. No session is required - this node is fully offline, which is the whole point of the portable format.

    CategoryZMongo/09 Content Packs/Portable

    Inputs (4)

    NameTypeDefaultDescription
    content_pack_fileSTRING
    validate_schemaBOOLEANtrue
    image_policyCOMBOload_inline3 options: load_inline, ignore_images, require_images
    refresh_tokenoptSTRING

    Outputs (7)

    NameTypeDescription
    content_packZMONGO_CONTENT_PACK
    jsonSTRING
    manifest_jsonSTRING
    aliases*
    data_types*
    indexedSTRING
    successBOOLEAN