diff --git a/AILab_QwenVL.py b/AILab_QwenVL.py index d18ded3..35bbcb6 100644 --- a/AILab_QwenVL.py +++ b/AILab_QwenVL.py @@ -1,4 +1,4 @@ -# ComfyUI-QwenVL +# ComfyUI-QwenVL # This custom node integrates the Qwen-VL series, including the latest Qwen3-VL models, # including Qwen2.5-VL and the latest Qwen3-VL, to enable advanced multimodal AI for text generation, # image understanding, and video analysis. @@ -1740,7 +1740,7 @@ class QwenVLBase: if not keep_model_loaded: self.clear() -class AILab_QwenVL(QwenVLBase): +class ThinkingLLM_QwenVL(QwenVLBase): @classmethod def INPUT_TYPES(cls): models = list(HF_VL_MODELS.keys()) @@ -1779,14 +1779,14 @@ class AILab_QwenVL(QwenVLBase): def process(self, model_name, preset_prompt, custom_prompt, attention_mode, max_tokens, keep_model_loaded, seed, keep_last_prompt=False, image=None, video=None, unique_id=None, extra_pnginfo=None, stream_tokens_to_terminal=False, enable_thinking=True): # Always use FP16 - dropdown removed but keep working logic quantization = Quantization.FP16.value - result = self.run(model_name, quantization, preset_prompt, custom_prompt, image, video, 16, max_tokens, 0.6, 0.9, 1, 1.2, seed, keep_model_loaded, attention_mode, False, "auto", keep_last_prompt, unique_id=unique_id, extra_pnginfo=extra_pnginfo, node_class="AILab_QwenVL", stream_to_terminal=stream_tokens_to_terminal, enable_thinking=enable_thinking) + result = self.run(model_name, quantization, preset_prompt, custom_prompt, image, video, 16, max_tokens, 0.6, 0.9, 1, 1.2, seed, keep_model_loaded, attention_mode, False, "auto", keep_last_prompt, unique_id=unique_id, extra_pnginfo=extra_pnginfo, node_class="ThinkingLLM_QwenVL", stream_to_terminal=stream_tokens_to_terminal, enable_thinking=enable_thinking) # Retrieve the raw_trace that was saved alongside the cleaned prompt in run() - key = _make_node_state_key("AILab_QwenVL", unique_id, extra_pnginfo) + key = _make_node_state_key("ThinkingLLM_QwenVL", unique_id, extra_pnginfo) entry = NODE_PROMPT_STATE.get(key, {}) raw_trace = entry.get("raw_trace", "") if isinstance(entry, dict) else "" return (result[0], raw_trace) -class AILab_QwenVL_Advanced(QwenVLBase): +class ThinkingLLM_QwenVL_Advanced(QwenVLBase): @classmethod def INPUT_TYPES(cls): models = list(HF_VL_MODELS.keys()) @@ -1837,19 +1837,19 @@ class AILab_QwenVL_Advanced(QwenVLBase): def process(self, model_name, attention_mode, use_torch_compile, device, preset_prompt, custom_prompt, max_tokens, temperature, top_p, num_beams, repetition_penalty, frame_count, keep_model_loaded, seed, keep_last_prompt, image=None, video=None, unique_id=None, extra_pnginfo=None, stream_tokens_to_terminal=False, enable_thinking=True): # Always use FP16 - dropdown removed but keep working logic quantization = Quantization.FP16.value - result = self.run(model_name, quantization, preset_prompt, custom_prompt, image, video, frame_count, max_tokens, temperature, top_p, num_beams, repetition_penalty, seed, keep_model_loaded, attention_mode, use_torch_compile, device, keep_last_prompt, unique_id=unique_id, extra_pnginfo=extra_pnginfo, node_class="AILab_QwenVL_Advanced", stream_to_terminal=stream_tokens_to_terminal, enable_thinking=enable_thinking) + result = self.run(model_name, quantization, preset_prompt, custom_prompt, image, video, frame_count, max_tokens, temperature, top_p, num_beams, repetition_penalty, seed, keep_model_loaded, attention_mode, use_torch_compile, device, keep_last_prompt, unique_id=unique_id, extra_pnginfo=extra_pnginfo, node_class="ThinkingLLM_QwenVL_Advanced", stream_to_terminal=stream_tokens_to_terminal, enable_thinking=enable_thinking) # Read back raw_trace from just-saved per-node state - key = _make_node_state_key("AILab_QwenVL_Advanced", unique_id, extra_pnginfo) + key = _make_node_state_key("ThinkingLLM_QwenVL_Advanced", unique_id, extra_pnginfo) entry = NODE_PROMPT_STATE.get(key, {}) raw_trace = entry.get("raw_trace", "") if isinstance(entry, dict) else "" return (result[0], raw_trace) NODE_CLASS_MAPPINGS = { - "AILab_QwenVL": AILab_QwenVL, - "AILab_QwenVL_Advanced": AILab_QwenVL_Advanced, + "ThinkingLLM_QwenVL": ThinkingLLM_QwenVL, + "ThinkingLLM_QwenVL_Advanced": ThinkingLLM_QwenVL_Advanced, } NODE_DISPLAY_NAME_MAPPINGS = { - "AILab_QwenVL": "ThinkingLLM", - "AILab_QwenVL_Advanced": "ThinkingLLM Advanced", + "ThinkingLLM_QwenVL": "ThinkingLLM", + "ThinkingLLM_QwenVL_Advanced": "ThinkingLLM Advanced", } diff --git a/AILab_QwenVL_GGUF.py b/AILab_QwenVL_GGUF.py index dd1b786..df6c23d 100644 --- a/AILab_QwenVL_GGUF.py +++ b/AILab_QwenVL_GGUF.py @@ -1,4 +1,4 @@ -# ComfyUI-QwenVL (GGUF) +# ComfyUI-QwenVL (GGUF) # GGUF nodes powered by llama.cpp for Qwen-VL models, including Qwen3-VL and Qwen2.5-VL. # Provides vision-capable GGUF inference and prompt execution. # @@ -33,7 +33,7 @@ from comfy.model_management import throw_exception_if_processing_interrupted # Import cache functions from main module sys.path.append(str(Path(__file__).parent)) -from AILab_QwenVL import ( +from ThinkingLLM_QwenVL import ( PROMPT_CACHE, apply_qwen_soft_thinking_directive, build_node_input_signature, @@ -1323,7 +1323,7 @@ class QwenVLGGUFBase: self.clear() -class AILab_QwenVL_GGUF(QwenVLGGUFBase): +class ThinkingLLM_QwenVL_GGUF(QwenVLGGUFBase): @classmethod def INPUT_TYPES(cls): all_models = GGUF_VL_CATALOG.get("models") or {} @@ -1400,18 +1400,18 @@ class AILab_QwenVL_GGUF(QwenVLGGUFBase): keep_last_prompt=keep_last_prompt, unique_id=unique_id, extra_pnginfo=extra_pnginfo, - node_class="AILab_QwenVL_GGUF", + node_class="ThinkingLLM_QwenVL_GGUF", stream_to_terminal=stream_tokens_to_terminal, enable_thinking=enable_thinking, ) # Read back raw_trace from just-saved per-node state - key = _make_node_state_key("AILab_QwenVL_GGUF", unique_id, extra_pnginfo) + key = _make_node_state_key("ThinkingLLM_QwenVL_GGUF", unique_id, extra_pnginfo) entry = NODE_PROMPT_STATE.get(key, {}) raw_trace = entry.get("raw_trace", "") if isinstance(entry, dict) else "" return (result[0], raw_trace) -class AILab_QwenVL_GGUF_Advanced(QwenVLGGUFBase): +class ThinkingLLM_QwenVL_GGUF_Advanced(QwenVLGGUFBase): @classmethod def INPUT_TYPES(cls): all_models = GGUF_VL_CATALOG.get("models") or {} @@ -1514,23 +1514,23 @@ class AILab_QwenVL_GGUF_Advanced(QwenVLGGUFBase): keep_last_prompt=keep_last_prompt, unique_id=unique_id, extra_pnginfo=extra_pnginfo, - node_class="AILab_QwenVL_GGUF_Advanced", + node_class="ThinkingLLM_QwenVL_GGUF_Advanced", stream_to_terminal=stream_tokens_to_terminal, enable_thinking=enable_thinking, ) # Read back raw_trace from just-saved per-node state - key = _make_node_state_key("AILab_QwenVL_GGUF_Advanced", unique_id, extra_pnginfo) + key = _make_node_state_key("ThinkingLLM_QwenVL_GGUF_Advanced", unique_id, extra_pnginfo) entry = NODE_PROMPT_STATE.get(key, {}) raw_trace = entry.get("raw_trace", "") if isinstance(entry, dict) else "" return (result[0], raw_trace) NODE_CLASS_MAPPINGS = { - "AILab_QwenVL_GGUF": AILab_QwenVL_GGUF, - "AILab_QwenVL_GGUF_Advanced": AILab_QwenVL_GGUF_Advanced, + "ThinkingLLM_QwenVL_GGUF": ThinkingLLM_QwenVL_GGUF, + "ThinkingLLM_QwenVL_GGUF_Advanced": ThinkingLLM_QwenVL_GGUF_Advanced, } NODE_DISPLAY_NAME_MAPPINGS = { - "AILab_QwenVL_GGUF": "ThinkingLLM (GGUF)", - "AILab_QwenVL_GGUF_Advanced": "ThinkingLLM Advanced (GGUF)", + "ThinkingLLM_QwenVL_GGUF": "ThinkingLLM (GGUF)", + "ThinkingLLM_QwenVL_GGUF_Advanced": "ThinkingLLM Advanced (GGUF)", } diff --git a/AILab_QwenVL_GGUF_PromptEnhancer.py b/AILab_QwenVL_GGUF_PromptEnhancer.py index 606df10..6bfdbfc 100644 --- a/AILab_QwenVL_GGUF_PromptEnhancer.py +++ b/AILab_QwenVL_GGUF_PromptEnhancer.py @@ -1,4 +1,4 @@ -# ComfyUI-QwenVL GGUF prompt enhancer +# ComfyUI-QwenVL GGUF prompt enhancer # # GGUF nodes powered by llama.cpp for Qwen-VL models, including Qwen3-VL and Qwen2.5-VL. # Provides vision-capable GGUF inference and prompt execution. @@ -37,7 +37,7 @@ from comfy.model_management import throw_exception_if_processing_interrupted import sys sys.path.append(str(Path(__file__).parent)) from AILab_StreamDisplay import TerminalStreamDisplay -from AILab_QwenVL import ( +from ThinkingLLM_QwenVL import ( PROMPT_CACHE, apply_qwen_soft_thinking_directive, build_node_input_signature, @@ -55,7 +55,7 @@ from AILab_QwenVL import ( _make_node_state_key, _build_workflow_fingerprint, ) -from AILab_QwenVL_GGUF import read_gguf_architecture, register_active_gguf_loader, release_other_gguf_loaders +from ThinkingLLM_QwenVL_GGUF import read_gguf_architecture, register_active_gguf_loader, release_other_gguf_loaders def _parse_repo_quant_sizes(repo_key: str) -> dict[str, str] | None: @@ -325,7 +325,7 @@ def _find_existing_local_file(base_dir: Path, filename: str) -> Path | None: return None -class AILab_QwenVL_GGUF_PromptEnhancer: +class ThinkingLLM_QwenVL_GGUF_PromptEnhancer: RETURN_TYPES = ("STRING", "STRING") RETURN_NAMES = ("ENHANCED_OUTPUT", "RAW_TRACE") FUNCTION = "process" @@ -450,7 +450,7 @@ class AILab_QwenVL_GGUF_PromptEnhancer: except Exception: pass for scan_dir in scan_dirs: - local_models = AILab_QwenVL_GGUF_PromptEnhancer._scan_local_gguf_text_models(scan_dir, existing_filenames) + local_models = ThinkingLLM_QwenVL_GGUF_PromptEnhancer._scan_local_gguf_text_models(scan_dir, existing_filenames) models.update(local_models) existing_filenames.update(Path(e.get("filename", "")).name for e in local_models.values() if e.get("filename")) @@ -906,7 +906,7 @@ class AILab_QwenVL_GGUF_PromptEnhancer: extra_pnginfo=None, enable_thinking=True, ): - node_class = "AILab_QwenVL_GGUF_PromptEnhancer" + node_class = "ThinkingLLM_QwenVL_GGUF_PromptEnhancer" input_signature = build_node_input_signature( model_name=model_name, prompt_text=prompt_text, @@ -1059,9 +1059,9 @@ class AILab_QwenVL_GGUF_PromptEnhancer: NODE_CLASS_MAPPINGS = { - "AILab_QwenVL_GGUF_PromptEnhancer": AILab_QwenVL_GGUF_PromptEnhancer, + "ThinkingLLM_QwenVL_GGUF_PromptEnhancer": ThinkingLLM_QwenVL_GGUF_PromptEnhancer, } NODE_DISPLAY_NAME_MAPPINGS = { - "AILab_QwenVL_GGUF_PromptEnhancer": "ThinkingLLM Prompt Enhancer (GGUF)", + "ThinkingLLM_QwenVL_GGUF_PromptEnhancer": "ThinkingLLM Prompt Enhancer (GGUF)", } diff --git a/AILab_QwenVL_PromptEnhancer.py b/AILab_QwenVL_PromptEnhancer.py index 7d7a368..3a8b762 100644 --- a/AILab_QwenVL_PromptEnhancer.py +++ b/AILab_QwenVL_PromptEnhancer.py @@ -1,4 +1,4 @@ -# This integration script follows GPL-3.0 License. +# This integration script follows GPL-3.0 License. # When using or modifying this code, please respect both the original model licenses # and this integration's license terms. # @@ -23,7 +23,7 @@ from AILab_OutputCleaner import OutputCleanConfig, clean_model_output, prompt_ou from AILab_StreamDisplay import TerminalStreamDisplay from comfy.model_management import throw_exception_if_processing_interrupted -from AILab_QwenVL import ( +from ThinkingLLM_QwenVL import ( ATTENTION_MODES, HF_ALL_MODELS, HF_TEXT_MODELS, @@ -125,7 +125,7 @@ PROMPT_STYLES = _load_prompt_styles() PROMPT_STYLES = {CUSTOM_ONLY_STYLE: "", **PROMPT_STYLES} -class AILab_QwenVL_PromptEnhancer(QwenVLBase): +class ThinkingLLM_QwenVL_PromptEnhancer(QwenVLBase): STYLES = PROMPT_STYLES RETURN_TYPES = ("STRING", "STRING") @@ -196,7 +196,7 @@ class AILab_QwenVL_PromptEnhancer(QwenVLBase): extra_pnginfo=None, enable_thinking=True, ): - node_class = "AILab_QwenVL_PromptEnhancer" + node_class = "ThinkingLLM_QwenVL_PromptEnhancer" input_signature = build_node_input_signature( model_name=model_name, quantization=quantization, @@ -326,7 +326,7 @@ class AILab_QwenVL_PromptEnhancer(QwenVLBase): device=device, unique_id=unique_id, extra_pnginfo=extra_pnginfo, - node_class="AILab_QwenVL_PromptEnhancer", + node_class="ThinkingLLM_QwenVL_PromptEnhancer", stream_to_terminal=stream_to_terminal, enable_thinking=enable_thinking, ) @@ -594,9 +594,9 @@ class AILab_QwenVL_PromptEnhancer(QwenVLBase): return result, raw_text NODE_CLASS_MAPPINGS = { - "AILab_QwenVL_PromptEnhancer": AILab_QwenVL_PromptEnhancer, + "ThinkingLLM_QwenVL_PromptEnhancer": ThinkingLLM_QwenVL_PromptEnhancer, } NODE_DISPLAY_NAME_MAPPINGS = { - "AILab_QwenVL_PromptEnhancer": "ThinkingLLM Prompt Enhancer", + "ThinkingLLM_QwenVL_PromptEnhancer": "ThinkingLLM Prompt Enhancer", }