Nodes/ComfyUI-SmolLM3/SmolLM3 Sampler (Chat)
ComfyUI Node

SmolLM3 Sampler (Chat)

Chat with a 3B model right inside ComfyUI — no API key, no cloud

By XmYx·Created about a year ago·Updated about a year ago· 5
SmolLM3 Sampler (Chat)
  • model
  • tokenizer
  • generated_text
  • full_output
promptGive me a brief explanation of gravity in simple terms.
max_new_tokens512
temperature0.60
top_p0.95
seed-1
use_chat_templatetrue
system_prompt

This is the node that turns the pack from "text completer" into something that feels like a chat app. If you loaded the model and want answers, not continuations, SmolLM3 Sampler (Chat) is the one you want. The name is not a lie either: there's no API call anywhere in this pack, no key to paste, nothing leaving your machine once the model is cached. Fully local, fully offline, fully within your graph.

What it does

You feed it the model and tokenizer from the SmolLM3 Model Loader, type a prompt, and it runs the full chat pipeline: builds a system-plus-user message structure, applies the model's chat template, generates tokens, and decodes the result. The default prompt is even a real sentence - "Give me a brief explanation of gravity in simple terms." - so the first Queue press is a working demo, not a blank box.

The knobs that matter

  • prompt - your actual question. Multiline, so paste away.
  • system_prompt (optional) - the only input you'll want to reach for after the prompt itself. Set a role like "You are a terse assistant" or "Always answer in one sentence" and the model stays in character.
  • temperature and top_p - defaults are 0.6 and 0.95, which is no accident: that's the SmolLM3 team's own recommended setting, and it's a sane starting point. Drop temperature to 0 and generation becomes greedy (deterministic but boring).
  • max_new_tokens - default 512, caps at 32768. This is your "let it ramble" ceiling.
  • seed - default -1 means random. Set a positive number and you can reproduce an output exactly.
  • use_chat_template - on by default, and correct for the instruct-tuned HuggingFaceTB/SmolLM3-3B model. If you loaded the Base checkpoint instead, flip this off - the base model isn't instruction-tuned, and dressing plain text in a chat template it was never trained on just makes output worse.

The two outputs, and which to wire where

  • generated_text - just the newly generated tokens, your prompt stripped off. This is the clean "answer."
  • full_output - the entire decoded sequence, prompt included. For chat you'll often want this one, because it shows the conversation as a whole. The pack's example workflow runs it straight into a DisplayEverything text preview node.

Both are plain STRING types, so they plug into any text preview/display node you already have. That's the whole loop: load → sample → display.

Install and context

Same shared install as the rest of the pack - ComfyUI Manager search for "SmolLM3", or:

cd ComfyUI/custom_nodes
git clone https://github.com/XmYx/ComfyUI-SmolLM3.git
# restart ComfyUI

One thing worth knowing about the wider ecosystem: the most common way people actually use local LLMs inside ComfyUI is prompt expansion - feeding a short idea to a small model and getting a detailed prompt back for the diffusion side. This pack is more general than that (it's a straight chat/QA node), so if you only wanted a prompt-expander, this is a broader hammer than you need. But if you want to brainstorm, caption, or riff inside a workflow without leaving ComfyUI, this does it.

Where people get burned

First generation is slow - model load plus template plus decode takes a beat; subsequent ones are faster. VRAM is the real constraint: the 3B model eats roughly 6 GB in fp16 before KV cache, so on a tight card you'll want to generate text first and free the model before the diffusion side runs. And if you're chasing a bug, remember the seed is applied to torch's global RNG - the reproducibility is real, but it's not isolated to this one node. When in doubt, the README's advice (temperature 0.6, top_p 0.95, enable the chat template) is genuinely good.

CategorySmolLM3

Inputs (9)

NameTypeDefaultDescription
modelSMOLLM3_MODEL
tokenizerSMOLLM3_TOKENIZER
promptSTRINGGive me a brief explanation of gravity in simple terms.
max_new_tokensINT5121–32768
temperatureFLOAT0.600–2
top_pFLOAT0.950–1
seedINT-1-1–18446744073709550000
use_chat_templateBOOLEANtrue
system_promptoptSTRING

Outputs (2)

NameTypeDescription
generated_textSTRING
full_outputSTRING