Nodes/ComfyUI-ZMongo/08 Load Preset
ComfyUI Node

08 Load Preset

Put that saved KSampler config back on the canvas

By CentralFloridaAttorney·Created 5 months ago·Updated 2 months ago· 1
08 Load Preset
  • session
  • preset_json
  • preset_name
  • source_node_id
  • source_node_class
  • field_count
  • storage_backend_used
  • document_id
  • status
preset_namemain_sampler
collection_nameworkflow_presets
storage_backendauto
document_id
document_json

Every "save" node needs its load counterpart, and Load Preset is ZMongo's. If Save Preset By Node ID freezes a node's settings into a named preset, this node retrieves that preset and hands you the JSON - plus a trail of metadata about where it came from and what it describes.

Where it fits: you save a KSampler's config as main_sampler on one machine, and later - possibly on a different rig, possibly from ZMongo's hosted database - you wire a Load Preset into the graph, point it at that name, and feed its preset_json output into the pack's Dynamic Preset Outputs node to map the values back onto downstream inputs. Your parameters become portable state instead of graph furniture.

How it works

Load Preset has three ways to get you a preset, in priority order:

  1. document_json - if you already have raw preset JSON (say from a 03 Get Doc node), it's reconstructed directly into preset_json. No lookup happens at all.
  2. document_id - a specific ZMongo document ID loads that exact document.
  3. preset_name + collection_name - the normal path: query the local folder or hosted collection for the named preset.

The storage_backend enum decides where the lookup happens. auto is the sensible default: it uses the ZMongo API when a session is connected, and falls back to the local file store otherwise. Explicit local_file or zmongo_api force one or the other, and session is required for the API path.

Inputs and outputs that matter

You'll practically only touch three inputs as a beginner:

  • preset_name - the name you saved it under (default main_sampler).
  • collection_name - local folder or collection name (default workflow_presets).
  • storage_backend - auto / local_file / zmongo_api.

The outputs are the value. preset_json is the payload you actually use - wire it into 08 Dynamic Preset Outputs to expose the fields as out_00, out_01, etc., or into Preset Debug Info to inspect it. The rest are breadcrumbs: preset_name, source_node_id, source_node_class, field_count, storage_backend_used, document_id, and a status string that tells you exactly which file or document satisfied the request.

Installing it

Standard pack install - this is one of ~90 nodes in ComfyUI-ZMongo:

cd ComfyUI/custom_nodes
git clone https://github.com/CentralFloridaAttorney/ComfyUI-ZMongo

Restart ComfyUI. ComfyUI Manager users can search "ComfyUI-ZMongo" and install it there. Watch the requirements.txt: it drags in pymongo, langchain, sentence-transformers, FlagEmbedding, and transformers even if you're only here for presets.

Common issues

  • "Preset ... was not found at ..." - the status output will literally tell you the file path it checked. If you saved via the API and are loading locally (or vice versa), the storage backends don't share anything. Match them.
  • Loaded JSON looks empty - you supplied document_json with a value that wasn't actually a preset payload; Load Preset reconstructs what you give it without interpretation.
  • Missing session on zmongo_api - you forced the API backend without wiring a session node. Drop the local file store session in and switch back to auto, or connect the real API key session.
CategoryZMongo/08 Presets

Inputs (6)

NameTypeDefaultDescription
preset_nameSTRINGmain_samplerPreset name to load when document_json/document_id is not supplied.
collection_nameSTRINGworkflow_presetsLocal preset folder or ZMongo collection name.
storage_backendCOMBOautoauto uses ZMongo API when session is connected, otherwise local file.
sessionoptZMONGO_API_SESSIONOptional API session. Required for zmongo_api storage.
document_idoptSTRINGOptional direct ZMongo document id. If supplied, this loads that document instead of querying by preset_name.
document_jsonoptSTRINGOptional JSON from 03 Get Doc. If supplied, this is reconstructed directly into preset_json.

Outputs (8)

NameTypeDescription
preset_jsonSTRING
preset_nameSTRING
source_node_idSTRING
source_node_classSTRING
field_countINT
storage_backend_usedSTRING
document_idSTRING
statusSTRING