Nodes/comfyui-prompt-shelf/String Shelf Editor
ComfyUI Node

String Shelf Editor

Where saved prompts are born (and the unique-name gotcha)

By timonknispel·Created 4 months ago·Updated 4 months ago· 0
String Shelf Editor
      keydefault
      text
      name

      Every saved prompt fragment in comfyui-prompt-shelf starts here. String Shelf Editor has no outputs - like its resolution sibling, it's a management node you keep off to the side, not part of the generation path. You use it to create and maintain the named strings that String Shelf reads, and the shelf nodes pick up your changes live.

      Three inputs, and each maps to one piece of a saved entry. key is the group the string belongs to (character, style, whatever you invent). name is the short label shown in dropdowns. text is the full multiline string itself. Then the node's buttons do the writing: Save current string adds a new entry, Update current string replaces the selected one, Remove selected string deletes it.

      The mechanism is the same browser-API pattern as the resolution editor. The node's Python is a no-op; the buttons fire POST and DELETE calls at the server's /prompt-shelf/strings route, and the server writes to user/strings.json inside the pack folder. That file is an overlay on the repo's defaults/strings.json, so the bundled example fragments stay put across updates, your own strings live separately, and if you delete a bundled one, the deletion itself is remembered in the user file. Update the pack and your personal shelf survives - the design intent of the whole pack, spelled out in the README.

      The gotcha comes straight from the pack authors' own example-workflow notes, and it's the one thing that will bite you: names must be unique under a key. If you pick an existing name from the dropdown and save, you're updating that entry, not creating a parallel one. And to save a brand-new name, you have to set the saved-string dropdown to No saved string first - the authors admit it's "a manual step sadly required for updating existing names." So the flow is: pick the key, set No saved string, type a new name and text, hit Save current string. For edits, select the existing name, change the text, hit Update current string.

      Install is the whole pack in one shot and it's the easy kind - no requirements.txt, no model downloads, nothing that can conflict with your other nodes. ComfyUI Manager search for comfyui-prompt-shelf, or:

      cd ComfyUI/custom_nodes
      git clone https://github.com/timonknispel/comfyui-prompt-shelf
      

      Restart ComfyUI, refresh the browser, and the Prompt Shelf category has everything.

      Two reminders. First, nothing saves until you click a button - typing text and walking away means you made no change. Second, your strings live in custom_nodes/comfyui-prompt-shelf/user/strings.json; if you delete the pack folder to reinstall, that file goes with it. It's plain JSON, so backing it up is a copy command, and it's worth it once you've built a real library.

      CategoryPrompt Shelf

      Inputs (3)

      NameTypeDefaultDescription
      keySTRINGdefault
      textSTRING
      nameSTRING

      Outputs (0)

      No outputs