ComfyUI Node

SaveParamToPreset

Turn the workflow you just tuned into a one-click preset

By mittimi·Created 2 years ago·Updated 6 months ago· 4
SaveParamToPreset
  • param
    tomlnamenew_preset
    savetype

    You spent an evening dialing in a checkpoint - the negative prompt, the sampler, the CFG that actually works with it. SaveParamToPreset (class SaveParamToPresetMittimi) is how you keep that work: it writes the current settings out as a TOML preset that the pack's LoadSetParameters node can recall from its dropdown forever after. The workflow that produced the good image becomes a saved recipe instead of a screenshot you'll never find again.

    How it works

    The node takes a parameters_data blob - the one LoadSetParameters emits - and writes it to a .toml file in the pack's presets/ folder, using the same 16-field layout the hand-written presets use (checkpoint, clip skip, VAE, the three positive and negative prompt boxes, size, batch, steps, CFG, sampler, scheduler). Everything it needs is already in the data, so the only real input is the name you want.

    Inputs that matter

    • param - the PDATA from LoadSetParameters. Feed it the single structure that came out of the node whose settings you want to save.
    • tomlname - the preset filename, default new_preset. No extension needed; the node adds .toml.
    • savetype - new save or overwrite save. New save appends a number to the filename if that name already exists, so you can't accidentally clobber an old preset. Overwrite replaces it in place.

    The gotcha that trips everyone

    After saving, restart ComfyUI before you expect to see the preset in the dropdown. The preset list is scanned when the pack loads, so a preset saved mid-session won't appear until the next start. The README says this plainly, and people still get confused when their freshly-saved preset is nowhere in sight. Also note: this node writes only the first entry of the PDATA list - so feed it a single parameters_data, not the combined output of CombineParamData. Feed it a multi-entry list and only the first recipe gets saved.

    Install

    Same pack, same drill:

    cd ComfyUI/custom_nodes
    git clone https://github.com/mittimi/ComfyUI_mittimiLoadPreset2
    

    or via ComfyUI Manager by searching "ComfyUI_mittimiLoadPreset2", then restart. The pack only depends on toml, so nothing heavy gets pulled in. One environment note worth repeating from the pack docs: if RES4LYF is installed, the LoadSetParameters side can misbehave - apply the scheduler-registration patch (ClownsharkBatwing/RES4LYF#161) before you blame the save path, since this node just serializes whatever PDATA it's handed.

    CategorymittimiTools

    Inputs (3)

    NameTypeDefaultDescription
    paramPDATA
    tomlnameSTRINGnew_preset
    savetypeCOMBO2 options: new save, overwrite save

    Outputs (0)

    No outputs