Nodes/CRT-Nodes/Unsloth Studio Bridge (CRT)
ComfyUI Node

Unsloth Studio Bridge (CRT)

Talk to whatever model is loaded in Unsloth Studio, straight from your graph

By PGCRT·Created 2 years ago·Updated about 21 hours ago· 137
Unsloth Studio Bridge (CRT)
  • image
  • response
prompt
seed0
temperature-1.00
top_p-1.00
top_k-1
unsloth_server_urlhttp://127.0.0.1:8888
skills_path
disable_thinkingtrue
include_reasoningfalse
retain_last_response0
cache_skillstrue
disable_web_searchfalse
studio_api_key
unload_model_after_runfalse
live_displaytrue

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 .md files 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

  • prompt and seed - 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's reasoning_content to 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:

  1. 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.
  2. Images need a vision model. Feed a picture to a text-only model and it fails. The node doesn't gate this for you.
  3. 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_url to 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.

CategoryCRT/LLM

Inputs (16)

NameTypeDefaultDescription
promptSTRING
seedINT00–18446744073709550000
imageoptIMAGEOptional image batch. The model loaded in Unsloth Studio must support vision input.
temperatureoptFLOAT-1.00-1–4Sampling temperature sent in the request. -1 = use the server's active default. Set >= 0 to override per-run; this does NOT change Unsloth Studio or its UI.
top_poptFLOAT-1.00-1–1Top-P (nucleus) sampling sent in the request. -1 = use the server's active default. Set >= 0 to override per-run; this does NOT change Unsloth Studio or its UI.
top_koptINT-1-1–10000Top-K sampling sent in the request. -1 = use the server's active default. 0 = unlimited. Set >= 0 to override per run.
unsloth_server_urloptSTRINGhttp://127.0.0.1:8888Leave 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.
skills_pathoptSTRINGOptional 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_thinkingoptBOOLEANtrueRequest a direct answer by disabling supported model thinking mode. Models that ignore this chat-template option are unaffected.
include_reasoningoptBOOLEANfalseAppend reasoning_content returned by the server to the response output when the loaded model provides it.
retain_last_responseoptINT00–16Number of previous assistant answers to keep in context for the next run. Only the answers are retained — the instruction / system prompt is not duplicated. 0 is stateless. Set to N to keep the last N answers in history so the model can build on its previous outputs.
cache_skillsoptBOOLEANtrueKeep the 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.
disable_web_searchoptBOOLEANfalseDisable automatic URL fetching and web search. When enabled, URLs in the prompt are ignored and no web content is fetched.
studio_api_keyoptSTRINGOptional. Paste your Unsloth Studio API key (sk-unsloth-...) or your Studio login password. Leave empty to authenticate automatically on this machine. Used for unload after run and auto-reload of the last model.
unload_model_after_runoptBOOLEANfalseUnload the model from Unsloth Studio after each completed run, freeing its VRAM for other tasks. The next run automatically reloads it via the Studio API with its previous settings (requires Studio auth: leave studio_api_key empty for local auto-auth, or paste an sk-unsloth key).
live_displayoptBOOLEANtrueStream thinking + answer tokens live to the companion 'Thinking Display (CRT)' node via websocket. Turn off to use the original single-shot request with no live updates.

Outputs (1)

NameTypeDescription
responseSTRING