Compare commits

...
16 Commits
Author SHA1 Message Date
Thomas 5c5a99119e changed version from v2.0.3 to 2.0.4
- changed DisplayName
- added credits section in README.md
2026-03-18 05:11:39 +01:00
Thomas 23e6d5d3e4 Update pyproject.toml
changed DisplayName from TA ComfyUI Nodes Pack to TA-ComfyUI-Nodes-Pack
2026-03-18 05:07:06 +01:00
Thomas 4513d481d0 Update README.md
added credits section
2026-03-18 04:56:36 +01:00
Thomas cf79c3edd4 Fix installation instructions for ComfyUI Nodes Pack 2026-03-18 04:42:40 +01:00
Thomas 43ddf78333 changed from v2.0.2 to 2.0.3
- updated README.md Changelog
- updated ta_smart_llm so that `unload_image_models_first` and `unload_llm_after` is set to TRUE
2026-03-16 10:41:08 +01:00
Thomas b2e5d91a8c Merge branch 'main' of https://github.com/tmode-1960/TA-ComfyUI-Nodes-Pack 2026-03-16 10:29:28 +01:00
Thomas 3757156700 Update README.md 2026-03-16 10:28:55 +01:00
Thomas ca096a9027 Bump version from 2.0.1 to 2.0.2 2026-03-16 10:25:45 +01:00
Thomas 5c68c8006c Bump version from 2.0.1 to 2.0.2 2026-03-16 10:25:28 +01:00
Thomas 2bfd2ac65f Update ta_smart_llm to v3.0
v3.0 is the consolidated version with all fixes:

- Active models are now displayed at the top of the dropdown, offline models at the bottom — no validation error

- timeout=0.5 for all backend queries

- IS_CHANGED returns "disabled" if llm_enable=False — the node is cached

- _flush_lmstudio_context removed — saves the 0.5s pause before vision requests

- temperature + max_tokens as configurable parameters
2026-03-16 10:22:48 +01:00
Thomas 56aa1bef12 changed version from v2.0.0 to v2.0.1 2026-03-16 08:19:52 +01:00
Thomas b4a82be05b Update ta_smart_llm.py
LLM v2.9
- Added fields for temperature and max_tokens

LLM v2.8
- Sorting: Models from the active backend are always at the top

