TA Smart LLM v3.8
Turn LM Studio or Ollama into your prompt generator
- image
- prompt
- status
- reasoning
The name tells you the pitch: instead of a separate LM Studio API node, a ComfyUI LLM node, and a VRAM choreography between them, TA Smart LLM is one node that talks to your local LM Studio or Ollama backend, turns your text or image into a prompt, and manages memory around the whole exchange. It's the pack's centerpiece, and the changelog shows how much of the author's iteration went into exactly the places it hurts: blank responses, reasoning tags, and VRAM collisions.
How it works: at node-load time it pings both backends - LM Studio's /v1/models on port 1234 and Ollama's /api/tags on port 11434 - and builds the model dropdown, tagging vision-capable models with [Vision] so you know which ones accept the optional image input. The list is cached to a JSON file so you don't get a validation error the moment a backend is offline; reachable models sort to the top. user_prompt and system_prompt are your text; temperature (0.7) and max_tokens (1024) are the usual controls, and request_timeout (default 120s) keeps a hung backend from stalling your queue forever.
The inputs that matter most for a beginner are the memory toggles. unload_image_models_first (default on) unloads ComfyUI's image models before the LLM runs - because your GPU can't hold both your checkpoint and a 7B LLM - and unload_llm_after (default on) frees the LLM afterward so the next image pass starts clean. Both default to on since v3.1, which is the sane default. thinking_mode (default on) handles the reasoning-model problem: models that emit [think]...[/think] blocks get those stripped before the prompt goes downstream (or kept, if you want them). If the LLM returns empty, the status output shows a warning instead of silently passing a blank prompt downstream - a fix the changelog calls out explicitly, and the right call.
Outputs: prompt (the generated text - wire it into TA Prompt Controller or a CLIP Text Encode), status (for debugging and for the pack's prompt selector), and reasoning (the model's chain-of-thought, added in v3.8 - useful when you want to see why the LLM picked a prompt without polluting the prompt itself). The image input auto-enables when you select a [Vision] model, and the image gets base64-encoded for the backend like the pack's captioning node does.
Install. Pack install is dependency-free, but the node is useless without a running backend:
cd ComfyUI/custom_nodes
git clone https://github.com/tmode-1960/TA-ComfyUI-Nodes-Pack
or ComfyUI Manager (search "TA ComfyUI Nodes Pack"). Restart, under TA Tools. Then make sure LM Studio (0.4.7+ for the reasoning fixes) or Ollama is actually running with a model loaded - "No Backend" in the dropdown means nothing responded.
Gotchas. The dropdown can't see your model if the backend isn't up when the node loads - restart ComfyUI or reload after starting LM Studio. thinking_mode interacts with the reasoning-output workaround in LM Studio 0.4.7+ (where reasoning_content carries the answer when content is empty), so keep the pack updated rather than chasing backend quirks manually. Old nodes in saved workflows keep their old defaults - the new defaults only apply to newly placed nodes. And the v2.x rewrite means TA v1 workflows need rebuilding.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| llm_enable | BOOLEAN | true | — |
| model | COMBO | No Backend | 1 options: No Backend |
| user_prompt | STRING | — | |
| system_prompt | STRING | You are an expert SD prompt generator. | — |
| temperature | FLOAT | 0.700–2 | — |
| max_tokens | INT | 102464–8192 | — |
| request_timeout | INT | 12030–600 | — |
| thinking_mode | BOOLEAN | true | — |
| unload_image_models_first | BOOLEAN | true | — |
| unload_llm_after | BOOLEAN | true | — |
| imageopt | IMAGE | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| prompt | STRING | — |
| status | STRING | — |
| reasoning | STRING | — |