Construct Metadata Flexible
The node that stamps A1111/Civitai-ready params onto your images
- model_info
- sampler_info
- lora_stack
- param_metadata
This is the heart of Sage Utils, and it's the node the whole pack is really about. Construct Metadata Flexible takes everything your workflow knows - model, prompts, sampler settings, image size, LoRAs - and assembles it into a metadata string in the A1111/Civitai parameters format, ready to be embedded in the PNG. Post an image with this metadata and Civitai reads it back: model, hash, sampler, steps, seed, the whole chain, all reconstructable.
The inputs read like a summary of the workflow itself. model_info (from the pack's Checkpoint Selector / Load Checkpoint w/ Metadata), positive_string and negative_string, sampler_info (from Sampler Info / KSampler w/ Sampler Info), width and height, and an optional lora_stack if LoRAs were involved. Then the one dropdown that changes everything: metadata_style. The default is A1111 Full - the full format with LoRA hashes and Civitai resource links, which is what Civitai's readers expect. But you have options straight from the pack's metadata_templates.json:
- A1111 Full - prompt, negative prompt, steps/sampler/scheduler/CFG/seed/size, model name + hash, ComfyUI version, and full LoRA hash/resource lines. The works.
- A1111 Lite - simplified, only includes models that actually exist on Civitai.
- Simple - no models or LoRAs, just prompt + negative + basic sampler params.
- Info - a lighter informational block.
- Pos. Prompt Only - literally just the positive prompt and the base params.
Why the choice matters: not everyone wants the kitchen sink in their PNG. If you're posting to a community that hates bloated metadata, Simple or Pos. Prompt Only keeps the file clean while still being traceable. If you're building a gallery for Civitai, A1111 Full is what gets your models and hashes auto-detected.
The mechanism is string assembly from the pack's metadata templates - the same construction the pack has shipped across versions, now with the style dropdown on top. The single output is param_metadata, which feeds the param_metadata input of the pack's Save Image w/ Added Metadata node (it goes into the PNG's parameters chunk, A1111-style). Any other notes go in the same save node's extra_metadata input instead.
Two practical gotchas. First, the sampler_info and model_info inputs aren't optional - if you only have half a workflow wired, the node will complain. Second, model hashes and Civitai lookups depend on the pack's local cache (sage_cache_hash.json / sage_cache_info.json under comfyui/user/default/SageUtils/); a model the cache has never seen may need a run of the pack's Model Scan & Report to warm up before its hash shows in metadata. The author keeps this pack small and personal, but the metadata formats it produces are the standard ones the whole community reads - that's the part that's rock solid.
Install
ComfyUI Manager → search Sage Utils → install → restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/arcum42/ComfyUI_SageUtils.git
cd ComfyUI_SageUtils && pip install -r requirements.txt
Restart ComfyUI. Only dependency is dynamicprompts. Check example_workflows/ in the repo (or ComfyUI's Browse Templates → comfyui_sageutils) for a fully wired metadata workflow to copy.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| model_info | MODEL_INFO | Model info used to build metadata, such as checkpoint and model details. | |
| positive_string | STRING | The positive prompt text to include in metadata. | |
| negative_string | STRING | The negative prompt text to include in metadata. | |
| sampler_info | SAMPLER_INFO | Sampler settings used to generate the image. | |
| width | INT | 1024 | Image width used in metadata. |
| height | INT | 1024 | Image height used in metadata. |
| metadata_style | COMBO | A1111 Full | The metadata style format to produce. |
| lora_stackopt | LORA_STACK | Optional LoRA stack information to include in metadata. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| param_metadata | STRING | The generated metadata string. |