Smart Save (Image)
Stop scrolling past ComfyUI_00417_.png
- images
You know the folder. ComfyUI/output/ with four thousand files in it, all named ComfyUI_00001_.png through ComfyUI_00417_.png, and the only way to find the one good Margot Robbie variant is to open them one at a time. The person who made Smart Save apparently got tired of that too.
What it actually does
Smart Save (Image) is a save node that doesn't ask you where the file goes. It reads your positive prompt, asks a local LLM who the picture is of, and files the result under that person's name:
ComfyUI/output/
├── Raw/Scarlett_Johansson/Scarlett_Johansson_00001.png
└── Compressed/Scarlett_Johansson/Scarlett_Johansson_00001.jpg
Two copies per generation: a PNG master for the archive and a JPEG for posting. When it genuinely can't tell who the subject is, it writes to Unsorted/ instead of inventing a name. That restraint is the right call.
The mechanism
Classification runs through a local Ollama server. The node POSTs to 127.0.0.1:11434/api/generate with llama3.2:3b at temperature: 0.0 and an instruction that boils down to "return the primary named person, actor, character, username or LoRA trigger - only that, and don't require them to be famous." Your prompt never leaves the machine, and there's no API key involved anywhere in this pack.
If Ollama is down or answers uselessly, the node doesn't give up - it falls back to regex on the prompt text: aliases.json entries first, then multi-word capitalized names ("Caitlin Clark"), then a capitalized word in person-shaped verb context. A stopped Ollama costs you accuracy, not your generation.
The PNG gets the standard ComfyUI treatment: prompt and workflow text chunks plus your positive prompt as user_positive_prompt, which means dragging the file back onto the canvas rebuilds the graph. The JPEG gets the prompt string in EXIF UserComment and nothing else - that format can't hold a node graph. Keep the PNG, publish the JPEG; that split is the whole reason both toggles exist.
Inputs worth touching
images is the batch in. filename_prefix defaults to auto, which uses the detected subject as the filename. (comfyui and an empty string also mean auto, so you won't get ComfyUI_00001 by accident.)
save_raw_png and save_compressed_jpg both default to on, and jpg_quality defaults to 90. If you're only posting these, 80 is invisible on screen and meaningfully smaller.
Then the optional ones, which is where new users trip. positive_prompt is declared forceInput, so there is no text box on the node - you wire it from a text node. Leave it unwired and the node digs through the API prompt JSON for the longest string that isn't a model filename, which usually works but is a guess. subfolder skips classification entirely (fine for client work). ollama_model lets you swap the tag if you've already pulled something bigger.
There are no outputs. RETURN_TYPES is empty, so nothing wires downstream; it's a terminal node like SaveImage. It does report the saved file back to the UI, so you get a preview on the node.
Install
Through ComfyUI Manager, search the pack title ComfyUI-SmartSave. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/phibbyrizz/ComfyUI-SmartSave.git
cd ComfyUI-SmartSave
python -m pip install -r requirements.txt
That's Pillow, piexif, numpy, imageio-ffmpeg and the ollama client - though the image node talks to Ollama over raw HTTP; the client package is for Auto-Sort. Use your ComfyUI's own Python (portable installs ship one), then:
ollama pull llama3.2:3b
Restart ComfyUI. The node shows up under image/saving, and there's a starter graph at Examples/basic workflow.json.
Where people get burned
Everything landing in Unsorted is nearly always one of four things: Ollama isn't running, the model tag isn't pulled, your prompt has no named subject, or positive_prompt is unwired while your prompt lives in a preset node the fallback can't see. Test the model directly with ollama run llama3.2:3b.
If your subject folder is named after a LoRA trigger word rather than a person, that's by design - the classifier is told to accept handles and triggers. Use aliases.json in the pack folder to normalise your own shorthand onto canonical names.
Two quieter ones. Disable both save toggles and the node logs "save skipped" and writes nothing - not a bug, just a no-op. And filename_prefix is sanitised as a filesystem name, so the %date:yyyy-MM-dd% templating from core SaveImage doesn't work here; the colons get stripped. Use subfolder for organisation instead.
The part that fixes the folder you already have
auto_sort.py is a standalone script in the same repo that scans an existing library, reads what metadata it can, recovers prompts from related raw/workflow files, and proposes the same subject structure. It's preview-only unless you pass --apply, and it leaves anything it can't resolve in Unsorted rather than guess:
python auto_sort.py --dir "path/to/ComfyUI/output"
python auto_sort.py --dir "path/to/ComfyUI/output" --apply --report report.json
Run the preview, read it, then apply. If you're pointing it at years of irreplaceable output, back the folder up first.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| filename_prefix | STRING | auto | — |
| save_raw_png | BOOLEAN | true | — |
| save_compressed_jpg | BOOLEAN | true | — |
| jpg_quality | INT | 901–100 | — |
| positive_promptopt | STRING | — | |
| subfolderopt | STRING | — | |
| ollama_modelopt | STRING | llama3.2:3b | — |
Outputs (0)
No outputs