Nodes/OmniNodes/Response Saver πŸ’Ύ
ComfyUI Node

Response Saver πŸ’Ύ

Persist an API response to disk before it evaporates

By TensorVizionΒ·Created 3 months agoΒ·Updated about 8 hours agoΒ· 0
Response Saver πŸ’Ύ
  • content
  • saved_path
  • summary
β—„output_diroutput/tensorvizion/web_apiβ–Ί
β—„filenameresponseβ–Ί
β—„formatjsonβ–Ί
β—„pretty_printtrueβ–Ί

Web API workflows have a problem: everything happens in memory. HTTP Request fetches a response, JSON Field Extractor pulls a value out of it, and then the queue run ends and the data is gone. Response Saver πŸ’Ύ is the exit point that fixes it - it writes a JSON or text response to disk with a collision-avoiding numbered filename, so a batch of API calls leaves a batch of saved files instead of a stack of evanescent in-graph values.

It's the pack's answer to "request β†’ poll β†’ parse β†’ save," the closing bracket on the Web API category. Wire anything into it and it persists.

How it works

The content input is a wildcard socket (*), so it accepts a JSON dict/list or a plain string on the same wire - sit it directly after HTTP Request's response_json or response_text, or after JSON Field Extractor. Dicts/lists are pretty-printed on save; strings are saved verbatim unless format="json" and the string happens to parse, in which case it's re-parsed and pretty-printed. output_dir defaults to output/tensorvizion/web_api, filename to response.

The collision handling is the detail that makes repeat runs safe: if the target filename already exists, it appends _001, _002, and so on, matching the numbering convention the pack's Video Save and Custom Folder Batch Saver use. Run the same workflow fifty times and you get fifty files, none overwritten.

The inputs that matter

content (the wire), output_dir, filename, format (json/txt), and pretty_print (on by default). Outputs are saved_path and summary - the saved path is the one to wire into a log or text display so the run tells you where the data landed.

It's an output node (ComfyUI gives it a queue slot), which is exactly right: like Save Image, it's a terminal endpoint. It's also in the Web API category, meaning it's one of the few OmniNodes that needs the requests-adjacent install step - though Response Saver itself only uses the standard library, its category siblings (HTTP Request, OAuth2, RSS, Endpoint Poller) don't.

Installing it

cd ComfyUI/custom_nodes/
git clone https://github.com/TensorVizion/OmniNodes
cd OmniNodes
pip install -r requirements.txt

Then restart ComfyUI (ComfyUI Manager: search "OmniNodes"). Install into the same Python environment ComfyUI runs in. If it fails to import with a missing requests error, the requirements step is what you skipped.

One honest caveat: saved JSON is only as good as the response that produced it. If the upstream API returned an error body, Response Saver will happily save that error body - check the summary output, or put a conditional on the status before wiring the content through. For successful runs, it's the simplest way to keep a permanent record of what an API workflow actually did.

CategoryTensorVizion/Web API

Inputs (5)

NameTypeDefaultDescription
content*β€”
output_dirSTRINGoutput/tensorvizion/web_apiβ€”
filenameSTRINGresponseβ€”
formatCOMBOjson2 options: json, txt
pretty_printBOOLEANtrueβ€”

Outputs (2)

NameTypeDescription
saved_pathSTRINGβ€”
summarySTRINGβ€”