Updstes:

  • 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.
  • Like if you like :)

The dynamic Duo at work, quickly explained (this is more or less the example workflow):

newllmnodes1

Prompt enhancer up close.

grafik

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)

promptdatabase2

A5LMStudio Prompt Enhancer (Also other localhost openai api servers!):

Little patches as mentioned above. I think all below is adjusted to it.

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. . Model change and 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:

Exampleworkflow2nodes

(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):

A5nodes

Added notes: To use the load and unload model switches, 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!

a5settings 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.")

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support