Nodes/ComfyUI-JNodes/Set Positive Prompt In MetaData
ComfyUI Node

Set Positive Prompt In MetaData

Put a readable positive prompt in A1111-style metadata

By JaredTherriault·Created 3 years ago·Updated about a month ago· 91
Set Positive Prompt In MetaData
    • BOOLEAN
    prompt

    ComfyUI embeds its workflow as JSON inside your saved images, which is great for dragging a file back in to reload the graph - but it's not what A1111-style metadata readers and sites like Civitai look for. They want a plain "positive prompt" field in the old parameters format. JNodes_SetPositivePromptInMetaData writes exactly that: it sets the positive-prompt key in the A1111-style png_info so your ComfyUI outputs carry a human-readable prompt that those tools can parse.

    It's one of a small family of png_info nodes in Jared Therriault's JNodes suite (alongside AddOrSetMetaDataKey, SetNegativePromptInMetaData, and RemoveMetaDataKey), all aimed at making Comfy's metadata play nicely with the A1111 conventions everyone else reads.

    How it works

    JNodes keeps a metadata dictionary during a run. This node writes your prompt text into the positive-prompt slot of that dictionary. When a save node later embeds metadata into the image, the positive prompt is there in the format A1111 parsers expect. Because it mutates shared metadata state rather than pixels, it's an output node and, crucially, it has to run before the save for the value to land in the file.

    The inputs and outputs

    • prompt (multiline STRING) - the positive prompt text to write into metadata. Often you feed it the same string you sent to your positive CLIP encode, so the saved metadata matches what actually generated the image.
    • BOOLEAN output - a success signal. Being an output node, its real effect is the side-effect on metadata; the boolean is there so you can chain or gate on it.

    How to install it

    Via ComfyUI Manager: Install Custom Nodes, search "JNodes", install, restart. Or by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/JaredTherriault/ComfyUI-JNodes
    pip install -r ComfyUI-JNodes/requirements.txt
    

    then restart ComfyUI. No model downloads.

    Common issues & troubleshooting

    Order matters - set the prompt before you save. The classic failure is wiring this in parallel with (or after) the save node, so the metadata is written too late to make it into the file. Make sure this node executes upstream of the save. If your saved image is missing the positive prompt, this ordering is the first thing to check.

    It writes A1111-style metadata, not Comfy's workflow. These are two different things living in the same file. ComfyUI's embedded workflow JSON is separate; this node targets the A1111 parameters string that other tools read. If you want both - reload-in-Comfy plus a readable A1111 prompt - keep Comfy's workflow saving on and use this node to add the A1111-style field on top.

    Feed it the real prompt, not a placeholder. Nothing forces the metadata to match your actual generation. If you type something into prompt that differs from what you sent to CLIP, the saved metadata will lie. Wire the same string into both the encoder and this node when you want the metadata to be trustworthy.

    Pair it with the negative-prompt node for a complete record. This one only sets the positive. If you want the negative prompt in metadata too, add JNodes_SetNegativePromptInMetaData alongside it - and if you later want to strip a key back out, JNodes_RemoveMetaDataKey is the eraser.

    Categorysd

    Inputs (1)

    NameTypeDefaultDescription
    promptSTRING

    Outputs (1)

    NameTypeDescription
    BOOLEANBOOLEAN