Save Image(Primary-TJ)
Save Image (Primary-TJ)
- images
- IMAGE
- FILEPATH_JSON
When you upscale, detail-pass, or compare, where do the results go? If the answer is "randomly numbered files scattered across output/," you've met the problem Save Image (Primary-TJ) exists to solve. It's the first node in TJ_NODE's save pipeline: it establishes a filename family and hands downstream nodes the exact paths, so every derived result stays grouped under one name instead of becoming orphans.
How it works
The pipeline idea is simple. Primary-TJ saves the base image (your generation, say) and outputs a FILEPATH_JSON string - a JSON list of the full paths it just wrote. You feed that string to the pipeline's next node, Save Image (Suffix-TJ), and the suffix node saves its image next to the base file under a suffixed name. Result: main.png, main_upscale.png, main_detail.png, main_compare.png - one family, easy to find, easy to delete together. It's a small structural habit, but it's the difference between "which file was the upscale of which?" and a clean result folder.
The inputs:
images- the batch to save.filename_prefix- the family name (defaultTJ_Out). This becomes the base of every filename.subfolder- an optional subfolder to put it in, for keeping projects separate.date_folder- off by default; turn on and files go underYYYY-MM-DD/so your output folder self-organizes by day.
Outputs:
IMAGE- the batch, passed straight through, so you can keep the chain going after saving.FILEPATH_JSON- the JSON array of written paths. This is the pipeline glue; it's the whole reason the suffix node exists downstream.
Installing it
Standard pack install:
cd ComfyUI/custom_nodes
git clone https://github.com/designloves2/ComfyUI-TJ_NODE
or ComfyUI Manager → ComfyUI-TJ_NODE → restart. No dependencies beyond the pack.
Common issues
Collision handling is the thing to understand: like the built-in Save Image, it auto-increments a counter when a filename already exists (main_00001.png, main_00002.png), so you'll never overwrite - but that also means rerunning the same workflow keeps adding new family members rather than replacing them. If you want a fixed name each run, delete or move the old family first. And don't confuse this with the standalone "Save with original names" node - Primary-TJ is about pipeline-generated names, not source filenames. Use Primary-TJ when you're building a save chain that groups a generation with its derivatives; it's the anchor the whole family hangs from.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| filename_prefix | STRING | TJ_Out | — |
| subfolder | STRING | — | |
| date_folder | BOOLEAN | false | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| FILEPATH_JSON | STRING | — |