ZML_保存图像(A1111)
The A1111 metadata saver
- 图像
Here's a frustration ComfyUI users hit the moment they start posting: you upload a PNG to CivitAI and the site shrugs - no model linked, no LoRAs detected, no generation data card. The stock SaveImage node writes ComfyUI's workflow and prompt JSON chunks, which CivitAI's parser mostly ignores; it wants the flat A1111-style parameters string (the Steps: … Sampler: … Seed: … block that AUTOMATIC1111 has been writing into every PNG for years). ZML_SaveImageWithMetadata exists to write both worlds, and it's the pack's answer to that "Stop using the default Save Image node" article.
It sits in the pack's 采样器相关 (sampler-related) category for a reason: it's built to be fed by the rest of ZML's generation ecosystem - the ZML_K采样器 (sampler), the ZML_CLIP编码 node, and the 强力_LoRA加载器 (LoRA loader). All the plumbing to collect the generation parameters is already in those nodes; this one just writes the receipt.
The inputs that matter
- 元数据保存格式 - the big one. Four modes:
A1111数据+工作流,仅工作流,仅A1111数据,不保存任何信息. The default writes both the flat A1111parameterschunk and the ComfyUI workflow graph, so the file round-trips in ComfyUI and auto-links on CivitAI. In that combined mode it also writes the cleaned positive prompt into the ZMLcomfy_text_blockchunk, which is how other ZML image nodes pick up your prompt. - lora保存格式 -
JSON格式orA1111格式 (<>). The tooltip explains the pairing: JSON output can be fed straight into the pack's 名称加载lora node later, while<>format is the<lora:name:weight>string A1111 tooling understands. Feed it from the LoRA loader'slora名称列表output. - 保存路径 (default
./ZML-A1111/%Y-%m-%d) and 文件名 (defaultZML-%H%M%S) - both take strftime codes;./means relative to the output folder. - 正面提示词 / 负面提示词 - optional strings. The tooltip gives the priority order: your typed value wins, then the sampler's captured prompt, then the sampler's automatic crawl of the upstream graph. You normally don't touch these at all if you're using the ZML sampler.
There's also 生成信息 (from the ZML_K采样器) and lora_信息 (from the LoRA loader), both optional.
What it writes, mechanically
When it builds the A1111 block it assembles Steps, Sampler, Schedule type, CFG scale, Seed, Size, Model (extension stripped), optional Denoising strength when below 1.0, and a Generation time. Then it appends the LoRA tags to the positive prompt. Importantly, when it writes the text block it strips <lora:...> tags and JSON LoRA lines out of the prompt first - so the text block you read back later is the clean prompt, not prompt-plus-serialized-LoRA-garbage. That cleanup is exactly the kind of detail that makes this node feel thought-through.
How it fits and what to watch
This is the node to reach for if you share to CivitAI or want your PNGs to carry a human-readable settings block alongside the graph. One thing to know: it's wired for the ZML sampler/LoRA ecosystem. If you're on a stock KSampler and a stock LoraLoader, the 生成信息 and lora_信息 inputs stay empty and you'll have to type prompts by hand - in which case the much simpler path is just ZML_SaveImage with a text block. The value here is that it's automatic, and it's only automatic inside this pack's sampler line.
Install: ComfyUI Manager → search "ComfyUI-ZML-Image", or cd ComfyUI/custom_nodes && git clone https://github.com/zml-w/ComfyUI-ZML-Image, then restart. The pack's UI is Chinese by default - grab the English patch. No extra model files needed.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| 图像 | IMAGE | 输入要保存的图像 | |
| 元数据保存格式 | COMBO | A1111数据+工作流模式下,会将正面提示词自动注入到文本块,以适配其它图像节点。 | |
| lora保存格式 | COMBO | 选择附加的LoRA信息是以JSON格式(json格式可以通过'名称加载lora'节点加载使用)还是标准<lora:name:wt>格式保存。 此接口需要从'ZML_强力_LoRA加载器'节点的'lora名称列表'接口来接入。 | |
| 保存路径 | STRING | ./ZML-A1111/%Y-%m-%d | 支持时间代码 (如 %Y-%m-%d),./ 代表 output 目录 |
| 文件名 | STRING | ZML-%H%M%S | 文件名模式,支持时间代码 |
| lora_信息opt | STRING | 输入LoRA列表JSON字符串 | |
| 生成信息opt | STRING | 来自ZML采样器的生成信息 | |
| 正面提示词opt | STRING | 提示词保存优先级:1. 此输入框(优先使用) -> 2. 'ZML_K采样器'节点从'ZML_CLIP编码'节点获取的提示词 -> 3. 'ZML_K采样器'自动爬网线查找上游的文本输入节点 | |
| 负面提示词opt | STRING | 提示词保存优先级:1. 此输入框(优先使用) -> 2. 'ZML_K采样器'节点从'ZML_CLIP编码'节点获取的提示词 -> 3. 'ZML_K采样器'自动爬网线查找上游的文本输入节点 |
Outputs (0)
No outputs