Unsloth Studio Bridge (CRT)
Talk to whatever model is loaded in Unsloth Studio, straight from your graph
- image
- response
If you use Unsloth Studio - the local LLM app that lets you load, chat with, and fine-tune models through a llama.cpp server - you've probably wished you could reach the model you've already got open from inside a ComfyUI graph. This node is that bridge. You drop it in, type a prompt, and the answer comes back as a string you can wire into prompt builders, captioning, or a text pipeline. It doesn't load its own model; it talks to the one you've already loaded in Studio. The name is the honest description: it's a bridge.
How it works
On each run the node connects to the llama-server instance that Unsloth Studio is running locally (default http://127.0.0.1:8888 - but leave it alone and it auto-discovers Studio's active port from its logs), builds a chat request from your prompt plus any system prompt, and returns the model's response. Because it rides on Studio's server, the model itself stays where it is - no second copy of a multi-GB LLM being loaded into ComfyUI's memory. It reads the server's context length and validates your prompt fits before sending, which is a nice touch: over-long prompts fail with a clear message instead of a mangled response.
The interesting extras are the two context features:
skills_path- point it at a folder of.mdfiles and every one (recursively) gets appended to the system prompt as extra context. That's how you give the LLM a "knowledge pack" without pasting text into a widget.reuse_context(default on) - keeps the system prompt and skills in the llama-server slot cache between runs, so repeated runs only evaluate the new user content. It's a real speedup for iteration loops. When you edit the system prompt or a skill file, it detects the change and rebuilds the cache once. Leave it on.
Inputs and outputs that matter
promptandseed- required. The seed feeds the deterministic sampler; bump it for variety.image- optional, but only if the loaded model is vision-capable, which the tooltip says plainly. Feed an IMAGE batch in and it's attached to the request.system_prompt- the persistent instruction block.disable_thinking(default on) - asks the server for a direct answer instead of a thinking-mode preamble; models that ignore the option just ignore it.include_reasoning(default off) - appends the model'sreasoning_contentto the response when the server provides it.clear_prompt_cache(default off) - wipes slot 0 after generation, forcing a full reprocess next time. Leave off unless you're debugging context bleed.
Output is a single response STRING. That's it - one output, because it's a tool, not a pipeline.
Where people get stuck
Three things, all documented in the tooltips, all annoying if you miss them:
- Studio must stay open and have a model loaded. This isn't a loader; if Studio is closed or empty, there's nothing to talk to. It's the first thing to check when you get a connection error.
- Images need a vision model. Feed a picture to a text-only model and it fails. The node doesn't gate this for you.
- Port discovery. The default usually just works via log scanning, but if you've changed Studio's port or run llama-server elsewhere, set
unsloth_server_urlto the reachable base URL to bypass discovery entirely.
Install
Part of CRT-Nodes:
cd ComfyUI/custom_nodes
git clone https://github.com/PGCRT/CRT-Nodes
pip install -r requirements.txt
Or ComfyUI Manager → search CRT-Nodes, then restart. It talks plain HTTP to llama-server, so it needs no heavy LLM deps inside ComfyUI - the heavy lifting happens in Unsloth Studio itself.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | — | |
| seed | INT | 00–18446744073709550000 | — |
| imageopt | IMAGE | Optional image batch. The model loaded in Unsloth Studio must support vision input. | |
| unsloth_server_urlopt | STRING | http://127.0.0.1:8888 | Leave the default to discover Studio's active local llama-server port from its logs. Enter a reachable non-default llama-server base URL to bypass discovery. Studio must have a model loaded; image input requires a vision-capable model. |
| system_promptopt | STRING | — | |
| skills_pathopt | STRING | Optional directory with skill files. Every .md file in the folder and its subfolders is loaded recursively and appended to the system prompt as extra context. | |
| disable_thinkingopt | BOOLEAN | true | Request a direct answer by disabling supported model thinking mode. Models that ignore this chat-template option are unaffected. |
| include_reasoningopt | BOOLEAN | false | Append reasoning_content returned by the server to the response output when the loaded model provides it. |
| reuse_contextopt | BOOLEAN | true | Keep the system prompt and skill files in the llama-server slot cache between runs: only the new user content (image + prompt) is evaluated, making repeated runs much faster. Editing the system prompt or a skill file changes the prefix and automatically rebuilds the cache once. |
| clear_prompt_cacheopt | BOOLEAN | false | Erase llama-server slot 0 after generation, forcing the next run to reprocess the full prompt. Leave off to keep context reuse. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| response | STRING | — |