Save Image (Swwan) · 旧版兼容
The KJ saver your old workflow still points at
- images
- filename
You almost certainly didn't go looking for this node. You loaded a workflow, it said you need SwwanSaveImageKJ, and here you are. That's the situation it exists for: it's the compatibility twin of KJNodes' SaveImageKJ, kept alive so migrated graphs keep behaving the way they did, with the pack's own Save Image (Swwan) as the recommended replacement.
Worth being precise about what "compatibility" means here, because the pack's naming is deliberate. Version 1.0.0 gave every ported node an independent Swwan-prefixed ID and explicitly does not register the original packs' node names - so this is not KJNodes' node under a new label, and installing Swwan doesn't turn on KJNodes. Display names carrying · 旧版兼容 tell you that you're on the history-preserving path and there's a newer entry point available.
How it works
Like the KJ original, this writes PNG, full stop, with compress_level = 4, and embeds the prompt and workflow chunks so the resulting file drags back into ComfyUI as a graph. filename_prefix goes through ComfyUI's own save-path resolver, which is where the useful templating lives - the author's own tooltip spells it out: the prefix "may include formatting information such as %date:yyyy-MM-dd% or %Empty Latent Image.width% to include values from nodes." That's how you get a folder-per-day or size-labelled output without a single extra node.
output_folder is the legacy wrinkle. An absolute path is created if missing and used as-is; a relative one is resolved against ComfyUI's output directory, with the pack applying its own resolver rather than the stock behaviour, so a value of Swwan gives you output/Swwan. Then it loops the batch, incrementing the counter per image, and returns the last filename written as a STRING. If caption is wired, it writes it as a same-basename sidecar .txt - the convention every trainer reads, where 0001.png and 0001.txt sit next to each other and the caption is read from the text file. caption_file_extension lets you change that suffix.
One thing to notice in the schema: both caption and, in the sibling string node, string are declared forceInput. They render as sockets, not text boxes. You can't type a caption into this node - you wire one in from a text primitive or a prompt node.
Inputs and outputs
Required: images (IMAGE - "the images to save"), filename_prefix (default ComfyUI), output_folder (default output). Optional: caption (STRING, wire only) and caption_file_extension (default .txt). Output: filename (STRING) - the last file written, not a list, which matters if you batch-save and expect to branch on all of them. It's an output node, so it always executes.
Install
It rides along with the pack:
cd /path/to/ComfyUI/custom_nodes
git clone https://github.com/aining2022/ComfyUI_Swwan.git
cd ComfyUI_Swwan
python -m pip install -r requirements.txt
Restart ComfyUI, hard-refresh the browser, search Swwan. The pack needs Python 3.11+ and ComfyUI's own torch/numpy/Pillow; the pinned extras are opencv-python, scipy and scikit-image. Numpy, Pillow, opencv - all this node itself touches is Pillow.
Where people get burned
You expected a format choice and there isn't one. PNG only. If you want JPEG/WebP/TIFF, per-image folders, real alpha handling or absolute paths back, you want the current entry point, SwwanSaveImage. The catalog maps SaveImageKJ → SwwanSaveImageKJ, recommended replacement SwwanSaveImage, and old IDs IO_save_image / IO_save_image_format / RGBA_Multi_Save also collapse onto SwwanSaveImage.
"It's already installed" and it isn't. Swwan doesn't claim KJNodes' names, so a workflow referencing KJ's own SaveImageKJ still shows up as a missing node until you either install KJNodes or migrate the workflow. Migrate with the shipped script - dry-run first, it writes a new file and leaves the original alone:
python scripts/migrate_workflow.py old.json --dry-run
python scripts/migrate_workflow.py old.json --swwan-node-id 35 --comfyui-root /path/to/ComfyUI
Folder/counter surprises. Absolute output_folder bypasses the output directory entirely, and if you point it somewhere you don't own on Windows you get a permission failure rather than a clean error. And PNG metadata is not free: with metadata embedded, every file carries your prompts and LoRA names. That's the sharing convention, and it's also a disclosure - --disable-metadata or a scrubber if that's not what you want.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | The images to save. | |
| filename_prefix | STRING | ComfyUI | The prefix for the file to save. This may include formatting information such as %date:yyyy-MM-dd% or %Empty Latent Image.width% to include values from nodes. |
| output_folder | STRING | output | The folder to save the images to. |
| caption_file_extensionopt | STRING | .txt | The extension for the caption file. |
| captionopt | STRING | string to save as .txt file |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| filename | STRING | — |