- Reduced waiting time from 2 seconds to 0.5 seconds when the node is inactive
2026-03-16 08:18:43 +01:00
Thomas 7445bc4971 Update pyproject.toml
I changed the license from the incorrectly set MIT entry to Apache 2.0.
2026-03-16 08:16:04 +01:00
Thomas e022b92ef1 Clear all entries in ta_smart_llm_models.json
Removed all model entries from ta_smart_llm_models.json.
2026-03-15 07:26:42 +01:00
Thomas 7d807b5728 Enhance project description for clarity and detail
Updated project description to provide more detail about features and integrations.
2026-03-15 06:35:34 +01:00
Thomas f6633f19e4 Enhance description of TA-ComfyUI-Nodes-Pack
Updated the description to provide more details about the nodes and features included in the pack.
2026-03-15 06:34:54 +01:00
5 changed files with 77 additions and 46 deletions
+24 -1
View File
@@ -16,7 +16,30 @@ A collection of nodes designed for use in thomo.ART workflows, focused on flexib
The full documentation is available via the built-in **Help button** in each node (opens in your browser at `http://localhost:8188/ta-nodes/wiki/index.html`).
---
## Credits
This project was inspired by or builds upon the following open-source works:
- **[ComfyUI-EBU-LMStudio](https://github.com/burnsbert/ComfyUI-EBU-LMStudio)** by [burnsbert (Eric W. Burns)](https://github.com/burnsbert)
Inspiration for the LM Studio / LLM integration in ComfyUI, implemented in the **TASmartLLM** node with support for both LM Studio and Ollama.
- **[Comfyui-Memory_Cleanup](https://github.com/LAOGOU-666/Comfyui-Memory_Cleanup)** by [LAOGOU-666](https://github.com/LAOGOU-666)
Inspiration for the VRAM and RAM cleanup logic in the **TACleanupSwitch** node.
---
## Changelog
**v2.0.3 changed ta_smart_llm**
ta_smart_llm v3.1:
- `unload_image_models_first` and `unload_llm_after` now default to `True`. Note that existing nodes in the workflow retain their saved values—the new default only applies to newly placed nodes.
**v2.0.2 changed ta_smart_llm**
ta_smart_llm v3.0 is the consolidated version with all fixes:
- Active models are now displayed at the top of the dropdown, offline models at the bottom — no validation error
- timeout=0.5 for all backend queries
- IS_CHANGED returns "disabled" if llm_enable=False — the node is cached
- _flush_lmstudio_context removed — saves the 0.5s pause before vision requests
- temperature + max_tokens as configurable parameters
---
## Nodes
### 🧠 TA Unified Model Switcher
@@ -69,7 +92,7 @@ Displays a clickable Discord invite link directly inside the ComfyUI graph. URL
## Installation
### Via ComfyUI Manager
Search for `TA-ComfyUI-Nodes-Pack` in the ComfyUI Manager and install.
Search for `TA ComfyUI Nodes Pack` in the ComfyUI Manager and install.
### Manual
```bash
+2 -2
View File
@@ -1,8 +1,8 @@
{
"name": "TA-ComfyUI-Nodes-Pack",
"author": "tmode-1960",
"description": "Some useful nodes for ComfyUI (Model Loader, LM Studio, Ollama and more)",
"version": "2.0.0",
"description": "Custom ComfyUI nodes for advanced AI image workflows. Includes smart model loaders (FLUX, SDXL, ZImage, Qwen), LM Studio/Ollama integration, sampler presets, VRAM/RAM cleanup, and prompt utilities.",
"version": "2.0.4",
"repository": "https://github.com/tmode-1960/TA-ComfyUI-Nodes-Pack",
"license": "Apache 2.0"
}
+4 -4
View File
@@ -1,10 +1,10 @@
[project]
name = "TA-ComfyUI-Nodes-Pack"
version = "2.0.0"
description = "Some useful nodes for ComfyUI (Model Loader, LM Studio, Ollama and more))"
version = "2.0.4"
description = "Custom ComfyUI nodes for advanced AI image workflows. Includes smart model loaders (FLUX, SDXL, ZImage, Qwen), LM Studio/Ollama integration, sampler presets, VRAM/RAM cleanup, and prompt utilities."
readme = "README.md"
requires-python = ">=3.8"
license = {text = "MIT"}
license = {text = "Apache-2.0"}
authors = [
{name = "tmode-1960", email = "info@thomo.art"}
]
@@ -27,5 +27,5 @@ build-backend = "setuptools.build_meta"
# ComfyUI Registry Konfiguration
[tool.comfy]
PublisherId = "tmode-1960"
DisplayName = "TA ComfyUI Nodes Pack"
DisplayName = "TA-ComfyUI-Nodes-Pack"
Icon = "" # Optional: URL zu einem Icon
+46 -38
View File
@@ -2,9 +2,9 @@
================================================================================
Node Name : TA Smart LLM
Created : 2025
Modified : 2026-03-13
Modified : 2026-03-16
Copyright : © 2026, Thomas Möhrling (thomo.ART)
Version : 2.2
Version : 3.1
--------------------------------------------------------------------------------
Part of ComfyUI-TA-Nodes-Pack
License : Apache 2.0
@@ -99,39 +99,48 @@ class TASmartLLM:
Discovers and caches available models from LM Studio (port 1234) and
Ollama (port 11434). Tags vision-capable models with [Vision] suffix.
Per-backend logic:
- If a backend responds, its models replace the cached entries for
that backend (additions and deletions are reflected immediately).
- If a backend is offline, its cached entries are kept unchanged so
that saved workflows remain valid without breaking validation.
Display logic:
- All known models are always shown (prevents validation errors).
- Active models appear at the top of the list, offline models below.
- No prefix is added to model names so stored values remain stable
across restarts regardless of which backend is active.
- Per-backend cache is updated on each call if the backend responds,
so added/removed models are reflected immediately.
"""
known = cls._load_cached_models()
# Split cache by backend
known_lmstudio = {m for m in known if m.startswith("LMStudio/")}
known_ollama = {m for m in known if m.startswith("Ollama/")}
active_lmstudio = set()
active_ollama = set()
# Query LM Studio — replace cache if reachable
try:
r = requests.get("http://127.0.0.1:1234/v1/models", timeout=2)
r = requests.get("http://127.0.0.1:1234/v1/models", timeout=0.5)
if r.status_code == 200:
known_lmstudio = {f"LMStudio/{m['id']}" for m in r.json()['data']}
active_lmstudio = known_lmstudio
except:
pass # offline — keep existing cache
pass
# Query Ollama — replace cache if reachable
try:
r = requests.get("http://127.0.0.1:11434/api/tags", timeout=2)
r = requests.get("http://127.0.0.1:11434/api/tags", timeout=0.5)
if r.status_code == 200:
known_ollama = {f"Ollama/{m['name']}" for m in r.json()['models']}
active_ollama = known_ollama
except:
pass # offline — keep existing cache
pass
all_models = known_lmstudio | known_ollama
cls._save_cached_models(all_models)
cls._save_cached_models(known_lmstudio | known_ollama)
tagged = [tag_model(m) for m in sorted(all_models)]
return tagged if tagged else ["No Backend"]
active = sorted(active_lmstudio | active_ollama)
offline = sorted((known_lmstudio | known_ollama) - (active_lmstudio | active_ollama))
# Active models first, offline models after — no prefix in stored value
result = [tag_model(m) for m in active] + [tag_model(m) for m in offline]
return result if result else ["No Backend"]
@classmethod
def INPUT_TYPES(cls):
@@ -159,8 +168,10 @@ class TASmartLLM:
"model": (models, {"default": models[0] if models else "No Backend"}),
"user_prompt": ("STRING", {"multiline": True, "default": ""}),
"system_prompt": ("STRING", {"multiline": True, "default": "You are an expert SD prompt generator."}),
"unload_image_models_first": ("BOOLEAN", {"default": False}),
"unload_llm_after": ("BOOLEAN", {"default": False}),
"temperature": ("FLOAT", {"default": 0.7, "min": 0.0, "max": 2.0, "step": 0.05}),
"max_tokens": ("INT", {"default": 1024, "min": 64, "max": 8192, "step": 64}),
"unload_image_models_first": ("BOOLEAN", {"default": True}),
"unload_llm_after": ("BOOLEAN", {"default": True}),
},
"optional": {
"image": ("IMAGE",)
@@ -173,7 +184,13 @@ class TASmartLLM:
CATEGORY = "TA Tools"
@classmethod
def IS_CHANGED(cls, *args, **kwargs):
def IS_CHANGED(cls, llm_enable, model, user_prompt, system_prompt,
temperature=0.7, max_tokens=1024,
unload_image_models_first=False, unload_llm_after=False,
image=None):
# Wenn deaktiviert: fixer Wert → Node wird von ComfyUI gecacht, kein erneuter Aufruf
if not llm_enable:
return "disabled"
return time.time()
def _backend_reachable(self, backend, port):
@@ -182,7 +199,7 @@ class TASmartLLM:
"""
try:
url = f"http://127.0.0.1:{port}/v1/models" if "LMStudio" in backend else f"http://127.0.0.1:{port}/api/tags"
return requests.get(url, timeout=2).status_code == 200
return requests.get(url, timeout=0.5).status_code == 200
except:
return False
@@ -230,20 +247,6 @@ class TASmartLLM:
img.save(buffer, 'PNG')
return base64.b64encode(buffer.getvalue()).decode('utf-8')
def _flush_lmstudio_context(self, url, model_name):
"""
Sends a minimal request to clear LM Studio chat context.
"""
try:
requests.post(url, json={
"model": model_name,
"messages": [{"role": "user", "content": "."}],
"max_tokens": 1
}, timeout=10)
except:
pass
time.sleep(0.5)
def _post_with_retry(self, url, payload, is_lmstudio, max_retries=3, retry_delay=1.5):
"""
Posts to LLM API with retry logic for transient errors.
@@ -269,6 +272,7 @@ class TASmartLLM:
raise last_error
def generate(self, llm_enable, model, user_prompt, system_prompt,
temperature=0.7, max_tokens=1024,
unload_image_models_first=False, unload_llm_after=False,
image=None):
"""
@@ -318,7 +322,6 @@ class TASmartLLM:
if "LMStudio" in backend:
url = f"http://127.0.0.1:{port}/v1/chat/completions"
if img_b64:
self._flush_lmstudio_context(url, model_name)
user_content = [
{"type": "text", "text": full_prompt},
{"type": "image_url", "image_url": {"url": f"data:image/png;base64,{img_b64}"}}
@@ -331,7 +334,8 @@ class TASmartLLM:
{"role": "system", "content": system_prompt},
{"role": "user", "content": user_content}
],
"max_tokens": 1024
"temperature": temperature,
"max_tokens": max_tokens
}
result = self._post_with_retry(url, payload, is_lmstudio=True)
@@ -345,7 +349,11 @@ class TASmartLLM:
payload = {
"model": model_name,
"prompt": f"{system_prompt}\n\n{full_prompt}".strip(),
"stream": False
"stream": False,
"options": {
"temperature": temperature,
"num_predict": max_tokens
}
}
if img_b64:
@@ -363,4 +371,4 @@ class TASmartLLM:
NODE_CLASS_MAPPINGS = {"TASmartLLM": TASmartLLM}
NODE_DISPLAY_NAME_MAPPINGS = {"TASmartLLM": "TA Smart LLM v2.2"}
NODE_DISPLAY_NAME_MAPPINGS = {"TASmartLLM": "TA Smart LLM v3.1"}
+1 -1
View File
@@ -1 +1 @@
["LMStudio/cognitivecomputations_dolphin-mistral-24b-venice-edition", "LMStudio/cydonia-24b-v4.1", "LMStudio/deepseek-coder-v2-lite-16b", "LMStudio/gemma-3-27b-it-qat", "LMStudio/huihui-qwen3-vl-8b-instruct-abliterated", "LMStudio/llama-3.1-unhinged-vision-8b", "LMStudio/llama-3.2-1b-instruct", "LMStudio/llava-v1.5-7b-llamafile", "LMStudio/mistral-catmacaroni-slerp-uncensored-7b", "LMStudio/mistral-small-3.1-draft-0.5b", "LMStudio/mistralai/devstral-small-2-2512", "LMStudio/mistralai/ministral-3-14b-reasoning", "LMStudio/qwen2.5-0.5b-instruct", "LMStudio/qwen2.5-0.5b-song-lyrics-generation", "LMStudio/qwen3-30b-a3b-thinking-2507-claude-4.5-sonnet-high-reasoning-distill", "LMStudio/qwen3-4b-thinking-2507", "LMStudio/qwen3-coder-30b-a3b-instruct", "LMStudio/qwen3-vl-8b-instruct", "LMStudio/text-embedding-nomic-embed-text-v1.5", "LMStudio/wizardlm-1.0-uncensored-llama2-13b", "LMStudio/xortron2025"]
[]