LayerUtility: SmolLM2(Advance)
SmolLM2 — a genuinely tiny local text model for lightweight prompt work
- smolLM2_model
- text
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 separateLoad SmolLM2 Modelnode (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 defaultuser_promptis literally"who are you?", a decent one-click way to confirm the model loaded correctly before wiring in real work.do_sample(defaulttrue),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.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| smolLM2_model | SmolLM2_MODEL | — | |
| max_new_tokens | INT | 5121–4096 | — |
| do_sample | BOOLEAN | true | — |
| temperature | FLOAT | 0.5 | — |
| top_p | FLOAT | 0.90–1 | — |
| system_prompt | STRING | You are a helpful AI assistant. | — |
| user_prompt | STRING | who are you? | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |