Save String List To JSON JK๐
Persist your presets โ save a string or list to a JSON file
- string_output
ComfyUI workflows are great at using data and terrible at keeping it. Generate a camera trajectory, a prompt list, or a set of per-scene settings, and the moment you close the session it's gone - unless you save it somewhere. Save String List To JSON JK writes a string (or a parsed JSON list) to a file on disk, so your presets survive the restart. It's the write half of the pack's save/load JSON pair, and Jake built it for a very concrete reason: ATI trajectory presets for Wan video workflows.
What it does
Four inputs:
- string_input - the text to save. This can be a plain string or a JSON-formatted list.
- file_path - the full filesystem path to write to. No path, no save - it prints an error and bails.
- overwrite (default
True) - ifFalseand the file already exists, it skips writing and leaves the existing file alone. This is your "don't clobber my presets" guard. - save_as (default
True) - ifTrue, it tries to parsestring_inputas JSON and writes it out pretty-printed (formatted with indentation). IfFalse, it writes the raw string. If parsing fails, it falls back to string mode with a warning rather than crashing.
It also creates parent directories automatically, which is a small mercy - you don't need to pre-make the folder.
The output
string_output echoes back what you gave it. It's a pass-through for convenience (so you can chain a save into the rest of the graph without breaking the wire), not a result you should expect to be different.
When it's worth it
The canonical use: generate something expensive or finicky once - a camera path, a beat list, a curated prompt set - and save it. Next session, load it back with the pack's Load String List From JSON JK and skip the regeneration. It's also great for editing presets outside ComfyUI: save a list, tweak the JSON in a text editor, reload, and your workflow picks up the changes without a rebuild.
Note the v2.7.2 change: it now saves as a list by default rather than a raw string - so if you're passing a list-like string, save_as on is the behavior you want for round-tripping with the loader.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/jakechai/ComfyUI-JakeUpgrade
pip install -r requirements.txt
No models, pure file I/O. Gotchas are the usual filesystem ones: give it an absolute path (relative paths resolve against the ComfyUI working directory, which is rarely where you think it is), and remember overwrite = False will silently skip - if you save, see no error, and the file looks stale, check whether overwrite got flipped off.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| string_input | STRING | String data to save to JSON file | |
| file_path | STRING | Full path to JSON file for saving | |
| overwrite | BOOLEAN | true | Overwrite existing file if True, skip if False |
| save_as | BOOLEAN | true | If True, parse string_input as JSON list and save formatted; if False, save as raw string |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| string_output | STRING | โ |