Nodes/SD Prompt Reader/SD Parameter Extractor
ComfyUI Node

SD Parameter Extractor

Grab any single setting the Prompt Reader didn't output

By receyuki·Created 3 years ago·Updated 2 years ago· 463
SD Parameter Extractor
    • VALUE
    settings
    parameterparameters not loaded
    value_typeSTRING
    parameter_index0

    SDPromptReader outputs the headline numbers - seed, steps, cfg, dimensions, model. But A1111 metadata carries a lot more than that: hires-fix upscalers, clip skip, refiner settings, all the little knobs that made the image what it is. SD Parameter Extractor is the catch-all that lets you pull any value out of that metadata, not just the ones the reader bothered to expose.

    How it works

    The reader's SETTINGS output is the raw parameter block as text. SD Parameter Extractor parses that text into a dictionary of key-value pairs, then hands you back whichever one you ask for. The wiring is one cable: reader's SETTINGS → extractor's settings input. After the first run, the node's parameter dropdown populates with every key found in that image's metadata - so you pick "Hires upscaler" or "Clip skip" from the list and the VALUE output gives you what was recorded.

    Three inputs tune how you get the value. value_type converts the result for you - STRING, INT, or FLOAT - which is the difference between wiring a number into a KSampler widget and wiring a string that happens to look like one. parameter_index matters for values that are stored as tuples, like Size: (1024, 1024); it selects which element of the pair you want. And parameter itself is the dropdown that fills in after your first run.

    There's a useful quirk in how it handles bad input: if you ask for a numeric type but the value isn't a number, it doesn't crash - it prints a warning in the UI and hands you the value as a string anyway. Graceful failure, which is more than most nodes bother with.

    Where it fits

    Two situations make this node worth the extra wire. First, batch work: pair it with the pack's SDBatchLoader + reader combo and you can extract one specific setting across a whole folder of images - say, which upscaler every file used. Second, automation: if you're building a workflow that branches on some parameter (step count, cfg, clip skip), extracting it as a typed value beats parsing the settings text yourself.

    The honest caveat: it only sees what's actually in the metadata. An image saved by a tool that records a minimal parameter set will give you a short dropdown. And if the reader already outputs a field, there's no reason to extract it again here - this node exists for the leftovers. It's an output node, so the text display shows you what keys were found and what value it pulled, which doubles as a handy metadata inspector.

    Installing it

    It's part of the SD Prompt Reader pack, so the install is the pack install:

    cd ComfyUI/custom_nodes
    git clone --recursive https://github.com/receyuki/comfyui-prompt-reader-node.git
    cd comfyui-prompt-reader-node
    pip install -r requirements.txt
    

    Or just use ComfyUI Manager and search "SD Prompt Reader." Restart afterwards. No model files, no extra dependencies beyond the pack's piexif.

    The one thing that surprises people

    The parameter dropdown reads "parameters not loaded" until you actually run the graph once with a real settings string attached. It can't know what's in the metadata until it reads it. That first run is the load step - run it, then the dropdown fills and you can pick your field. People assume the node is broken when they see the placeholder; it's just waiting for data.

    CategorySD Prompt Reader

    Inputs (4)

    NameTypeDefaultDescription
    settingsSTRING
    parameteroptCOMBOparameters not loaded1 options: parameters not loaded
    value_typeoptCOMBOSTRING3 options: STRING, INT, FLOAT
    parameter_indexoptINT00–255

    Outputs (1)

    NameTypeDescription
    VALUE*