LM Studio Chat
Chat with a local model that remembers — and can see images
- model
- images
- options
- responses
- queries
- conversation_name
Most nodes in the WAS LMStudio Easy-Query pack are fire-and-forget: send a prompt, get text, done. LM Studio Chat is the one that remembers. Every run appends your message to a conversation, sends the whole history to the model, and saves the new state back to disk as JSON - so the next run picks up exactly where you left off. It's the closest thing to "an LLM you can hold a real back-and-forth with" that lives inside a ComfyUI graph.
Conversations are stored in the pack's conversations/ folder, one .json per chat. On the node you'll find a conversation_choice dropdown that lists the ones you already have, plus a "New Conversation" option to start fresh. Type a name in conversation_name to name the new one, or leave it blank and it auto-generates. The pack is thoughtful about the fiddly parts: if the accumulated history threatens to blow past the model's context window, it checks token counts against the loaded context and truncates from the oldest messages, always preserving the system prompt. Long-running chats won't silently die on a context overflow.
Inputs worth caring about:
- model - the usual
LMSTUDIO_MODELfrom the Model node. - conversation_choice / conversation_name - pick an existing chat or start a new one. The tooltip spells out the pattern: keep it on "New Conversation" and type a name.
- mode -
one-by-onevsbatch, same meaning as Query: one request per image, or all images in one request. - system_prompt - if the conversation has no prior messages, this becomes the initial system message. Changing it later won't rewrite history.
- user_prompt - your message, appended and sent on this run.
- images (optional) - attach an image to the current message, resized to
image_max_size. Vision-capable chat, so you can ask follow-ups about what you just showed it. - temp_convo (optional, default off) - store the conversation in
temp_convos/instead. Everything there is wiped on ComfyUI startup, which makes it handy for throwaway brainstorming you don't want polluting your saved chats.
The outputs are responses (list of strings), queries (list - what was actually sent), and conversation_name (a string, so you can record which chat just ran if you're saving logs). Wire conversation_name into a text-save node and you can trace which conversation produced which output - useful when you're chaining several runs.
Installation is the pack install: ComfyUI Manager searching "WAS LMStudio Easy-Query", or
cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/ComfyUI_LMStudio_EasyQuery
restart, and pip install lmstudio numpy Pillow for the Python side. LM Studio needs to be running with a model loaded - nothing about this pack downloads models for you.
Two gotchas the README calls out. First, conversation selection errors: keep conversation_choice on "New Conversation" and type the name, or select an existing one from the dropdown - don't try to type a name while an old conversation is selected, that's where the confusion creeps in. Second, remember that a thinking model will happily dump its chain-of-thought into the saved history; if you don't want that in your log, either set max_tokens to -1 with the REST backend on the Model node, or strip thinking tags via an Options node. This one's a genuinely nice piece of the pack - the only node here that feels like a real product rather than a wrapper.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| model | LMSTUDIO_MODEL | Model settings including model_id, temperature, max_tokens, seed, and image_max_size. | |
| conversation_choice | COMBO | New Conversation | Pick an existing conversation or select 'New Conversation' to start a new one. Provide 'conversation_name' to name it, or leave blank to auto-generate. |
| conversation_name | STRING | If provided, creates/uses this conversation. If left blank, uses the dropdown selection. | |
| mode | COMBO | one-by-one | Batch sends all images in a single request; one-by-one sends one request per image. |
| system_prompt | STRING | System instructions for the assistant's behavior. If the conversation has no prior messages, this will be set as the initial system message. | |
| user_prompt | STRING | User message appended to the conversation and sent to the model on this run. | |
| imagesopt | IMAGE | Optional images to include with the user message. Resized to image_max_size. | |
| optionsopt | LMSTUDIO_OPTIONS | Per-request overrides (temperature, max_tokens, seed, top_p, top_k, penalties, stop). These take precedence over values from the Model node. | |
| temp_convoopt | BOOLEAN | false | Store/load conversation in a temporary workspace (cleared on startup). New conversations use temp when enabled. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| responses | STRING | — |
| queries | STRING | — |
| conversation_name | STRING | — |