From f56a3fc28f1badc096daeaac596a7d67c9d352f2 Mon Sep 17 00:00:00 2001 From: bedovyy Date: Tue, 4 Nov 2025 19:29:35 +0900 Subject: [PATCH] Add Qwen3VLChatHandler, Gemma3ChatHandler --- .gitignore | 1 + unified_generator.py | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c18dd8d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +__pycache__/ diff --git a/unified_generator.py b/unified_generator.py index 4272f2b..4eb3e2c 100644 --- a/unified_generator.py +++ b/unified_generator.py @@ -2,7 +2,7 @@ import folder_paths import os from io import BytesIO from llama_cpp import Llama -from llama_cpp.llama_chat_format import Llava16ChatHandler, Qwen25VLChatHandler +from llama_cpp.llama_chat_format import Llava16ChatHandler, Qwen25VLChatHandler, Qwen3VLChatHandler, Gemma3ChatHandler import base64 from torchvision.transforms import ToPILImage import gc @@ -72,8 +72,11 @@ class UnifiedGeneratorLP: raise ValueError("Multimodal mode requires an 'image' and a 'clip_name' input.") clip_path = folder_paths.get_full_path("LLavacheckpoints", clip_name) - - if "qwen2.5-vl" in str(clip_name).lower(): + if "gemma3" in str(clip_name).lower(): + self.clip = Gemma3ChatHandler(clip_model_path=clip_path, verbose=False) + if "qwen3-vl" in str(clip_name).lower(): + self.clip = Qwen3VLChatHandler(clip_model_path=clip_path, verbose=False) + elif "qwen2.5-vl" in str(clip_name).lower(): self.clip = Qwen25VLChatHandler(clip_model_path=clip_path, verbose=False) else: self.clip = Llava16ChatHandler(clip_model_path=clip_path, verbose=False) @@ -136,4 +139,4 @@ NODE_CLASS_MAPPINGS = { NODE_DISPLAY_NAME_MAPPINGS = { "UnifiedGenerator|LP": "Unified LLM/VLM Generator", -} \ No newline at end of file +}