VRGDG_SaveTextAdvancedConcat
The text-saver that grows a JSON list as you go
- text
- file_path
- json
- json_string
VRGDG_SaveTextAdvancedConcat is VRGDG_SaveTextAdvanced with an accumulation mode bolted on. Same folder_name, file_name, text, and trigger inputs - but there's a new concat boolean and the output side grows a json and a json_string. When concat is on, each run appends to the file instead of replacing it, and it tracks what you've accumulated as a JSON array. It's the node you use when a workflow generates pieces of a story one at a time and needs them collected into one growing structure.
How it works
Required inputs:
folder_name/file_name- where it writes (both default tostory, so name them or two of these will collide).overwrite- note this defaults tofalsehere, unlike the plain Advanced node. The default posture is "don't clobber," because this node is built for accumulation.concat- the switch that makes it accumulate. Off, it behaves like the plain saver: write the text, done. On, it appends and maintains the running JSON array.text- the chunk to add.trigger- the integer "run it now" pedal. Bump it to force an append even when the text didn't change.
Outputs: text and file_path as before, plus json (the accumulated entries as a real JSON object you can wire into a JSON-consuming node) and json_string (the same thing as text, for when you want to eyeball it or pass it to something that only reads strings).
The pattern in practice: a storyboard loop runs N times, each pass generates one scene's worth of data, and this node appends each chunk into a single JSON array that the final assembly stage reads. You get persistence and structure - the file on disk is your record, the json output is the live view.
The one trap
The overwrite default being false plus concat existing is a recipe for stale data. If you've run the workflow before, the file already has last run's entries, and concat will happily build a new run on top of old ones. When you want a clean slate, that's what overwrite is for - or delete the file. People hit "my storyboard has duplicates" and it's almost always last run's data still sitting in the file.
Install
Standard pack install:
cd ComfyUI/custom_nodes
git clone https://github.com/vrgamegirl19/comfyui-vrgamedevgirl
or ComfyUI Manager → "vrgamedev" → restart, then the pack's requirements.txt (kornia, librosa, imageio) installs with it - on Windows portable, run it from python_embeded.
This is a workflow node, not a general-purpose one. If you're not collecting chunks of story data into a list, the plain SaveTextAdvanced is simpler. If you are, though, this saves you the whole "read the file, parse it, append, rewrite it" rigmarole that you'd otherwise be building by hand.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| folder_name | STRING | story | — |
| file_name | STRING | story | — |
| overwrite | BOOLEAN | false | — |
| concat | BOOLEAN | false | — |
| text | STRING | — | |
| trigger | INT | 00–18446744073709550000 | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |
| file_path | STRING | — |
| json | JSON | — |
| json_string | STRING | — |