Nodes/ComfyUI-ZMongo/09 ZMongo Content Pack Build
ComfyUI Node

09 ZMongo Content Pack Build

Turn any JSON blob into a typed, shareable content pack

By CentralFloridaAttorney·Created 5 months ago·Updated 2 months ago· 1
09 ZMongo Content Pack Build
    • content_pack
    • content_pack_json
    • manifest_json
    • field_report_json
    • aliases
    • data_types
    • indexed
    • success
    document_json{}
    content_pack_namecontent_pack
    project_namedefault
    field_selection_modeauto_safe
    image_policyreference
    source_collection
    source_document_id
    include_paths_csv
    exclude_paths_csv
    alias_map_json{}
    type_overrides_json{}
    max_inline_text_chars3000
    max_inline_json_bytes8192
    refresh_token

    This is the node the whole V3 content pack system starts from. You hand it a blob of JSON - a prompt dict, a batch of generation parameters, whatever - and it chews it into a typed, portable bundle called a content pack that can be saved to a database, exported to a file, or wired into other nodes by stable alias names. If you've ever rebuilt the same KSampler settings across ten machines by hand, this is the thing that ends that.

    ComfyUI-ZMongo is a persistence framework by CentralFloridaAttorney: instead of hardcoding values into your graph, you offload them into a database layer (a hosted backend, or a local file store if you supply no credentials) and read them back by name. The V3 content packs are its structured-data format - a normalized manifest, not a dynamic node schema. That distinction matters because it means a pack built here behaves identically everywhere in the pack's ecosystem.

    What it actually does

    The document_json input is your source of truth. Paste a JSON object (or array) and the node flattens it into dot-paths like prompt.positive or model.seed, classifies each leaf value (string, int, float, boolean, image, JSON), and builds a fields[] list where every field gets a stable alias, a comfy_type, and its value. The name, project, and field-selection settings come from the other required inputs:

    • content_pack_name and project_name - how the pack is identified when you save or load it later.
    • field_selection_mode - defaults to auto_safe, which skips oversized binary-ish strings. select_all_safe takes everything, and the two include_paths modes let you whitelist exact dot-paths via include_paths_csv.
    • image_policy - reference stores image fields as references to the source asset, copy_reference duplicates them, ignore drops them entirely.

    On the optional side, alias_map_json lets you rename fields to friendly names ({"prompt.positive": "positive_prompt"}), and type_overrides_json forces a type on a field. max_inline_text_chars and max_inline_json_bytes guard against bloating the pack with huge strings.

    The outputs that matter

    The first output, content_pack (type ZMONGO_CONTENT_PACK), is the wire format you feed into every other V3 node. content_pack_json and manifest_json give you the full doc and its stripped-down manifest, handy for eyeballing. aliases and data_types are parallel lists - alias at index 3 matches the type at index 3 - which is exactly what the selection-based nodes expect. field_report_json is a quick success/count summary, and success tells you it built.

    Install and gotchas

    Install the pack via ComfyUI Manager (search "ZMongo") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/CentralFloridaAttorney/ComfyUI-ZMongo
    cd ComfyUI-ZMongo
    pip install -r requirements.txt
    

    Two real warnings. First, requirements.txt is heavy - it pulls langchain, sentence-transformers, FlagEmbedding, transformers, pymilvus and friends for the pack's agent/embedding features, so the first install takes a while even though Build itself only needs JSON handling. Second, the project declares Python >=3.10,<3.13, so a bleeding-edge 3.13 environment can bite you at import time. The good news: Build needs no session and no credentials - paste JSON, get a pack, done.

    CategoryZMongo/09 Content Packs

    Inputs (14)

    NameTypeDefaultDescription
    document_jsonSTRING{}
    content_pack_nameSTRINGcontent_pack
    project_nameSTRINGdefault
    field_selection_modeCOMBOauto_safe4 options: auto_safe, select_all_safe, manual_include_paths, include_paths
    image_policyCOMBOreference3 options: reference, copy_reference, ignore
    source_collectionoptSTRING
    source_document_idoptSTRING
    include_paths_csvoptSTRING
    exclude_paths_csvoptSTRING
    alias_map_jsonoptSTRING{}
    type_overrides_jsonoptSTRING{}
    max_inline_text_charsoptINT30001–200000
    max_inline_json_bytesoptINT81921–2000000
    refresh_tokenoptSTRING

    Outputs (8)

    NameTypeDescription
    content_packZMONGO_CONTENT_PACK
    content_pack_jsonSTRING
    manifest_jsonSTRING
    field_report_jsonSTRING
    aliases*
    data_types*
    indexedSTRING
    successBOOLEAN