Preface¶
When developing ComfyUI-related DSH plugins or agents, a frequent question arises: How was this image generated? The PNG’s tEXt block indeed stores the workflow, but the field names use ComfyUI’s [node_id, slot] references, the prompt often comes through as an empty string via link, LoRA chains wind around dozens of nodes, and the exported workflow contains a bunch of mode: 4 bypass nodes that actually didn’t participate in image generation. Manually clicking on the canvas often fails to reproduce results if one step is wrong.
Introducing zzcyydshhh/comfy-png-inspector. It is essentially a PNG metadata parser. The frontend is a zero-dependency, offline single-page tool. The same parsing logic is packaged as a DSH bundle, exposing a comfy_png_inspect tool to the model.
What is this¶
The author is zzcyydshhh. The repository has 16 stars on GitHub, is under the MIT license, and the version number in package.json is 0.1.0. It solves the same pain point in two scenarios: humans browsing through hundreds of old images in the browser, and models directly generating a summary for a specific output directory in the Harness. The Web UI and the plugin share comfy-png-core.js; there is no second implementation.
Core Features¶
The tool takes a PNG or a directory and outputs the following:
- LoRA Chain: Lists each LoRA and its weight in the real execution order, supporting positive and negative values.
- Sampling Parameters: seed, steps, CFG, sampler / scheduler, denoise, latent size.
- Model Chain: base model, CLIP (including type), VAE, save prefix, pre-sampler patches (
ModelSamplingAuraFlow,CFGNorm, etc.). - Two Prompts: Parsed via link, with source nodes and slots marked; slots generated at runtime are separately marked as generated at runtime.
- Bypass Nodes: Determined from
workflow.nodes[].mode.4is bypass,2is mute; lists nodes that “exist on the canvas but did not participate in image generation.”
There are several edge cases in parsing that are easy to trip over; the tool handles them explicitly:
CLIPTextEncode.textis read directly as an empty string because the text comes from a link. The tool backtracks to the source node and writes it in the formCLIPTextEncode#4.text[slot 0] ← ZhPromptEnhance#79.text[slot 0].- The LoRA chain is not ordered by the sequence of nodes, but rather traversed in reverse from
KSampler.modelthroughinputs.modeltoUNETLoader/CheckpointLoaderSimple, then reversed to get the execution order. tEXt/zTXt/iTXtare all read, withzTXtand compressediTXtusingDecompressionStream('deflate')for decompression.
The Web UI also provides: thumbnail list, Ctrl+K focused search (filename / LoRA name / prompt body), CSV (UTF-8 BOM, Excel opens directly) and JSON export, batch zip packaging, and a template rebuild function.
Installation and Enablement¶
Install using the official command in Harness (as per the README, without version or commit suffixes):
dsh plugin add https://github.com/zzcyydshhh/comfy-png-inspector
package.json declares peer dependencies:
"peerDependencies": {
"@deepseek-ai/cordis": "~4.0.5",
"@deepseek-ai/dsh-tools": ">=0.0.1-rc.1 <0.1.0 || >=0.1.0-rc.1 <0.2.0-0 || >=0.2.0-rc.1 <0.3.0-0"
},
"dsh": {
"bundle": {
"patch": "./cordis.patch.yml"
}
}
This means it registers with Harness via the cordis.patch.yml patch file. It is recommended to read the source code and cordis.patch.yml in the repository before installing to ensure the patch content is compatible with your Harness version—the plugin runs with the permissions of the current dsh process and is not further restricted.
Typical Usage¶
After installation, there is an additional tool on the model side:
comfy_png_inspect(path, limit?, include_prompt?)
path points to a single PNG or an entire output directory; limit controls the number of returned entries, and include_prompt determines whether to include the full prompt. When calling on a directory, it outputs a LoRA chain, sampling settings, model chain, latent size, prompt, and bypass node list for every image, allowing the model to directly generate a reproduction explanation based on this.
The Web UI part does not rely on the installation command and can be started locally directly:
git clone https://github.com/zzcyydshhh/comfy-png-inspector.git
cd comfy-png-inspector
Open comfy-png-inspector.html (Chrome / Edge 103+, requires DecompressionStream), and drag the ComfyUI output folder into the window. The index.html in the repository root is just a one-line redirect for GitHub Pages; opening it offline will also land on the same application. The interface is bilingual (Chinese/English), switchable at the top. The browser language determines the default value, or you can use ?lang=en to force specify.
You can also use the command line without opening a browser:
python cli/comfy_png_parse.py ./output --no-text
python cli/comfy_png_parse.py ./output --csv index.csv --json index.json
python cli/comfy_png_parse.py a.png --full # Full prompt
It uses only the standard library, and the output is consistent with the Web UI.
Two Modes for Reproducing Workflows¶
After selecting an image, there are two buttons, depending on how much information is in the PNG:
| Original Export | Rebuild from Template | |
|---|---|---|
| Button | Export this image’s workflow JSON | Rebuild from template |
| Condition | PNG contains a workflow block |
Load a canvas workflow as a template |
| Result | The original canvas at the moment of generation | Template layout + parsed parameters injected |
| Applicability | Direct reproduction, most reliable | API-only image generation, mapping back to existing templates |
Rebuild replaces the base model / CLIP / VAE / latent size / save prefix / prompt / KSampler fields, then rebuilds the entire LoRA chain in the parsed order, and connects the tail of the chain back to the template’s original consumer (e.g., the model input of ModelSamplingAuraFlow). The operation first provides a change list item by item, then performs a self-check: link endpoints exist, no self-loops, KSampler wiring is complete. The template itself is deep copied and will not be written back.
Limitations and Notes¶
- Only PNG is supported. ComfyUI metadata is stored in PNG chunks; jpg / webp do not have it.
tEXtis lost after being captured by screenshot tools, forwarded via IM, or re-saved by Photoshop; the interface will prompt that there is no ComfyUI metadata.- Browsers do not allow JavaScript to scan directories under
file://, so one manual selection or drag is required for every session. - Rebuild is limited by the node categories already existing in the template: node categories that exist in the PNG but not in the template will not be created out of thin air (LoRA nodes are an exception, rebuilt according to the parsed count). Check the change list before exporting.
- Zip packaging is uncompressed to maintain zero dependencies; hundreds of workflows will be on the order of tens of MBs.
Conclusion¶
Its value lies in turning the act of “browsing the parameters of an image” into a programmable call. On the model side, there is a tool; on the human side, there is a local page; at the bottom, it is the same parsing code. The directory page is at https://www.skillhub.cn/plugins/zzcyydshhh/comfy-png-inspector, and the repository is at https://github.com/zzcyydshhh/comfy-png-inspector.