Files
FillipandClaude Opus 4.7 3c04bdc186 Initial release: FL VLM nodes for ComfyUI
Adds two nodes (FL VLM Model Loader, FL VLM Image Inference) with a
Qwen3-VL backend, optional 8-bit/4-bit quantization, resize presets,
per-image or shared-prompt batch modes, and a streaming progress UI.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-12 10:46:15 -07:00

49 lines
1.2 KiB
Python

import torch
QWEN3_VL_MODELS = {
"Qwen3-VL-2B-Instruct": "Qwen/Qwen3-VL-2B-Instruct",
"Qwen3-VL-4B-Instruct": "Qwen/Qwen3-VL-4B-Instruct",
"Qwen3-VL-8B-Instruct": "Qwen/Qwen3-VL-8B-Instruct",
"Qwen3-VL-32B-Instruct": "Qwen/Qwen3-VL-32B-Instruct",
"Qwen3-VL-30B-A3B-Instruct": "Qwen/Qwen3-VL-30B-A3B-Instruct",
}
def model_names():
return list(QWEN3_VL_MODELS.keys())
def resolve_model_id(model_variant, custom_model_id):
custom_model_id = (custom_model_id or "").strip()
if custom_model_id:
return custom_model_id
return QWEN3_VL_MODELS[model_variant]
def dtype_options():
options = ["auto", "bfloat16", "float16", "float32"]
if torch.cuda.is_available() and torch.cuda.is_bf16_supported():
return options
return ["auto", "float16", "float32"]
def dtype_from_name(dtype_name):
if dtype_name == "auto":
return "auto"
return {
"bfloat16": torch.bfloat16,
"float16": torch.float16,
"float32": torch.float32,
}[dtype_name]
def device_map_options():
if torch.cuda.is_available():
return ["auto", "cuda", "cpu"]
return ["cpu", "auto"]
def attention_options():
return ["sdpa", "flash_attention_2", "eager"]