A custom implementation of the Qwen 3.5 Vision-Language model for the ComfyUI framework. This extension allows for text, image, and video inference using Qwen 3.5 architectures.
The Qwen 3.5 models require transformers==5.2.0. Updating the global transformers library within the ComfyUI environment typically causes version conflicts with other custom nodes relying on transformers 4.x.
To resolve this, this node implements a vendoring approach with dynamic module switching. Dependencies (transformers, huggingface_hub, tokenizers) are installed in an isolated local directory (vendor/). A context manager temporarily patches sys.modules during initialization and inference, ensuring the 5.x execution context remains completely separated from the global ComfyUI environment.
- Support for Qwen 3.5 model sizes (0.8B, 2B, 4B, 9B).
- Multi-modal inference (Text, Single Image, Video/Image Batch).
- Hardware optimization: 4-bit quantization support (
BitsAndBytesConfig),torch.compilecompatibility, and configurable attention modes (sdpa,flash_attention_2,eager). - Automated dependency fetching on initial startup.
- Navigate to your ComfyUI custom nodes directory:
cd ComfyUI/custom_nodes- Clone this repository:
git clone https://github.com/bananasss00/ComfyUI-Qwen3.5-VL.git- Start ComfyUI. The extension will automatically download the required isolated dependencies into the
vendordirectory on the first run.
Note: Initial startup may take longer than usual while the dependencies are being fetched.
The node will appear in the ComfyUI menu under the Qwen3.5 category.
- Connect an image or video output to the
image_or_videoinput (optional). - Specify the
model_sizeand your prompt. - Configure performance parameters (e.g.,
use_4bit,attention_mode).
Models will be downloaded automatically from the Hugging Face Hub to ComfyUI/models/qwen35 upon first execution.
Кастомная нода для интеграции Vision-Language модели Qwen 3.5 в среду ComfyUI. Дополнение обеспечивает поддержку инференса текста, изображений и видео.
Для работы моделей Qwen 3.5 требуется библиотека transformers==5.2.0. Обновление transformers в глобальном окружении ComfyUI приводит к конфликту версий с другими нодами, требующими ветку 4.x.
Для решения этой проблемы применяется метод vendoring (изоляция зависимостей) с динамическим переключением модулей. Требуемые пакеты устанавливаются в локальную директорию (vendor/). Контекстный менеджер временно подменяет sys.modules во время инициализации и генерации, гарантируя полную изоляцию контекста выполнения 5.x от глобального окружения ComfyUI.
- Поддержка параметров Qwen 3.5 (0.8B, 2B, 4B, 9B).
- Мультимодальный инференс (Текст, Изображение, Батчи изображений/Видео).
- Аппаратные оптимизации: поддержка 4-битного квантования, совместимость с
torch.compile, выбор режимов внимания (sdpa,flash_attention_2,eager). - Автоматическая загрузка изолированных зависимостей при первом запуске.
- Перейдите в директорию пользовательских нод ComfyUI:
cd ComfyUI/custom_nodes- Клонируйте репозиторий:
git clone https://github.com/bananasss00/ComfyUI-Qwen3.5-VL.git- Запустите ComfyUI. Дополнение автоматически скачает необходимые зависимости в директорию
vendorпри первой инициализации.
Примечание: Первый запуск может занять больше времени из-за процесса установки пакетов.
Нода доступна в меню ComfyUI в категории Qwen3.5.
- Подключите изображение или видео к входу
image_or_video(опционально). - Задайте
model_sizeи текстовый промпт. - Настройте параметры производительности (
use_4bit,attention_mode).
Веса моделей загружаются автоматически из Hugging Face Hub в директорию ComfyUI/models/qwen35 при первом выполнении.