ComfyUI Node

Save Style

Save a good style from inside the workflow, not the sidebar

By Immac·Created 6 months ago·Updated 6 months ago· 0
Save Style
  • example_image
  • style_id
  • style_value
  • style_negative
modeSave
name
value
negative
id
favoritefalse

Save Style is the workflow-side writer for the Immac Style Mixer library. Where the sidebar's Styles tab is how you manage prompts by hand, this node lets a graph create or update a style on its own - handy for the moment you generate something good and want to capture the exact prompt that made it, or for building a pipeline that feeds winning text back into your library. It's an output node: it does its writing when the graph runs.

The style model is deliberately boring: a name, a prompt value, an optional negative, a favorite flag, and an optional thumbnail image. No embeddings, no LoRAs, no API keys - it's a named prompt snippet, and that's the whole trick. Combined with Pick Style on the other end, you can build a save-and-reuse loop entirely inside a workflow.

How it works

Like its sibling Save Mix, the mode dropdown decides how the target is resolved:

  • Create - inserts a new style. Requires a name, fails if the name is already taken, and errors if you connect an id (ids are auto-assigned). Think "new entry only".
  • Update - modifies an existing style, by id or by name. Fails if it can't find the record, and fails if you hand it both id and name. This is the one to pick when you want a strict "it must already exist" patch.
  • Save (default) - the upsert: updates if found, creates if not. Give it an id with no match and it errors, telling you to drop the id and use a name instead.

On update, only non-empty fields overwrite the stored values. That's genuinely useful: you can patch a style's negative prompt without touching its value, or swap the thumbnail without rewriting the text. It makes partial updates painless.

The inputs and outputs

  • name - the style's name; the identifier you'll search by in Pick Style's dropdown.
  • value - the prompt text, multiline. The actual content of the style.
  • negative - the per-style negative, multiline. Wired into the negative side when you pick the style later.
  • mode - Create / Update / Save, default Save.
  • id - connect it only for Update/Save-by-id. Create mode rejects it.
  • favorite - boolean; pinned styles sort to the top of the sidebar grid.
  • example_image - an IMAGE tensor; saved to input/immac_style_mixer/styles and used as the style's thumbnail. Wire it from a Load Image or a Preview/Save output if you want a visual on the card.

Three outputs - style_id, style_value, style_negative - mostly for logging or for passing the saved style straight into the rest of your graph. You don't have to use them.

When you'd bother

If you only ever add styles by hand in the sidebar, Save Style is redundant - the tab does it faster. It earns its place in workflows that generate the prompt programmatically: prompt-gen experiments, A/B loops where you want to bank the winning text, or a fixed graph where an operator fills in name/value primitives and runs. For that crowd it's the missing write path.

Install

All six nodes in the pack install together:

cd ComfyUI/custom_nodes
git clone https://github.com/Immac/ComfyUI-ImmacStyleMixer

Restart ComfyUI. No pip dependencies, no model downloads, and the pack uses ComfyUI's newer comfy_entrypoint extension API, so keep your ComfyUI current. Manager installs it if you give it the repo URL. Full detail in the pack README.

Gotchas

The guards are the same flavor as Save Mix: Create + id errors, id-and-name-together errors, and "no style named X" from Update when the record doesn't exist - all messages tell you the fix. The bigger gotcha is location: everything persists to style_mixer_data.json inside the pack folder, so a re-clone wipes it. Use the sidebar's JSON/ZIP export before you ever touch that directory, and you won't learn this the hard way.

CategoryImmac/Style Mixer

Inputs (7)

NameTypeDefaultDescription
modeCOMBOSave3 options: Create, Update, Save
nameoptSTRING
valueoptSTRING
negativeoptSTRING
idoptSTRING
favoriteoptBOOLEANfalse
example_imageoptIMAGE

Outputs (3)

NameTypeDescription
style_idSTRING
style_valueSTRING
style_negativeSTRING