Nodes/ComfyUI Civitai MCP/Civitai Parse A1111 Params
ComfyUI Node

Civitai Parse A1111 Params

Split an A1111 parameters string into typed fields you can actually wire

By daceheg·Created 3 months ago·Updated 3 months ago· 6
Civitai Parse A1111 Params
    • prompt
    • negative_prompt
    • seed
    • steps
    • cfg_scale
    • sampler_name
    • width
    • height
    a1111_params

    Civitai images carry their generation settings as a single text block - the "A1111 parameters" string, which looks like a prompt, a Negative prompt: line, then a settings line full of Key: value pairs. It's human-readable but useless inside a node graph. This node takes that string and breaks it into typed fields you can actually connect to other nodes: the prompt, the negative prompt, and the numeric settings.

    The one input, and what comes out

    a1111_params (STRING, required, multiline) - paste a string, or better, wire it from a metadata source like Civitai Load Image (with Metadata), the dir loader, or ComfyUI-Image-Saver's a1111_params output.

    Eight outputs, mirroring the standard format:

    • prompt, negative_prompt (STRING) - the positive and negative prompts.
    • seed (INT), steps (INT), cfg_scale (FLOAT), sampler_name (STRING).
    • width, height (INT) - the generation dimensions from the Size: field.

    Missing fields come back as empty strings or zeros rather than errors, which keeps graphs alive even when a string is incomplete.

    How it works

    It's a small parser, but a carefully written one. It splits the text into lines, locates the Negative prompt: line and the settings line (detected by the presence of known keys like Steps:, Sampler:, CFG scale:, Seed:, Size:), and then parses the settings as comma-separated pairs. The subtle bit: commas inside bracketed or JSON values - like the Civitai resources: [...] array that newer images embed - must not split a pair, so the splitter only cuts on commas that are followed by a Key: token. That's the difference between this and a naive split(", "), and it's why it survives real Civitai metadata.

    Where you'd actually use it

    Three places. First, resurrect a recipe: load a saved image's a1111_params, parse it, and feed prompt/negative_prompt/seed back into a sampler to reproduce the original. Second, drive other nodes with the parsed values - a seed into your seed widget, dimensions into an Empty Latent. Third, debug: when Civitai shows metadata you didn't expect, paste the string in and see exactly what the site recorded. It's the inverse of what the posting nodes produce, so it's the natural companion to anything in this pack that embeds metadata.

    A note on the format

    The sampler_name you get back is whatever the string says - usually Civitai's display name like DPM++ 2M Karras, not ComfyUI's internal dpmpp_2m - so don't wire it straight into a KSampler expecting a match. Use it as a label, or map it yourself. That's a property of the data, not a bug in the node.

    Installing it

    ComfyUI Manager, search ComfyUI Civitai MCP, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/daceheg/ComfyUI-civitai-mcp.git
    

    Restart after. The pack's only real dependency is requests; this node is fully local, needs no API key, and is about as close to "just a pure function" as ComfyUI nodes get.

    CategoryCivitai-mcp

    Inputs (1)

    NameTypeDefaultDescription
    a1111_paramsSTRING

    Outputs (8)

    NameTypeDescription
    promptSTRING
    negative_promptSTRING
    seedINT
    stepsINT
    cfg_scaleFLOAT
    sampler_nameSTRING
    widthINT
    heightINT