🧠 System Prompt
Give your local LLM a job before it answers
- MESSAGE
A system prompt is where you tell the model who it is and how to behave before it answers - the difference between "write a caption for this image" and getting "You are a meticulous captioning assistant. Describe composition, lighting, and subject in a single paragraph" as the actual instruction. 🧠 System Prompt is the node that sets that up in this pack: it wraps your text in a system role message and hands it down the wire as a MESSAGE object.
You can technically skip it - the pack's 👤 User Prompt works fine on its own and LM Studio models will happily chat with no system message at all. But for the things people actually build this pack for, the system prompt is where the quality lives. Prompt generation for image workflows, captioning for training sets, style drafting - all of those get dramatically more consistent when the instructions sit in the system message rather than being repeated in every user turn.
What it does
One input, one output.
- system_prompt - a multiline text box, defaulting to "You are a helpful assistant." That's your instructions field. Multiline means you can write real paragraphs: role, format, constraints, examples.
- MESSAGE (output) - a conversation object containing that single system message. Wire it into the
message_inof a👤 User Prompt, or directly into📡 LMStudio Request'smessageinput if you're doing a pure system + request call.
Under the hood it just builds the Message object the pack passes around (a list of {role, content} dicts, in the standard OpenAI shape) and adds one system entry. If you leave the field blank, it adds nothing and passes along an empty conversation. That's the whole mechanism - there's no magic, which is exactly why it composes cleanly with the rest of the pack.
The one habit worth building
Keep your instructions here, not in the user message. If you want every reply formatted a certain way - "always answer in JSON," "return only the tag list," "translate to English" - put it in the system prompt once. It saves you from re-typing it every turn and, more importantly, it keeps it out of the context that the model treats as conversation content. For captioning specifically, this is where you'd write the style guide that makes your training data consistent rather than a grab-bag (see the captioning section of the lora-training notes - caption quality still gates how well a LoRA learns).
Install
Same story as every node in the pack: ComfyUI Manager, search "LM Studio Tools", install, restart. Or git clone https://github.com/Hazukiaoi/ComfyUI-LM_Studio_Tools into ComfyUI/custom_nodes and restart. The pack's only Python dependency is requests, and nothing here downloads a model - the LLM lives in LM Studio, which needs to be running with its Local Server tab on.
A typical chain
Here's the shape of a working local-LLM workflow so you can see where this node sits:
⚙️ API Config ──────────────┐
🏷️ Select Model ────────────┤
🧠 System Prompt ─► 👤 User Prompt ─► 📡 LMStudio Request ─► output_text
The system prompt is the first link. It's also the node you'll tweak most often once the pipeline works - model behavior is much easier to steer here than by hunting through the request node's temperature and top_p sliders. Change the instructions, not the samplers.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| system_prompt | STRING | You are a helpful assistant. | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MESSAGE | MESSAGE | — |