T-山竹Kontext路径保存
The caption side of your Kontext training pair — it always saves the .txt
- image
The T-山竹Kontext路径保存 node (class TSZImageTaggerSave) is the sibling of the pack's R saver, and it's the half that does the captioning work. Where RSZImageTaggerSave writes your "before" reference images, this one writes the "after" targets as {prefix}0001_T.png - and it always writes the matching .txt, because its tag_text input is forced: you have to wire text into it, there's no way to leave it blank.
That's by design. In the T2ITrainer workflow this is where the edit instruction lands. The intended pipeline (there's an example workflow in the repo) is: load images → interrogate them with a Florence2 captioner → glue the results with ShanZhuTextJoin → feed the joined string into this node's tag_text. The text you save is the caption T2ITrainer associates with the pair, so the quality of your training set literally comes down to what you feed here. The usual lora-training wisdom applies: describe what you want to vary, leave what should stay fixed out of the caption.
How it works
Same save machinery as the R node: a per-node-instance counter running 0001→9999, filename_prefix defaulting to comfyui, output to custom_path or the default output dir, png/jpg with quality 80–100 (which also sets PNG compression). The only real differences are the _T suffix and the forced text input.
One quirk worth knowing: because tag_text is forceInput in the schema, in the graph you can't just type into it - you must wire a string in. If you're not running an interrogator, wire in any text node with your typed caption, or use the pack's own ShanZhuTextJoin as a passthrough. Blank lines in tag_text are stripped before writing, and the file is saved UTF-8, which keeps non-ASCII tags (including Chinese) intact.
The inputs that matter
The full set is image (wire from anything that outputs IMAGE), tag_text (forced string input), custom_path (where files land - blank means ComfyUI's output folder), filename_prefix, format (png/jpg), quality, and preview (shows the last saved image in the UI). It's an output node, so nothing comes out the other side; results appear in the image list.
Install and gotchas
Shared pack story: ComfyUI Manager search "ComfyUI_SZtools", or git clone https://github.com/Rocky-Lee-001/ComfyUI_SZtools into custom_nodes/, then restart. No model downloads; the only non-standard deps (imageio, tifffile) are for the pack's TIFF nodes.
The counter resets on every ComfyUI restart, so a second run silently overwrites the first - give each pass a fresh custom_path if you want to keep batches. And seriously, set an explicit path: if you leave custom_path blank, renamed training pairs pile into your main output folder alongside generations, which is exactly how you end up training on the wrong folder.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| tag_text | STRING | — | |
| custom_path | STRING | — | |
| filename_prefix | STRING | comfyui | — |
| format | COMBO | 2 options: png, jpg | |
| quality | INT | 10080–100 | — |
| preview | BOOLEAN | true | — |
Outputs (0)
No outputs