ComfyUI Node Runs on cloud

Save Image w/Metadata

Make Civitai actually read your ComfyUI settings

By giriss·Created 3 years ago·Updated 19 days ago· 338
Save Image w/Metadata
  • images
    filename%time_%seed
    path
    extension
    steps20
    cfg8.00
    modelname
    sampler_name
    scheduler
    positiveunknown
    negativeunknown
    seed_value0
    width512
    height512
    lossless_webptrue
    quality_jpeg_or_webp100
    counter0
    time_format%Y-%m-%d-%H%M%S

    Here's the problem this node exists to fix. ComfyUI already stuffs your whole workflow into the PNG as JSON - drag the image back in and the graph rebuilds. Great feature. But Civitai and Prompthero don't read that JSON. They auto-detect the old A1111-style parameters string (prompt, negative prompt, Steps: 20, Sampler: euler, CFG scale: 7, Seed: ...), and a stock ComfyUI image simply doesn't carry one. So you upload a Comfy render and the site shows nothing - no prompt, no seed, no settings - and you're back to keeping a notepad. That's the exact headache the pack's author hit in 2023, and this node is his answer. It writes the parameters string those sites expect, into png, jpeg, or webp.

    How it works

    It's a drop-in replacement for the normal Save Image node, with extra fields. You hand it the image plus the generation settings, and it stamps them into the file's metadata in the format Civitai and Prompthero parse. The important bit: it doesn't sniff those settings out of your sampler. You wire them in. Whatever you type or connect is what gets written - the node trusts you.

    That sounds like a footgun, and it is one, but it's also the point. Because you feed the values in by hand, you can feed it the resolved ones. Use wildcards or dynamic prompts? Wire the final rendered prompt (the one that actually reached the sampler) into positive, and the metadata records the real text instead of the __wildcard__ template. Native ComfyUI metadata can't do that. This node can.

    The inputs that matter

    • images - the IMAGE to save. Required.
    • positive / negative - your prompt text (multiline). These default to "unknown", which is your tell that you forgot to connect them.
    • filename - defaults to %time_%seed; the %time and %seed tokens get expanded, so files self-name with a timestamp and the seed. path sets the subfolder.
    • extension - png, jpeg, or webp. PNG is lossless and the safe default; jpeg/webp are smaller, with quality_jpeg_or_webp and lossless_webp to tune them.
    • The mirror fields - steps, cfg, sampler_name, scheduler, modelname, seed_value, width, height. These are the metadata. They only match your render if you drive them from the same source your sampler uses.

    There are no outputs - like any save node, it's a terminal node that just writes the file.

    That last point is the whole reason this pack ships a pile of little Seed Generator / Cfg Literal / Sampler Selector helpers. Define each value once, split the wire so it feeds both your KSampler and this node, and the saved metadata is guaranteed to match what actually ran. Type cfg 8 here while your sampler quietly ran 4 and you've just published a lie.

    Installing it

    Easiest path: ComfyUI Manager, search Save Image with Generation Metadata, install, restart. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/giriss/comfy-image-saver
    cd comfy-image-saver
    pip install -r requirements.txt
    

    Then restart ComfyUI. Small requirements file for the metadata/EXIF writing, no model downloads.

    Where people get tripped up

    If Civitai shows nothing after upload, check positive/negative first - a stray "unknown" means you never connected them. Second, know the format's ceiling: the A1111 parameters string has one slot per field. A genuinely complex graph - multiple checkpoints, a hi-res pass, a refiner - can't be flattened into those few fields honestly, so feed it the settings from the pass that matters (usually the base generation) and accept that the metadata is a summary, not the full workflow. For that, the embedded JSON ComfyUI already writes is still your real reproduction record.

    CategoryImageSaverTools

    Inputs (18)

    NameTypeDefaultDescription
    imagesIMAGE
    filenameSTRING%time_%seed
    pathSTRING
    extensionCOMBO3 options: png, jpeg, webp
    stepsINT201–10000
    cfgFLOAT8.000–100
    modelnameCOMBO0 options:
    sampler_nameCOMBO44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38
    schedulerCOMBO9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3
    positiveoptSTRINGunknown
    negativeoptSTRINGunknown
    seed_valueoptINT00–18446744073709550000
    widthoptINT5121–16384
    heightoptINT5121–16384
    lossless_webpoptBOOLEANtrue
    quality_jpeg_or_webpoptINT1001–100
    counteroptINT00–18446744073709550000
    time_formatoptSTRING%Y-%m-%d-%H%M%S

    Outputs (0)

    No outputs