Nodes/Unsloth Desktop Nodes/Unsloth Generate
ComfyUI Node

Unsloth Generate

Put a local LLM in the graph, not in a chat window

By DeverStyle·Created 2 months ago·Updated 28 days ago· 3
Unsloth Generate
  • connectivity
  • options
  • images
  • meta
  • result
  • thinking
  • meta
◄systemYou are an AI artist.►
◄promptWhat is art?►
◄thinkfalse►
◄format▾►

Unsloth Generate is the node that actually does the work in this pack: it sends a system prompt and a user prompt to a local Unsloth Desktop model and hands you the text back as a string you can wire into the rest of your workflow. If you want a rough idea expanded into a structured prompt before it hits the text encoder, an image described for a training set, or a caption turned into an img2img seed, this is the node. It's the same idea as the Ollama generate nodes - Connectivity for the server, Options for sampling, this for the call.

How it works

Mechanically it's a plain OpenAI-style chat call. It first validates the connection against Unsloth's /v1/models (so a dead server or bad key fails fast), builds a two-message payload - your system text and your prompt - and posts it to /v1/chat/completions. If you wired an image in, each image in the batch gets converted to a base64 PNG and attached to the user message as an image part, so the model has to actually support vision. Whatever comes back gets split into two strings.

The meta output is the underrated bit. It's the same connection-and-options bundle that came in, passed back out, so you can chain several Generate nodes - plan, then critique, then rewrite - with one Connectivity node feeding the front of the chain. A directly connected connectivity or options input beats whatever is riding along in meta, so you can override sampling for one step mid-chain.

What you set, and what you wire up

  • system - role and behaviour. Default is "You are an AI artist." For structured output this is where the real work happens: put the format you want and a couple of concrete examples right here, especially in JSON mode.
  • prompt - the user turn. For vision, the tooltip's advice is to just say "this image" and let the model look at what you attached.
  • think - only for reasoning-capable models. When it's on, the thinking pass comes back as its own output rather than being mixed into result. That's quietly the right design: the usual failure of in-graph LLM nodes is the model's scratch-work, preambles and chat scaffolding leaking into your prompt, and this at least keeps the deliberation out of the string you're feeding a sampler.
  • format - text or json. json sets the response format to a JSON object, which is what you want when the next node is going to parse the result.
  • options, images, connectivity, meta are all optional inputs; meta covers the "required unless provided via meta" case.

Outputs: result (the text - that's the one you wire into a prompt or save node), thinking (empty unless think was on), and meta (chain onward).

Install

Same pack, same steps: Manager → Install Custom Nodes → search Unsloth Desktop Nodes (dever/dever-unsloth), restart. Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/DeverStyle/comfyui-dever-unsloth.git

No Python dependencies - the pack uses requests, PIL and numpy that ComfyUI already ships. The real prerequisite is the external one: Unsloth Desktop running with Settings → "Model auto-switch (OpenAI API)" enabled, and an API key from Settings → API pasted into the Connectivity node. Everything in the graph is cheap; the model that isn't downloaded is what bites.

Where people get burned

The enhancer that writes paragraphs of preamble. If you use this to expand prompts, ask for JSON or give it a stop sequence in Options, and keep the job narrow. A chat model asked for "a better prompt" will happily hand you "Sure! Here is an enhanced prompt:" along with it, and every one of those tokens is now literal text in your conditioning. The KB's advice holds: two tightly scoped rewrites drift less than one open-ended one.

The quality ceiling. An 8B local model behind this node is a convenience, not a writer. It solves the blank-page problem on your terms - offline, uncensored, free per call - and it will still invent detail you didn't ask for if you let it free-associate.

Captioning multiple subjects. If you're generating training captions, expect the usual VLM weakness: two people in frame and it starts swapping who's wearing what. Auto-caption the big set, audit the small one by hand.

Timeouts. The client waits 300 seconds. A cold model load eats into that, so either keep the model warm via keep-alive on the Connectivity node or load it once by hand before you queue.

Nothing in thinking? Either think is off, or your model just doesn't support a separate reasoning pass. Not every GGUF does.

CategoryUnsloth

Inputs (8)

NameTypeDefaultDescription
systemSTRINGYou are an AI artist.System prompt — sets the role and general behavior of the model.
promptSTRINGWhat is art?User prompt. For vision tasks you can refer to the input image as 'this image'.
thinkBOOLEANfalseIf enabled, the model does a thinking pass first. The thinking is returned as a separate output. Some models do not support this.
formatCOMBO'json' requests a JSON object response (response_format). Show the model example outputs in the system prompt for best results.
connectivityoptUNSLOTH_CONNECTIVITYConnection to set the server, key, model, and keep-alive. Required unless provided via 'meta'.
optionsoptUNSLOTH_OPTIONSAdvanced sampling options.
imagesoptIMAGEOptional image or batch for vision tasks. The model must support vision.
metaoptUNSLOTH_METAChain multiple Generate nodes; connectivity and options are passed along (and can be overridden).

Outputs (3)

NameTypeDescription
resultSTRING—
thinkingSTRING—
metaUNSLOTH_META—