Nodes/comfyui-fvmtools/SMP · Sidecar Saver (legacy)
ComfyUI Node

SMP · Sidecar Saver (legacy)

Save your PNGs with the structured prompt right beside them

By ping1979ping·Created 5 months ago·Updated about a month ago· 0
SMP · Sidecar Saver (legacy)
  • images
  • prompt_dict
  • structured
    filename_prefixSMP/img
    extra_metadata_json{}

    Every ComfyUI PNG already carries its workflow as embedded metadata, so why a separate sidecar JSON file? Because for a structured-prompt pipeline, the flat prompt string isn't the interesting record - the structured dict is. Sidecar Saver writes both: the PNG, exactly like stock SaveImage, plus a <prefix>_NNNNN_.prompt.json sitting right beside it holding the full PROMPT_DICT, and optionally the structured bundle and your own extra metadata.

    The reproducibility angle is the selling point. Re-run with the same seeds and the sidecar JSON comes out byte-identical for the structural fields. Months later you can look at a folder of outputs and know exactly which subject, outfit, and location generated each image - without digging through PNG metadata or hoping the workflow was saved.

    How it works

    It mirrors ComfyUI's own SaveImage path logic via folder_paths.get_save_image_path, so the naming convention matches what you're used to: ComfyUI/output/SMP/img_00001_.png plus img_00001_.prompt.json next to it. It's an OUTPUT_NODE, so it triggers on Queue even with nothing connected downstream. The JSON embeds the prompt_dict, the optional structured bundle, and whatever you stuff into extra_metadata_json.

    The inputs that matter

    • images - the decoded batch.
    • filename_prefix - defaults to SMP/img.
    • prompt_dict (optional) - without it you still get PNGs, just a thin sidecar.
    • structured (optional), extra_metadata_json (optional) - extra structure and your own metadata string.

    Outputs

    None. This is a terminal node, not a passthrough - put it last, after VAEDecode.

    Install

    No extra dependencies. Base pack install:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ping1979ping/comfyui-FVMtools
    

    Restart and you're set.

    What's inside the JSON

    The sidecar is the SMP workflow's audit trail. When you wire the full prompt_dict, it captures subjects[0].age_desc, the resolved outfits.subject_1.garments (with actual color names, no #token# left), the location.elements, and - if the Assembler is connected - the structured prompts and region map. The SMP reference workflow's verification checklist leans on exactly these fields: run, check the sidecar, know the pipeline did what you thought it did.

    Common issues

    The sidecar comes out missing keys when prompt_dict isn't connected - the node happily saves images alone, it just writes a nearly-empty JSON. And the file lands in ComfyUI/output alongside the PNGs, not in the pack's directory; people grep the wrong folder once. If you're chaining a ShowText to inspect the JSON, remember the sidecar is written at save time, so the file is the truth, not the preview.

    CategoryFVM Tools/SMP/Output

    Inputs (5)

    NameTypeDefaultDescription
    imagesIMAGE
    filename_prefixSTRINGSMP/img
    prompt_dictoptPROMPT_DICT
    structuredoptSTRUCTURED_PROMPTS
    extra_metadata_jsonoptSTRING{}

    Outputs (0)

    No outputs