Nodes/ComfyUI-ZML-Image/ZML_加载A1111数据
ComfyUI Node

ZML_加载A1111数据

Read an A1111 PNG's settings back into your graph

By zml-w·Created about a year ago·Updated 2 months ago· 218
ZML_加载A1111数据
    • 正面提示词
    • 负面提示词
    • LoRA
    • 步数
    • CFG
    • 采样器
    • 调度器
    • 种子
    • 模型
    • 完整A1111信息
    image
    lora_output_format

    You have a folder of PNGs generated in AUTOMATIC1111, and you want to recreate them in ComfyUI - prompts, seed, sampler, everything. Copying settings by eye from a PNG Info tab is miserable. ZML_LoadA1111Data reads the whole thing for you and splits it into twelve clean outputs you can wire straight into a sampler.

    How it works: AUTOMATIC1111 (and Forge after it) writes its generation data into a single PNG text chunk called parameters - a flat string of "prompt, Negative prompt:, Steps:, Sampler:, CFG scale:, Seed:, Size:, Model:". This node opens the image, pulls that chunk (it also falls back to the EXIF UserComment field, which is where A1111 puts the same string on JPEG/WebP exports), and parses it field by field. If there's no metadata at all, it returns sensible defaults (20 steps, euler, CFG 8, 512×512) rather than crashing.

    The outputs, and this is where the node earns its keep:

    • 正面提示词 and 负面提示词 - positive and negative prompt, cleaned up (the parser strips <lora:...> tags out of the positive so you get raw prompt text).
    • LoRA - the LoRAs, in either JSON格式 (a list of {"lora_name", "weight"} dicts) or A1111格式 (<>) (the <lora:name:weight> tags) depending on the lora_output_format dropdown. The JSON form is the one ZML's own LoRA tooling expects; the tag form is what you'd paste back into a prompt.
    • 步数, CFG, 采样器, 调度器, 种子, 模型, , - all the sampler settings as typed values, ready to feed a KSampler, latent size, and seed.
    • 完整A1111信息 - the raw untouched parameter string, in case you want it verbatim or for debugging.

    It also merges in the JSON LoRA block that newer A1111/Forge versions embed, so nothing gets lost on modern exports. The parsing is defensive throughout - a missing field defaults instead of erroring.

    Where people get burned: the model name is whatever was baked into the file (e.g. the checkpoint filename), so 模型 won't match your ComfyUI checkpoint names unless they're identical. And the Size field is the generation resolution, not necessarily the final image size. Neither is the node's fault - that's just what A1111 stored. Also, this reads the image file from ComfyUI's input folder via the standard upload widget, so drop the PNG in via the upload button or drag it onto the node.

    Context from the KB's metadata doc: this is the "A1111 dialect" of the workflow-in-the-image convention - a settings string you can re-apply, not a node graph. This node is the ComfyUI side of that re-application, and it pairs nicely with ZML's own save-image node that writes comfy_text_block metadata if you want to keep everything in one ecosystem.

    Install the pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/zml-w/ComfyUI-ZML-Image
    

    (Manager search "ComfyUI-ZML-Image" also works.) Restart, and it sits under ZML 图像 → 采样器相关 in the Chinese UI. It's pure standard-library parsing - no extra dependencies beyond the pack's own Pillow.

    Categoryimage/ZML_图像/采样器相关

    Inputs (2)

    NameTypeDefaultDescription
    imageCOMBO1 options: example.png
    lora_output_formatCOMBO2 options: JSON格式, A1111格式 (<>)

    Outputs (12)

    NameTypeDescription
    正面提示词STRING
    负面提示词STRING
    LoRASTRING
    步数INT
    CFGFLOAT
    采样器STRING
    调度器STRING
    种子INT
    模型STRING
    INT
    INT
    完整A1111信息STRING