Nodes/TA-ComfyUI-Nodes-Pack/TA Smart LLM v3.8
ComfyUI Node

TA Smart LLM v3.8

Turn LM Studio or Ollama into your prompt generator

By tmode-1960·Created 11 months ago·Updated 5 months ago· 5
TA Smart LLM v3.8
  • image
  • prompt
  • status
  • reasoning
llm_enabletrue
modelNo Backend
user_prompt
system_promptYou are an expert SD prompt generator.
temperature0.70
max_tokens1024
request_timeout120
thinking_modetrue
unload_image_models_firsttrue
unload_llm_aftertrue

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.

CategoryTA Tools

Inputs (11)

NameTypeDefaultDescription
llm_enableBOOLEANtrue
modelCOMBONo Backend1 options: No Backend
user_promptSTRING
system_promptSTRINGYou are an expert SD prompt generator.
temperatureFLOAT0.700–2
max_tokensINT102464–8192
request_timeoutINT12030–600
thinking_modeBOOLEANtrue
unload_image_models_firstBOOLEANtrue
unload_llm_afterBOOLEANtrue
imageoptIMAGE

Outputs (3)

NameTypeDescription
promptSTRING
statusSTRING
reasoningSTRING