Nodes/Prompt Info/Extract Info
ComfyUI Node

Extract Info

Extract Info — pull one exact value out of a saved image's workflow data

By chrisgoringe·Created 3 years ago·Updated 2 years ago· 32
Extract Info
    • string
    • float
    • int
    info
    node_id0
    side
    name

    Load Image With Info hands you a blob of JSON - every node and its saved values from the original workflow. Useful, sure, but you don't want to eyeball a wall of indented text every time you need one number. Extract Info is the node that digs one specific value out of that blob and gives it to you as a proper typed output you can wire anywhere.

    It's part of the cg-prompt-info pack, from the same author (Chris Goringe, who also made the Use Everywhere and Image Picker packs). The workflow is: load your image with Load Image With Info, feed its info output into Extract Info, tell it which node and which value you want, and it either spits it out or tells you exactly what it found instead.

    How it works

    The info string is a JSON dictionary keyed by node id. Extract Info does a three-step lookup: find the node id, pick the side (inputs or outputs), then pick the value by name. When it finds something, it displays the value right on the node via the pack's front-end extension, and returns it three ways - as a raw string, and as a float and an int when the value can be parsed as numbers. So a seed like 1234567890 comes out of int ready to plug into a KSampler; a prompt comes out of string ready to feed into a text encoder.

    If your lookup misses - wrong node id, or a name that isn't there - it sends a helpful list to the node display instead: which nodes are available in that image, or which values exist on the node you asked for. That's the same browse-and-discover logic as the pack's Hunt Info node, just delivered as a correction rather than an explorer.

    The inputs that matter

    • info (STRING) - the JSON from Load Image With Info. Marked forceInput, so it has to come from a wire, not the text box.
    • node_id (INT, default 0) - which node in the original workflow you want. The ids come from the saved graph's own numbering, which is why you should peek with Hunt Info if you don't know it.
    • side (enum: inputs / outputs) - which side of the node you're reading from. Remember: outputs only exist if the image was saved through the pack's Add Info node.
    • name (STRING, default empty) - the exact widget or port name, like text, seed, or cfg.

    Outputs: string, float, int (the latter two are null when the value isn't numeric). It's flagged as an output node, so it also shows its result on the canvas.

    Install

    Nothing special, no dependencies or downloads. ComfyUI Manager → search "Prompt Info" → install → restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/chrisgoringe/cg-prompt-info
    

    then restart ComfyUI. It shows up under the prompt_info category.

    Common issues

    The typical stumble is the node id. The node_id you type must match the numbering inside the saved workflow, which has nothing to do with where things are on your current canvas - this image was generated by someone else's graph, remember. If you guess wrong you get the "Available Nodes" listing, which is the pack nudging you toward Hunt Info to look it up visually.

    Second thing to know: when a value isn't numeric, float and int come back as null, not zero. Don't wire them into a KSampler and wonder why you're generating at seed null - check the side you're reading and whether the image was saved with Add Info in the chain. No outputs in the data, no output to extract. That's not a bug; the data was never in the file.

    Categoryprompt_info

    Inputs (4)

    NameTypeDefaultDescription
    infoSTRING
    node_idINT0
    sideCOMBO2 options: inputs, outputs
    nameSTRING

    Outputs (3)

    NameTypeDescription
    stringSTRING
    floatFLOAT
    intINT