- now also on github and in ComfyUI manager. All of the nodes (10) in one repo. https://github.com/A5Projects/ComfyUI-A5Nodes
- little youtube video on these nodes and two more from the other repo. https://youtu.be/Hhowg7dzk-0
- A5Prompt_database: ComfyUI node to store many prompts,or any text, under a name, three selectable categories. Local (plain text!) storage only. Outputs the selected prompt on run.
- Firefox warning: There are currently unsolved issues in ComfyUI's nodes 2.0 with Firefox. I HIGHLY recommend using classic nodes with Firefox
- In nodes 2.0 both nodes work functionally, even in firefox.
- Updates:
- The dynamic Duo at work, quickly explained (this is more or less the example workflow):
- Prompt Database Node:
- A5LMStudio Prompt Enhancer (Also other localhost openai api servers!):
- Send any system prompt to a localhost server (Example LMStudio) and/or a user prompt (to improve) and/or a image. Then get the llm's enhanced prompt back, exportable as string for any text input in Comfyui.
Three modes "Always run LLM", "Use last prompt" (i.e. Manual Bypass, runs last extended prompt again, which can be manually edited!). And "Bypass if unchanged", also sends the last enhanced prompt, IF input image and prompt have not changed.
- New: server dropdown list. New Optional Comfymodel unload IF llm runs.
- Installation:
- NOT on github/comfyui Manager
- Added notes: To use the load and unload model switches, Or the new eject during run, LMStudio (not me) requires a API token to be set.
- Image below: You need those settings in LMStudio (left) set, for those features in the Node (Right) to work! Including a token set in LMStudio and entered in the node!
- How to copy a model id to add to the node? :
now also on github and in ComfyUI manager. All of the nodes (10) in one repo. https://github.com/A5Projects/ComfyUI-A5Nodes
i will update here sporadically if something major changes. But go there for the live maintained version and updated documantation.
little youtube video on these nodes and two more from the other repo. https://youtu.be/Hhowg7dzk-0
A5lmstudio_prompt_enhancer: Comfyui Prompt enhancer node, using a local model (localhost server, Lm Studio and others) Including INTELLIGENT loading/unloading and (Auto) bypass modes.
--
this image shows the current/recent ui version. As does the Youtube video. All other guides/images further down show the old one, which is functionally exactly the same!
A5Prompt_database: ComfyUI node to store many prompts,or any text, under a name, three selectable categories. Local (plain text!) storage only. Outputs the selected prompt on run.
VV Previous patch image and older patch notes: VV
- june 6/26- Prompt Enhancer node. now properly loads (as it should) configuration (model lists, token...) from existing config file when added to workflow
June 17/26, prompt enhancer. replaced manual pasting of model id with select Server model from dropdown menu.
August 17/26, Fixed node and textboxes shrinking on run. As extended solution new editor popout window for the enhanced/result/bypass promptEasier to edit, also has 5 last prompts stored (per workflow, per session). The bypass switch in here is disabled IF node is set to "Always run LLM".
Firefox warning: There are currently unsolved issues in ComfyUI's nodes 2.0 with Firefox. I HIGHLY recommend using classic nodes with Firefox
(in general tbh, 2.0 is crap) Where these nodes work, including the text field resizing options just added). If you have to switch to nodes 2.0 and it messes stuff up, reload the node, when back in classic node mode! Chromium works fine in both modes.
In nodes 2.0 both nodes work functionally, even in firefox.
But resizing nodes smaller seem to be broken (i tried fixing this node a LOT before realizing it being Comfy+firefox. The resizing inside the prompt enhancer node is made and pptimized for classic nodes.
Updates:
- August 24: minor updates (!!I'm gonna tighten the ui a bit soon, without updating the images. Functionally it stays exactly the same):
- popout text/edit box for the llm output/bypass: History extended to 20 last prompts (doubles as undo function, accessible only in the extended text box!). It now closes with clicking X OR pressing Esc when it is active!)
- Internally the timeout was raised drastically (thus the cancel button below), the defaults on dropping the node in a new workflow were chanegd. Stored ones are exacly the same.
- And a llm eject button on the enhancer, SHOULD eject the model form the server as emergency stop even mid run (Auto timeout was raised). (LMstudio: like loading and unloading LLM, this works only with server in token auth mode. See short guide lower down. That is a LMStudio requirement,not mine).
- Sorting admin for prompt DB to avoid it getting big with many entries. Now there is a dropdown menu with all prompts in that category (titles). And only the most recently used are shown as direct buttons like now. Both show the full prompt as tooltop on muse-over. Not retroactive, only after selcting one in the dropdown is it stored as recent one. Aim was to make the node more compact.
- August 30: after long trouble shoot (Thanks comfy+Firefox) final UI update. Prompt anhancer node is more compact, text fields can be inividually resized in classic node mode) In nodes 2.0 all works functionally but i don't use them and don't optimize for more than function there.
- UI change on Prompt enhancer node. Function stays the same, so i don't replace all screenshots! Reason: make it more compact and less accidental clicks of eject llm instead of edit text. VV
The dynamic Duo at work, quickly explained (this is more or less the example workflow):
They can be used individually of course.
Prompt Database Node:
Save multiple prompts (or whatever) with names, in three different categories (three separate sets of saved prompts). It's stored in the node's folder, in json file. so all saved prompts are available in any workflow in your comfy installation. Should be simple to understand.
Of course it doesn't have to be prompts. You can use it as simple database for whatever, any name and any text. Keep in mind it is saved in plain text in the nodes local folder! (a5prompt_database.json)
Click to expand
A5LMStudio Prompt Enhancer (Also other localhost openai api servers!):
Little patches as mentioned above. I think all below is adjusted to it except the compact UI). (the change of the model now also counts as change that cancels auto-bypass)
Send any system prompt to a localhost server (Example LMStudio) and/or a user prompt (to improve) and/or a image. Then get the llm's enhanced prompt back, exportable as string for any text input in Comfyui. Three modes "Always run LLM", "Use last prompt" (i.e. Manual Bypass, runs last extended prompt again, which can be manually edited!). And "Bypass if unchanged", also sends the last enhanced prompt, IF input image and prompt have not changed.
IF input prompt ot image has changed, it runs the LLM again, creating a new enhanced prompt, overwriting the old one.
This functionality is the main reason, i (i.e. Codex) made my own. So i don't have to copy and paste stuff betwen prompt and clip fields to use an already anhanced prompt again AND be able to make edits to it myself. . manual edits to the enhanced prompt are ignored in the bypass check!
Optional load/unload model for generation switches, (needs token set in LMSTUDIO, see below). dropdown for last used models, followed by all models the server lists. Selecting a model instead of "use Loaded Default" LMStudio requires api authentication enabled and token set!
New: server dropdown list. New Optional Comfymodel unload IF llm runs.
- More Options: Api token, max tokens, auto removes thinking blocks.
- NEW (17.june): No need to manually copy model names anymore thanks to dropdown. For more compatibility for openai api servers other than LMStudio, we use a more generic server get list instead of th neat LMStudio specific one. Combined with little algorithm to mark likely vision capable models.
- NEW option: Unload ComfyUi models from Vram (ONLY) if LLM is run. It will ONLY do that if the LLM is actually run. So IF lmstudio loads the llm to do your prommpt, it does not crash with a big Comfyui image model still in your vram.
Sending a image with your prompt requires a vision model to be,loaded of course. See community post (or node tooltips!) for some important details. Also keep in mind this was made for local use with a local llm, on a single computer. So it deliberately balances convenience and complexity with safety. The server token is never displayed in the node (XXX) BUT is saved in plain text in that json file.
Installation:
copy/clone directories or extract zip into Comfyui Custom_nodes (so it looks like this:
- \ComfyUI\custom_nodes\comfyui_A5lmstudio_prompt_enhancer\
- \ComfyUI\custom_nodes\comfyui_A5Prompt_database)
- There is no need to install both if you dont want. Each directoy / node works on it's own if copied into Custom_nodes
See community post for more details. (though as of now now basically the same as this readme). See example Workflow examples, using both nodes, under files.
NOT on github/comfyui Manager
New Workflow (Example workflow 2 db nodes , basically the same, just using two database nodes just to show an example. And this image shows the new enhancer node:
(this is the og example workflow under files, still perfectly fine.) (The prompt enhance node in this image is the old one! If you load it it wil be the new one):
Added notes: To use the load and unload model switches, Or the new eject during run, LMStudio (not me) requires a API token to be set.
But you don't need a token to just send it to whatever model the LMStudio server has currently loaded. Just disable the load/unload switches AND select "Use loaded Default Model" from the dropdown menu. and it's in easy mode (it sends to whatever LMStudip/the server has loaded). The "require authentication" option needs to be disabled in LMStudios server settings of course (else you need a api token!).
Image below: You need those settings in LMStudio (left) set, for those features in the Node (Right) to work! Including a token set in LMStudio and entered in the node!
ignore that the node is the old version. The options are still the same.
Also i recommend switching on "Unlaod Comfy models from Vram" to kick any comfy models out of vram before loading the lm studio model! Else LMStudio may try to load that xxGB LLM model while LTX or whatever is still in it. That option ONLY removes models from Vram, it does NOT empty cach or anything. And it does NOT execute, if the llm is bypassed.
How to copy a model id to add to the node? :
This has changed. Simply select a server from the dropdown menu. "Use loaded Default Model" from the dropdown menu to just send to whatever is loaded. The bypass functionality should still work (If input prompt or image have not changed, the last enhanced prompt is sent again. ) IF you added a new model to your server / LMStudio, you need to reload the prompt enhancer node (rigth click in it, "Reload node), to show it to the server list.")



