ComfyUI Node

Save Prompt

Save prompts to your own JSONL library — the pack's hidden loop

By clouddreamfly·Created about a year ago·Updated 8 months ago· 4
Save Prompt
      prompt
      filenamecustom

      Most prompt nodes give you a text string and let you get on with it. Save Prompt does something sneakier: it takes a prompt and appends it to a JSONL file inside the pack, one entry per run, so you can build up a searchable library of prompts you actually liked. It's the write half of ComfyUI-PromptWrapper's design - the same pack's builder nodes read JSONL datasets with exactly this shape ({"text": "..."} per line), so you're effectively feeding your saved favorites back into the machine.

      How it works

      The node is marked as an output node (OUTPUT_NODE = True), meaning it has no text output to wire onward - it's a side effect. When you run the graph, it writes:

      ComfyUI/custom_nodes/ComfyUI-PromptWrapper/user/<filename>_datas.jsonl
      

      in append mode, one JSON object per line, UTF-8, so Chinese prompts survive intact. Blank prompts and bare newlines are skipped. It returns the saved text to the UI so you can see it landed.

      Inputs

      Only two, and both are simple:

      • prompt - the text to save. It's forceInput, so it has to come from another node (a builder, a translation node, or a Combine Prompt) rather than being typed in place.
      • filename - the file's base name, default custom. Save a batch as custom and you get custom_datas.jsonl; pick a descriptive name and you get a themed file. Same filename = same file keeps growing.

      Install

      ComfyUI Manager → Custom Nodes Manager → search ComfyUI-PromptWrapper → Install → restart. Or the classic clone:

      cd ComfyUI/custom_nodes
      git clone https://github.com/clouddreamfly/ComfyUI-PromptWrapper
      

      No dependencies, no models. The whole pack is pure Python plus bundled data.

      Where people get burned

      The path surprises everyone once: it's not in your models folder, it's inside the custom node's own user/ directory. If you're hunting for your saved file, it's there, not in ComfyUI/output. Also note it appends forever with no dedup - run the same prompt twice and you get two lines. And because it's append-only, there's no overwrite or edit; you'll be cleaning the file by hand eventually if you treat it as a database.

      One honest caveat: on its own it just writes text. The loop only closes when you pair it with a node that reads JSONL - which this pack does, so it's worth keeping the whole pack installed even if you only came for the builder nodes. If you just want a persistent "save this prompt with the image" node and never touch JSONL, there are simpler tools.

      CategoryPromptWrapper

      Inputs (2)

      NameTypeDefaultDescription
      promptSTRING
      filenameSTRINGcustom

      Outputs (0)

      No outputs