Nodes/Smart Prompt Manager/Smart Prompt Manager
ComfyUI Node

Smart Prompt Manager

Your whole library, random variables, and reproducible seeds in one node

By helto4real·Created 4 months ago·Updated 2 months ago· 0
Smart Prompt Manager
    • resolved_prompt
    • raw_prompt
    • prompt_name
    • variables_json
    • selected_values_json
    • warnings_json
    spm_data{ "cycleState": {}, "folders": [ { "hidden": false, "id": "folder_c4a9d0a675d5", "name": "Portraits" } ], "privacyMode": false, "prompts": [ { "createdAt": "2026-08-21T05:37:31Z", "description": "Starter prompt showing Smart Prompt Manager variables.", "favorite": false, "folderId": "folder_c4a9d0a675d5", "hidden": false, "id": "prompt_f806308846cb", "locked": false, "tags": [ "portrait", "cinematic" ], "text": "A {{mood}} cinematic portrait of {{character}} in {{lighting}}.", "title": "Cinematic portrait", "updatedAt": "2026-08-21T05:37:31Z" } ], "search": "", "selectedFolderId": "all", "selectedPromptId": "prompt_f806308846cb", "ui": { "collapsedSections": {} }, "variables": { "character": { "description": "Main subject.", "fallback": "astronaut", "fixedValue": null, "mode": "random", "values": [ "cyberpunk detective", "medieval knight", "astronaut" ] }, "lighting": { "description": "Lighting setup.", "fallback": "soft studio light", "fixedValue": null, "mode": "random", "values": [ "golden hour", "neon rim light", "soft studio light" ] }, "mood": { "description": "Overall emotional tone.", "fallback": "dreamy", "fixedValue": null, "mode": "random", "values": [ "dreamy", "melancholic", "dramatic" ] } }, "version": 1 }
    seed0
    reroll0

    Smart Prompt Manager is a prompt library that lives inside a node. Instead of a pile of text files or copy-pasting from your notes app, you store your prompts in folders, mark favorites, add tags, and drop {{variable}} tokens into the text - and the node picks a value per generation, deterministically. It's the "randomize my prompt" trick without losing control of the result.

    The wildcard idea itself is old - the {a|b|c} bracket trick has been a community staple for batch variety, and the KB's prompt-engineering essay notes most people who arrived after 2024 never learned that A1111 syntax. This node is the modern version: double-brace variables, a visual editor, and, crucially, seeded randomness. Same prompt, same seed, same reroll value, same resolved text. Every time. That reproducibility is the thing that separates it from Dynamic-Prompts-style chaos, and it's what makes it usable in real batch workflows like generating a character reference sheet across different moods and lighting.

    How it works

    You write prompts with double-brace tokens: A {{mood}} cinematic portrait of {{character}} in {{lighting}}. Each variable holds a list of values, a mode, and an optional fallback. The resolver (a small pure-Python module that also runs in the browser for live previews) walks the text and replaces each token:

    • random - hashes seed:reroll:varname with a stable FNV-1a hash to pick an index. Deterministic, cross-language, and the same variable used twice in one prompt always resolves to the same value.
    • fixed - uses fixedValue, then fallback, then the first value. Seed-proof.
    • cycle - advances (cycleState[name] + reroll) % number_of_values, for stepping through a list in order.

    Missing variables don't crash the node. The token stays in the text verbatim and a warning is recorded - which means a typo like {{charater }} (space, invalid name) will show up literally in your image unless you check warnings_json. That's the main trap, and it's easy to miss when the preview looks clean.

    Inputs and outputs that matter

    The node has exactly three inputs:

    • spm_data - your entire library (prompts, folders, variables, selection) as JSON. It's a widget, so each node instance owns its own library and both survive save/load. This is also why the node's JSON in a saved workflow can get chunky; that's by design.
    • seed - the normal seed, and it defaults to fixed after generation (no auto-randomize).
    • reroll - the intended variety knob. Bump it or hit the reroll icon to get a different random selection without touching your image seed.

    Outputs are all strings: resolved_prompt (wire this into a CLIP Text Encode), raw_prompt, prompt_name, plus variables_json, selected_values_json, and warnings_json for scripting or debugging. Beginners: resolved_prompt goes into the positive CLIP encoder, not the checkpoint loader.

    Installation

    ComfyUI Manager (search "Smart Prompt Manager"), or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/helto4real/comfyui-helto-smartprompt
    

    Then restart. Manager handles requirements; if you clone manually, install them with the same Python that runs ComfyUI:

    python -m pip install -r custom_nodes/comfyui-helto-smartprompt/requirements.txt
    

    The node appears under Helto/Prompt → Smart Prompt Manager. No models to download, no API keys. Dependencies are light: cryptography plus helto-privacy, and both are only needed for Privacy mode.

    What bites people

    • Privacy mode encrypts the saved library in your workflow JSON (AES-256-GCM) with a shared keystore at ~/.config/helto/privacy_keystore.json. It's off by default, and if you turn it on, back that file up - lose the keystore, and encrypted workflows are gone. It only protects against sharing a workflow file anyway, not against anyone with access to your machine.
    • Hidden previews mask prompt text in the UI and in the node on screen (for streaming/recording), but the prompt editor popup still shows everything because opening it is an explicit action.
    • The JavaScript UI mirrors the backend resolver, but the Python side is the source of truth - trust the actual node outputs, not the preview, if they ever disagree.

    Copy/paste portability is one of the nicer touches: prompt JSON carries its own variable definitions, so you can move a prompt between nodes or workflows and missing variables get created for you. The pack is new and tiny in the wild so far (the author is a familiar, helpful voice in r/comfyui), but it's well-tested and the feature set is genuinely practical - this is the prompt-library node I'd reach for if I wanted one node instead of a folder full of text files.

    CategoryHelto/Prompt

    Inputs (3)

    NameTypeDefaultDescription
    spm_dataSTRING{ "cycleState": {}, "folders": [ { "hidden": false, "id": "folder_c4a9d0a675d5", "name": "Portraits" } ], "privacyMode": false, "prompts": [ { "createdAt": "2026-08-21T05:37:31Z", "description": "Starter prompt showing Smart Prompt Manager variables.", "favorite": false, "folderId": "folder_c4a9d0a675d5", "hidden": false, "id": "prompt_f806308846cb", "locked": false, "tags": [ "portrait", "cinematic" ], "text": "A {{mood}} cinematic portrait of {{character}} in {{lighting}}.", "title": "Cinematic portrait", "updatedAt": "2026-08-21T05:37:31Z" } ], "search": "", "selectedFolderId": "all", "selectedPromptId": "prompt_f806308846cb", "ui": { "collapsedSections": {} }, "variables": { "character": { "description": "Main subject.", "fallback": "astronaut", "fixedValue": null, "mode": "random", "values": [ "cyberpunk detective", "medieval knight", "astronaut" ] }, "lighting": { "description": "Lighting setup.", "fallback": "soft studio light", "fixedValue": null, "mode": "random", "values": [ "golden hour", "neon rim light", "soft studio light" ] }, "mood": { "description": "Overall emotional tone.", "fallback": "dreamy", "fixedValue": null, "mode": "random", "values": [ "dreamy", "melancholic", "dramatic" ] } }, "version": 1 }
    seedINT00–18446744073709550000
    rerollINT00–4294967295

    Outputs (6)

    NameTypeDescription
    resolved_promptSTRING
    raw_promptSTRING
    prompt_nameSTRING
    variables_jsonSTRING
    selected_values_jsonSTRING
    warnings_jsonSTRING