Nodes/ComfyUI_LayerStyle_Advance/LayerUtility: SmolLM2(Advance)
ComfyUI Node Runs on cloud

LayerUtility: SmolLM2(Advance)

SmolLM2 — a genuinely tiny local text model for lightweight prompt work

By chflame163·Created 2 years ago·Updated 4 months ago· 696
LayerUtility: SmolLM2(Advance)
  • smolLM2_model
  • text
max_new_tokens512
do_sampletrue
temperature0.5
top_p0.9
system_promptYou are a helpful AI assistant.
user_promptwho are you?

This runs HuggingFace's SmolLM2 locally, and the whole point of SmolLM2 is right there in the name: it's small on purpose, built for on-device and edge use rather than to compete with a full-size LLM. Three sizes exist (135M, 360M, 1.7B parameters), and even the largest is tiny by modern LLM standards. That's a real tradeoff, not a hidden catch - you're not getting DeepSeek- or Gemini-level reasoning here - but it's genuinely useful for lightweight in-graph text work where you don't want to pull a much bigger model into VRAM, or where you'd rather avoid an API call entirely.

The inputs and outputs that matter

  • smolLM2_model - the loaded model handle, fed in from the pack's separate Load SmolLM2 Model node (where you pick which of the three sizes and precision to load). This node is inference-only; loading is somebody else's job.
  • system_prompt / user_prompt - role framing and instruction. The default user_prompt is literally "who are you?", a decent one-click way to confirm the model loaded correctly before wiring in real work.
  • do_sample (default true), temperature (default 0.5), top_p (default 0.9), max_new_tokens (default 512, up to 4096) - standard generation controls.

Output is a single text.

How to install it

Recommended: ComfyUI Manager, search "ComfyUI Layer Style Advance". Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/chflame163/ComfyUI_LayerStyle_Advance.git

Then install_requirements.bat / install_requirements_aki.bat, or pip install -r requirements.txt plus repair_dependency.bat. Restart.

Model files: download at least one of SmolLM2-135M-Instruct, SmolLM2-360M-Instruct, or SmolLM2-1.7B-Instruct from Hugging Face (or the pack's Baidu mirror) into ComfyUI/models/smol. Bigger means better output and more memory - start with 360M if you're unsure, it's a reasonable middle ground before committing to the full 1.7B download. You don't need all three; pick the size that matches how much VRAM you're comfortable spending on what's meant to be the lightweight option in this pack's LLM lineup.

Common issues & troubleshooting

Node errors with no model loaded. This node has no model input of its own beyond smolLM2_model - you need a Load SmolLM2 Model node upstream feeding it, plus the actual weight files sitting in ComfyUI/models/smol. Missing either produces an error here, not a silent fallback.

Output feels shallow, repetitive, or misses obvious context. This is the honest tradeoff of the model's size, not a misconfiguration - SmolLM2 is built for lightweight tasks (short rewrites, simple classification-style prompts, quick text transforms), not open-ended reasoning. If output quality matters more than footprint for a given task, this pack's PhiPrompt or the API-backed nodes (Gemini, DeepSeekAPI, ZhipuGLM4) will noticeably outperform it.

General import/dependency errors on first load. Standard for this pack - run repair_dependency.bat (or the Aki equivalent) if transformers or a related package is out of sync, which is the documented fix for most of this family's import failures.

Category😺dzNodes/LayerUtility

Inputs (7)

NameTypeDefaultDescription
smolLM2_modelSmolLM2_MODEL
max_new_tokensINT5121–4096
do_sampleBOOLEANtrue
temperatureFLOAT0.5
top_pFLOAT0.90–1
system_promptSTRINGYou are a helpful AI assistant.
user_promptSTRINGwho are you?

Outputs (1)

NameTypeDescription
textSTRING