Comfyui_LLM-
A custom ComfyUI node that generates ready-to-use image prompts with cloud or local multimodal language models.
ComfyUI LLM++
A custom ComfyUI node that generates ready-to-use image prompts with cloud or local multimodal language models.
The node accepts text and an optional image, sends them to the selected model,
and returns the generated prompt as a STRING. The output can be connected to
CLIP Text Encode, prompt processors, translation nodes, or any other node
that accepts text.
Supported Models
- Mistral:
mistral-large-2512 - Gemini:
gemini-3.6-flash,gemini-3.5-flash,gemini-3.5-flash-lite,gemini-3.1-flash-lite,gemini-2.5-pro,gemini-2.5-flash, andgemini-2.5-flash-lite - Groq:
qwen/qwen3.6-27b - Local LM Studio models through its OpenAI-compatible API
Image support in LM Studio depends on the selected model. A text-only model may reject requests containing images.
Installation
Place the project directory inside:
ComfyUI/custom_nodes/Comfyui_LLM++
Restart ComfyUI completely and refresh the browser page.
Required Python packages:
requestsPillownumpy
These packages are usually already available in ComfyUI. If they are missing,
install requirements.txt using the same Python or UV environment that runs
ComfyUI.
API Settings
Open:
Settings -> LLM++ -> API and image settings
Mistral
- Create an API key in your Mistral account.
- Enter it in
Mistral API key. - Select
mistral: mistral-large-2512in the node.
Gemini
The same Gemini API key is used for all listed Gemini models.
- Create a Gemini API key in Google AI Studio.
- Enter it in
Gemini API key. - Select a model with the
gemini:prefix.
Groq
- Create an API key in GroqCloud.
- Enter it in
Groq API key. - Select
groq: qwen/qwen3.6-27b.
Groq requests use non-thinking mode and support up to three images per request.
LM Studio
- Start LM Studio.
- Load a model.
- Enable the Local Server.
- Check the server address. The default value is:
http://127.0.0.1:1234/v1
- Enter the address in
LM Studio API base. - Set
LM Studio API keyonly if the server requires authentication. - Click
Refresh LM Studio modelson the node. - Select a model with the
lmstudio:prefix.
Refresh the model list after starting LM Studio, changing its server address, or loading another model.
Image Settings
The LLM++ settings section includes:
Image maximum side (px)— maximum length of the image's longest side. Default:768.Image maximum JPEG size (KB)— target maximum JPEG size. Default:400.
Before an image is sent to an API, it is automatically:
- converted to RGB;
- resized while preserving its aspect ratio;
- compressed as JPEG;
- encoded for the API request.
The node supports ComfyUI image batches containing up to 30 images.
Using the Node
Add:
LLM++ -> LLM++ Prompt
A basic workflow can be connected as:
Load Image -> LLM++ Prompt -> CLIP Text Encode
The image input is optional. The node can also improve or expand a text prompt without an image.
Prompt Presets
The LLM++ Prompt node includes a Preset dropdown above the prompt field.
Selecting a preset copies its text into the normal prompt input, so workflows
save the exact instruction text and do not depend on the preset file later.
Use Edit presets on the node to manage reusable instructions:
Newclears the editor so a new preset can be created.Saveupdates the current preset or creates a new one when the name is new.Duplicatecopies the current preset under a new editable name.Deleteremoves the selected preset after confirmation.
Presets are loaded lazily by the browser UI. ComfyUI startup only registers the API routes; preset text is read when a preset is selected or edited.
For advanced users, presets are stored as UTF-8 .txt files in:
presets/
The folder is local user data and is ignored by git. If the folder does not exist yet, the extension creates the default presets on first use.
Inputs
prompt
The instruction sent to the model.
Examples:
Describe the image as a detailed English image generation prompt.
Rewrite this idea into a detailed cinematic image prompt.
Describe the image using comma-separated SDXL tags.
image
An optional ComfyUI IMAGE input. Image batches are supported.
model
The provider and model used for prompt generation.
temperature
Controls response variation. Lower values are usually more consistent, while higher values produce more varied results.
max_tokens
The maximum number of output tokens generated by the model.
top_p
Controls nucleus sampling.
Prompt to Improve
Optional source prompt sent to the model together with the prompt instruction.
Use this when you want the model to rewrite, improve, adapt, or expand an
existing prompt.
auto_unload_lmstudio
Unloads the selected LM Studio model after receiving the response.
Every run
Controls when the node sends a new API request.
Enabled
Generates a new prompt every time the workflow is queued or run.
This is the default. Use it when you want a different prompt variation on every workflow execution.
Disabled
Generates the prompt once and lets ComfyUI cache the result. A new API request
is sent only when an input of the LLM++ Prompt node changes, including:
- prompt text;
- prompt to improve;
- input image;
- selected model;
- temperature,
max_tokens, ortop_p; - other node parameters.
Changing a seed or a parameter in a downstream image-generation node does not regenerate the prompt. This makes it possible to generate multiple images from the same prompt without repeating API requests.
Disabling Every run also preserves the most recently generated prompt, as long
as the other inputs of the node have not changed. If no prompt has been
generated for those inputs yet, the node sends one API request and then caches
the result.
Output
prompt— the generated prompt as a ComfyUISTRING.
Connect it to any node that accepts text.
Example Workflow
- Configure an API key or start LM Studio.
- Add the
LLM++ Promptnode. - Optionally connect an image.
- Enter an instruction in
prompt. - Select a model.
- Configure
temperature,max_tokens, andtop_p. - Leave
Every runenabled for a new prompt on each execution, or disable it to reuse the generated prompt until an input changes. - Connect the
promptoutput to the required text input. - Queue the workflow.
Local Configuration
Settings are stored locally in:
llm_prompt_config.json
This file is excluded by .gitignore because it may contain API keys. Do not
commit, publish, or share it.
Troubleshooting
API key is not set
Open Settings -> LLM++ and configure the API key for the selected provider.
LM Studio models are not displayed
Check that:
- LM Studio is running;
- the Local Server is enabled;
LM Studio API basecontains the correct address;Refresh LM Studio modelswas clicked after starting the server.
An LM Studio model does not accept images
The selected model is probably text-only. Use a multimodal vision model or
disconnect the image input.
The prompt is regenerated on every workflow run
Disable Every run and make sure the inputs of the LLM++ Prompt node remain
unchanged.
A new prompt is required on every workflow run
Enable Every run.