Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- ComfyUI-QwenVL-Mod/AILab_QwenVL_GGUF_PromptEnhancer.pyAdded+530
- ComfyUI-QwenVL-Mod/AILab_QwenVL_PromptEnhancer.pyAdded+328
- ComfyUI-QwenVL-Mod/LICENSEAdded+674
- ComfyUI-QwenVL-Mod/README.mdAdded+549
- ComfyUI-QwenVL-Mod/README_it.mdAdded+565
- ComfyUI-QwenVL-Mod/__init__.pyAdded+57
- ComfyUI-QwenVL-Mod/__pycache__/AILab_OutputCleaner.cpython-310.pycAdded
- ComfyUI-QwenVL-Mod/__pycache__/AILab_QwenVL.cpython-310.pycAdded
- ComfyUI-QwenVL-Mod/__pycache__/AILab_QwenVL_GGUF.cpython-310.pycAdded
- ComfyUI-QwenVL-Mod/__pycache__/AILab_QwenVL_GGUF.cpython-312.pycAdded
- ComfyUI-QwenVL-Mod/__pycache__/AILab_QwenVL_GGUF_PromptEnhancer.cpython-310.pycAdded
- ComfyUI-QwenVL-Mod/__pycache__/AILab_QwenVL_PromptEnhancer.cpython-310.pycAdded
- ComfyUI-QwenVL-Mod/__pycache__/__init__.cpython-310.pycAdded
- ComfyUI-QwenVL-Mod/__pycache__/sageattention_patch.cpython-310.pycAdded
- ComfyUI-QwenVL-Mod/custom_models_example.jsonAdded+24
- ComfyUI-QwenVL-Mod/custom_nodes.jsonAdded+13
- ComfyUI-QwenVL-Mod/docs/LLAMA_CPP_PYTHON_VISION_INSTALL.mdAdded+113
- ComfyUI-QwenVL-Mod/docs/custom_models.mdAdded+62
- ComfyUI-QwenVL-Mod/example_workflows/QWenVL.jsonAdded+466
- ComfyUI-QwenVL-Mod/example_workflows/QwenVL_v2.0.0.jsonAdded+364
- ComfyUI-QwenVL-Mod/gguf_models.jsonAdded+288
- ComfyUI-QwenVL-Mod/gguf_requirements.txtAdded+15
- ComfyUI-QwenVL-Mod/hf_models.jsonAdded+101
- ComfyUI-QwenVL-Mod/nodes/__pycache__/story_split_node.cpython-310.pycAdded
- ComfyUI-QwenVL-Mod/nodes/__pycache__/vram_cleanup.cpython-310.pycAdded
- ComfyUI-QwenVL-Mod/nodes/story_split_node.pyAdded+85
- ComfyUI-QwenVL-Mod/nodes/vram_cleanup.pyAdded+168
- ComfyUI-QwenVL-Mod/prompt_cache.jsonAdded
- ComfyUI-QwenVL-Mod/pyproject.tomlAdded+15
- ComfyUI-QwenVL-Mod/requirements.txtAdded+23
- ComfyUI-QwenVL-Mod/runpod/.dockerignoreAdded+103
- ComfyUI-QwenVL-Mod/runpod/BUILD_SCRIPTS.mdAdded+79
- ComfyUI-QwenVL-Mod/runpod/DockerfileAdded+418
- ComfyUI-QwenVL-Mod/runpod/Dockerfile.4090Added+421
- ComfyUI-QwenVL-Mod/runpod/README4090.mdAdded+132
- ComfyUI-QwenVL-Mod/runpod/README5090.mdAdded+133
- ComfyUI-QwenVL-Mod/runpod/build-local-4090.shAdded+56
- ComfyUI-QwenVL-Mod/runpod/build-local-5090.shAdded+56
- ComfyUI-QwenVL-Mod/runpod/docker-compose.ymlAdded+38
- ComfyUI-QwenVL-Mod/sageattention_patch.pyAdded+144
- ComfyUI-QwenVL-Mod/update.mdAdded+810
- ComfyUI-QwenVL-Mod/vastai/READMECivitai.mdAdded+297
- ComfyUI-QwenVL-Mod/vastai/READMEVast4090.mdAdded+179
- ComfyUI-QwenVL-Mod/vastai/READMEVast5090.mdAdded+188
- ComfyUI-QwenVL-Mod/vastai/provisioning.shAdded+333
- ComfyUI-QwenVL-Mod/vastai/template-config.jsonAdded+53
- ComfyUI-QwenVL-Mod/vastai/workflows/PMP-LoRaStack-Upscale-Wildcards.jsonAdded+1433
- ComfyUI-QwenVL-Mod/vastai/workflows/WAN2.2-I2V-AutoPrompt-GGUF.jsonAdded
- ComfyUI-QwenVL-Mod/vastai/workflows/WAN2.2-I2V-AutoPrompt-Story.jsonAdded
- ComfyUI-QwenVL-Mod/vastai/workflows/WAN2.2-I2V-AutoPrompt.jsonAdded
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530# 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.
#
# Models are loaded via llama-cpp-python and configured through gguf_models.json.
# 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.
#
# Source: https://github.com/1038lab/ComfyUI-QwenVL
import base64
import gc
import hashlib
import json
import os
import re
import time
from dataclasses import dataclass
from pathlib import Path
import torch
from huggingface_hub import hf_hub_download, snapshot_download
from llama_cpp import Llama
import folder_paths
from AILab_OutputCleaner import OutputCleanConfig, clean_model_output
# Import cache functions from main module
import sys
sys.path.append(str(Path(__file__).parent))
from AILab_QwenVL import PROMPT_CACHE, get_cache_key, get_alternative_cache_key, save_prompt_cache
# Simple global variable to store last generated prompt
LAST_SAVED_PROMPT = None
NODE_DIR = Path(__file__).parent
GGUF_CONFIG_PATH = NODE_DIR / "gguf_models.json"
PROMPT_CONFIG_PATH = NODE_DIR / "AILab_System_Prompts.json"
def load_prompt_config():
if not PROMPT_CONFIG_PATH.exists():
raise FileNotFoundError(f"[QwenVL] Missing AILab_System_Prompts.json at {PROMPT_CONFIG_PATH}")
try:
with open(PROMPT_CONFIG_PATH, "r", encoding="utf-8") as fh:
data = json.load(fh) or {}
qwen_text = data.get("qwen_text") or {}
styles = qwen_text.get("styles")
translation_prompt = qwen_text.get("translation_prompt")
if not styles or not translation_prompt:
raise ValueError("AILab_System_Prompts.json must include qwen_text.styles and qwen_text.translation_prompt")
return {"styles": styles, "translation_prompt": translation_prompt}
except Exception as exc:
raise RuntimeError(f"[QwenVL] Failed to load AILab_System_Prompts.json: {exc}") from exc
PROMPT_CONFIG = load_prompt_config()
STYLES = PROMPT_CONFIG.get("styles", {})
def _safe_dirname(value: str) -> str:
value = (value or "").strip()
if not value:
return "unknown"
return "".join(ch for ch in value if ch.isalnum() or ch in "._- ").strip() or "unknown"
def _resolve_base_dir(base_dir_value: str) -> Path:
base_dir = Path(base_dir_value)
if base_dir.is_absolute():
return base_dir
return Path(folder_paths.models_dir) / base_dir
def _model_name_to_filename_candidates(model_name: str) -> set[str]:
raw = (model_name or "").strip()
if not raw:
return set()
candidates = {raw, f"{raw}.gguf"}
if " / " in raw:
tail = raw.split(" / ", 1)[1].strip()
candidates.update({tail, f"{tail}.gguf"})
if "/" in raw:
tail = raw.rsplit("/", 1)[-1].strip()
candidates.update({tail, f"{tail}.gguf"})
return candidates
class AILab_QwenVL_GGUF_PromptEnhancer:
RETURN_TYPES = ("STRING",)
RETURN_NAMES = ("ENHANCED_OUTPUT",)
FUNCTION = "process"
CATEGORY = "🔷 QwenVL-Mod/QwenVL"
def __init__(self):
self.llm = None
self.current_signature = None
self.gguf_models = self.load_gguf_models()
self.styles = STYLES
@staticmethod
def load_gguf_models():
fallback = {
"base_dir": "LLM/GGUF",
"models": {},
}
if not GGUF_CONFIG_PATH.exists():
return fallback
try:
with open(GGUF_CONFIG_PATH, "r", encoding="utf-8") as fh:
data = json.load(fh) or {}
except Exception as exc:
print(f"[QwenVL] gguf_models.json load failed: {exc}")
return fallback
base_dir = data.get("base_dir") or fallback["base_dir"]
models: dict[str, dict] = {}
# Legacy/custom direct entries (optional)
legacy_models = data.get("models") or {}
if isinstance(legacy_models, dict):
for name, entry in legacy_models.items():
if isinstance(entry, dict):
models[name] = entry
# Text-only catalog (use Qwen_model; do not use qwenVL_model here)
qwen_repos = data.get("Qwen_model") or {}
if isinstance(qwen_repos, dict):
seen_display_names: set[str] = set()
for repo_key, repo in qwen_repos.items():
if not isinstance(repo, dict):
continue
author = repo.get("author") or repo.get("publisher")
repo_name = repo.get("repo_name") or repo.get("repo_name_override") or repo_key
defaults = repo.get("defaults") if isinstance(repo.get("defaults"), dict) else {}
repo_id = repo.get("repo_id")
alt_repo_ids = repo.get("alt_repo_ids") or []
model_files = repo.get("model_files") or []
for model_file in model_files:
# Prefer short names in UI: just the filename.
display = Path(model_file).name
if display in seen_display_names:
display = f"{display} ({repo_key})"
seen_display_names.add(display)
entry = dict(defaults)
entry.update(
{
"author": author,
"repo_dirname": repo_name,
"repo_id": repo_id,
"alt_repo_ids": alt_repo_ids,
"filename": model_file,
}
)
models[display] = entry
return {"base_dir": base_dir, "models": models}
@classmethod
def INPUT_TYPES(cls):
styles = list(STYLES.keys())
preferred_style = "📝 Enhance"
default_style = preferred_style if preferred_style in styles else (styles[0] if styles else "📝 Enhance")
temp = cls.load_gguf_models()
model_keys = sorted(list((temp.get("models") or {}).keys())) or ["(edit gguf_models.json)"]
default_model = model_keys[0]
return {
"required": {
"model_name": (model_keys, {"default": default_model, "tooltip": "GGUF model entry defined in gguf_models.json."}),
"prompt_text": ("STRING", {"default": "", "multiline": True, "tooltip": "Prompt text to enhance. Leave blank to just emit the preset instruction."}),
"preset_system_prompt": (styles, {"default": default_style}),
"custom_system_prompt": ("STRING", {"default": "", "multiline": True}),
"max_tokens": ("INT", {"default": 256, "min": 32, "max": 1024}),
"temperature": ("FLOAT", {"default": 0.7, "min": 0.1, "max": 1.0}),
"top_p": ("FLOAT", {"default": 0.9, "min": 0.0, "max": 1.0}),
"repetition_penalty": ("FLOAT", {"default": 1.1, "min": 0.5, "max": 2.0}),
"english_output": ("BOOLEAN", {"default": False, "tooltip": "Force final output in English using translation prompt."}),
"device": (["auto", "cuda", "cpu", "mps"], {"default": "auto", "tooltip": "Select device; auto prefers GPU when available."}),
"keep_model_loaded": ("BOOLEAN", {"default": True, "tooltip": "Keep model loaded in memory for faster repeated inference (uses more VRAM)."}),
"seed": ("INT", {"default": 1, "min": 1, "max": 2**32 - 1}),
"keep_last_prompt": ("BOOLEAN", {"default": False, "tooltip": "Keep the last generated prompt instead of creating a new one"}),
}
}
def clear(self):
print(f"[QwenVL PromptEnhancer DEBUG] Starting VRAM cleanup...")
# Force cleanup of LLM model
if self.llm is not None:
try:
# Try to explicitly close the LLM if it has a close method
if hasattr(self.llm, 'close'):
self.llm.close()
elif hasattr(self.llm, '__del__'):
self.llm.__del__()
# Force garbage collection of the model
del self.llm
except Exception as e:
print(f"[QwenVL PromptEnhancer DEBUG] Error closing LLM: {e}")
finally:
self.llm = None
# Clear signature
self.current_signature = None
# Aggressive garbage collection
gc.collect()
# Force CUDA cache cleanup multiple times
if torch.cuda.is_available():
print(f"[QwenVL PromptEnhancer DEBUG] Clearing CUDA cache...")
torch.cuda.empty_cache()
torch.cuda.synchronize()
# Additional cleanup
torch.cuda.empty_cache()
print(f"[QwenVL PromptEnhancer DEBUG] VRAM cleanup completed")
def _resolve_model_path(self, model_name):
models = self.gguf_models.get("models") or {}
entry = models.get(model_name) or {}
# Back-compat: allow workflows to pass a filename instead of a catalog key.
if not entry:
wanted = _model_name_to_filename_candidates(model_name)
for candidate in models.values():
filename = candidate.get("filename")
if filename and Path(filename).name in wanted:
entry = candidate
break
base_dir = _resolve_base_dir(self.gguf_models.get("base_dir") or "LLM/GGUF")
path = entry.get("path")
if path:
return Path(path).expanduser()
filename = entry.get("filename")
if filename:
author = _safe_dirname(str(entry.get("author") or entry.get("publisher") or ""))
repo_dir = _safe_dirname(str(entry.get("repo_dirname") or model_name))
if author and author != "unknown":
return base_dir / author / repo_dir / Path(filename).name
return base_dir / repo_dir / Path(filename).name
return base_dir / model_name
def _maybe_download_model(self, model_name, resolved):
if resolved.exists():
return
models = self.gguf_models.get("models") or {}
entry = models.get(model_name) or {}
if not entry:
wanted = _model_name_to_filename_candidates(model_name)
for candidate in models.values():
filename = candidate.get("filename")
if filename and Path(filename).name in wanted:
entry = candidate
break
repo_ids = [rid for rid in (entry.get("alt_repo_ids") or []) + [entry.get("repo_id")] if rid]
filename = entry.get("filename") or resolved.name
if not repo_ids or not filename:
raise FileNotFoundError(f"[QwenVL] GGUF missing and no repo_id/filename to download: {resolved}")
target_dir = resolved.parent
target_dir.mkdir(parents=True, exist_ok=True)
attempted = []
for repo_id in repo_ids:
attempted.append(repo_id)
print(f"[QwenVL] Downloading GGUF {filename} from {repo_id}")
try:
downloaded = hf_hub_download(
repo_id=repo_id,
filename=filename,
repo_type="model",
local_dir=str(target_dir),
)
downloaded_path = Path(downloaded)
if downloaded_path.exists() and downloaded_path.resolve() != resolved.resolve():
resolved.parent.mkdir(parents=True, exist_ok=True)
downloaded_path.replace(resolved)
except Exception as exc:
print(f"[QwenVL] hf_hub_download failed from {repo_id}: {exc}")
if resolved.exists():
break
try:
snapshot_download(
repo_id=repo_id,
repo_type="model",
local_dir=str(target_dir),
allow_patterns=[filename, f"**/{filename}"],
)
except Exception as exc:
print(f"[QwenVL] Filtered snapshot failed from {repo_id}: {exc}")
if resolved.exists():
break
found = list(target_dir.rglob(filename))
if found:
resolved.parent.mkdir(parents=True, exist_ok=True)
found[0].replace(resolved)
break
if not resolved.exists():
raise FileNotFoundError(f"[QwenVL] GGUF model not found after download: {resolved} (tried: {', '.join(attempted)})")
def _load_model(self, model_name, device):
resolved = self._resolve_model_path(model_name)
self._maybe_download_model(model_name, resolved)
model_cfg = self.gguf_models["models"].get(model_name, {})
context_length = model_cfg.get("context_length", 32768)
signature = (resolved, context_length, device)
if self.llm is not None and self.current_signature == signature:
return
# Force aggressive cleanup before loading new model (especially for same model conflicts)
print(f"[QwenVL PromptEnhancer DEBUG] Forcing cleanup before model loading...")
self.clear()
# Additional wait for CUDA cleanup
if torch.cuda.is_available():
torch.cuda.synchronize()
time.sleep(0.1) # Brief pause for cleanup to complete
resolved.parent.mkdir(parents=True, exist_ok=True)
if not resolved.exists():
raise FileNotFoundError(f"[QwenVL] GGUF model not found: {resolved}")
print(f"[QwenVL] Loading GGUF model from {resolved}")
if device == "auto":
device_choice = "cuda" if torch.cuda.is_available() else ("mps" if getattr(torch.backends, "mps", None) and torch.backends.mps.is_available() else "cpu")
else:
device_choice = device
auto_gpu_layers = -1 if device_choice == "cuda" else 0
threads = None
if device_choice == "cpu":
threads = max(os.cpu_count() or 1, 1)
kwargs = {
"model_path": str(resolved),
"n_ctx": context_length,
"n_gpu_layers": auto_gpu_layers,
"n_threads": None if threads == 0 else threads,
"n_batch": 1024,
"verbose": False,
"chat_format": "qwen",
}
self.llm = Llama(**kwargs)
self.current_signature = signature
def _invoke_llama(
self,
system_prompt,
user_prompt,
max_tokens,
temperature,
top_p,
repetition_penalty,
seed,
):
def _looks_like_planning(text: str) -> bool:
if not text:
return False
return bool(
re.search(
r"(?im)^\s*(okay[,.:]?|first[,.:]?|next[,.:]?|then[,.:]?|wait[,.:]?)\b",
text,
)
or re.search(r"(?i)\b(i\s+(should|need|must|will|am\s+going\s+to|have\s+to))\b", text)
)
def _call(system: str, user: str, temp: float, seed_val: int) -> str:
response = self.llm.create_chat_completion(
messages=[
{"role": "system", "content": system},
{"role": "user", "content": user},
],
max_tokens=max_tokens,
temperature=temp,
top_p=top_p,
repeat_penalty=repetition_penalty,
seed=seed_val,
)
if not response or "choices" not in response or not response["choices"]:
raise RuntimeError("[QwenVL] llama_cpp returned empty response")
return (response["choices"][0].get("message", {}).get("content", "") or "").strip()
raw = _call(system_prompt, user_prompt, float(temperature), int(seed))
cleaned = clean_model_output(raw, OutputCleanConfig(mode="prompt"))
# If the model only emitted thinking/planning (common with some Qwen variants),
# do a single constrained retry asking for final prompt text only.
if not cleaned or _looks_like_planning(cleaned) or "<think" in raw.lower():
retry_system = (
"You are a professional photography prompt writer.\n"
"Output ONLY ONE final photography prompt paragraph.\n"
"No analysis, no planning steps, no first-person, and no <think>.\n"
"No bullet points, no headings, no JSON, no markdown, no quotes."
)
retry_user = (
"Rewrite the following into the final prompt paragraph:\n\n"
f"{raw}\n"
)
raw_retry = _call(retry_system, retry_user, 0.4, int(seed) + 999)
cleaned_retry = clean_model_output(raw_retry, OutputCleanConfig(mode="prompt"))
if cleaned_retry and not _looks_like_planning(cleaned_retry):
return cleaned_retry
return cleaned or ""
def process(
self,
model_name,
prompt_text,
preset_system_prompt,
custom_system_prompt,
max_tokens,
temperature,
top_p,
repetition_penalty,
english_output,
device,
keep_model_loaded,
seed,
keep_last_prompt,
):
global LAST_SAVED_PROMPT
# Simple keep last prompt logic
if keep_last_prompt: # Keep last prompt enabled
print(f"[QwenVL PromptEnhancer GGUF] Keep last prompt enabled - using last saved prompt")
if LAST_SAVED_PROMPT:
print(f"[QwenVL PromptEnhancer GGUF] Using last prompt: {LAST_SAVED_PROMPT[:50]}...")
return (LAST_SAVED_PROMPT,)
else:
print(f"[QwenVL PromptEnhancer GGUF] No previous prompt found, returning empty")
return ("",)
# Always generate when keep last prompt is disabled
print(f"[QwenVL PromptEnhancer GGUF] Keep last prompt disabled - generating new prompt")
# Generate cache key with all inputs including seed
cache_key = get_cache_key(model_name, preset_system_prompt, prompt_text, seed=seed)
# Check cache first (only for random mode)
if cache_key in PROMPT_CACHE:
cached_text = PROMPT_CACHE[cache_key].get("text", "")
if cached_text:
print(f"[QwenVL PromptEnhancer GGUF] Using cached prompt for seed {seed}: {cache_key[:8]}...")
return (cached_text.strip(),)
style_entry = self.styles.get(preset_system_prompt, {})
system_prompt = (custom_system_prompt.strip() or style_entry.get("system_prompt") or "").strip()
if not system_prompt:
raise ValueError("system_prompt is empty; check AILab_System_Prompts.json or preset selection.")
system_prompt = (
f"{system_prompt}\n\n"
"Return only the final prompt text. No preface, no explanations, no analysis, no JSON, no markdown fences, and no </think>.\n"
"Do not write planning steps (no 'First', 'Next', 'Then') and do not use first-person ('I', 'we')."
)
user_prompt = prompt_text.strip() or "Describe a scene vividly."
merged_prompt = user_prompt
self._load_model(model_name, device)
enhanced = self._invoke_llama(
system_prompt=system_prompt,
user_prompt=merged_prompt,
max_tokens=max_tokens,
temperature=temperature,
top_p=top_p,
repetition_penalty=repetition_penalty,
seed=seed,
)
if english_output:
translated = self._invoke_llama(
system_prompt=(
PROMPT_CONFIG.get("translation_prompt")
or "Return a single English paragraph (150-300 words). No prefixes, bullets, JSON, or </think>. "
"Cover subject, environment, lighting, camera settings, composition, color/texture, and style. Output only the prompt."
),
user_prompt=enhanced,
max_tokens=max_tokens,
temperature=0.3,
top_p=0.95,
repetition_penalty=1.05,
seed=seed + 1,
)
final = clean_model_output(translated, OutputCleanConfig(mode="prompt")) or translated.strip()
else:
final = clean_model_output(enhanced, OutputCleanConfig(mode="prompt")) or enhanced.strip()
# Cache the generated text
PROMPT_CACHE[cache_key] = {
"text": final,
"timestamp": None, # GGUF PromptEnhancer doesn't have CUDA events
"model": model_name,
"preset": preset_system_prompt,
"seed": seed,
"image_hash": None, # PromptEnhancer doesn't use images
"video_hash": None # PromptEnhancer doesn't use videos
}
save_prompt_cache() # Save cache to file
print(f"[QwenVL PromptEnhancer GGUF] Cached new prompt for seed {seed}: {cache_key[:8]}...")
try:
# Save the generated prompt for future bypass mode
LAST_SAVED_PROMPT = final
print(f"[QwenVL PromptEnhancer GGUF] Saved prompt for bypass mode: {final[:50]}...")
return (final,)
finally:
if not keep_model_loaded:
self.clear()
print(f"[QwenVL PromptEnhancer GGUF] keep_model_loaded=False - cleaning up model...")
@staticmethod
def _is_english(text):
letters = len(re.findall(r"[A-Za-z]", text))
tokens = len(re.findall(r"\S", text))
return tokens > 0 and letters / tokens > 0.7
@staticmethod
def _strip_think(text):
return clean_model_output(text, OutputCleanConfig(mode="prompt"))
NODE_CLASS_MAPPINGS = {
"AILab_QwenVL_GGUF_PromptEnhancer": AILab_QwenVL_GGUF_PromptEnhancer,
}
NODE_DISPLAY_NAME_MAPPINGS = {
"AILab_QwenVL_GGUF_PromptEnhancer": "QwenVL-Mod Prompt Enhancer (GGUF)",
}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328# 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.
#
# Source: https://github.com/1038lab/ComfyUI-QwenVL
import gc
import hashlib
import json
import platform
from enum import Enum
from pathlib import Path
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from AILab_QwenVL import (
ATTENTION_MODES,
HF_TEXT_MODELS,
HF_VL_MODELS,
PROMPT_CACHE,
get_cache_key,
get_alternative_cache_key,
save_prompt_cache,
QwenVLBase,
Quantization,
TOOLTIPS,
)
# Simple global variable to store last generated prompt
LAST_SAVED_PROMPT = None
NODE_DIR = Path(__file__).parent
SYSTEM_PROMPTS_PATH = NODE_DIR / "AILab_System_Prompts.json"
DEFAULT_STYLES = {
"📝 Enhance": "Expand and enrich this prompt with vivid visual context:",
"📝 Refine": "Polish this prompt for clarity and precise AI interpretation:",
"📝 Creative Rewrite": "Rewrite this prompt imaginatively while preserving intent:",
"📝 Detailed Visual": "Turn this prompt into a highly detailed visual description:",
"📝 Artistic Style": "Describe this prompt in artistic language suitable for image generation:",
"📝 Technical Specs": "Convert this prompt into clear technical parameters:",
}
def _load_prompt_styles() -> dict[str, str]:
try:
with open(SYSTEM_PROMPTS_PATH, "r", encoding="utf-8") as fh:
data = json.load(fh) or {}
qwen_text = data.get("qwen_text") or {}
styles = qwen_text.get("styles") or {}
if isinstance(styles, dict) and styles:
resolved = {
name: entry.get("system_prompt", "")
for name, entry in styles.items()
if isinstance(entry, dict) and entry.get("system_prompt")
}
if resolved:
return resolved
except FileNotFoundError:
pass
except Exception as exc:
print(f"[QwenVL] Prompt style load failed: {exc}")
return DEFAULT_STYLES
PROMPT_STYLES = _load_prompt_styles()
class AILab_QwenVL_PromptEnhancer(QwenVLBase):
STYLES = PROMPT_STYLES
RETURN_TYPES = ("STRING",)
RETURN_NAMES = ("ENHANCED_OUTPUT",)
FUNCTION = "process"
CATEGORY = "🔷 QwenVL-Mod/QwenVL"
def __init__(self):
super().__init__()
self.text_model = None
self.text_tokenizer = None
self.text_signature = None
@classmethod
def INPUT_TYPES(cls):
models = list(HF_TEXT_MODELS.keys()) + [name for name in HF_VL_MODELS.keys() if name not in HF_TEXT_MODELS]
default_model = models[0] if models else "Qwen3-VL-4B-Instruct"
styles = list(cls.STYLES.keys())
preferred_style = "📝 Enhance"
default_style = preferred_style if preferred_style in styles else (styles[0] if styles else "📝 Enhance")
return {
"required": {
"model_name": (models, {"default": default_model, "tooltip": TOOLTIPS["model_name"]}),
"quantization": (Quantization.get_values(), {"default": Quantization.FP16.value, "tooltip": TOOLTIPS["quantization"]}),
"attention_mode": (ATTENTION_MODES, {"default": "auto", "tooltip": TOOLTIPS["attention_mode"]}),
"use_torch_compile": ("BOOLEAN", {"default": False, "tooltip": TOOLTIPS["use_torch_compile"]}),
"device": (["auto", "cuda", "cpu", "mps"], {"default": "auto", "tooltip": TOOLTIPS["device"]}),
"prompt_text": ("STRING", {"default": "", "multiline": True, "tooltip": "Prompt text to enhance. Leave blank to just emit the preset instruction."}),
"enhancement_style": (styles, {"default": default_style}),
"custom_system_prompt": ("STRING", {"default": "", "multiline": True}),
"max_tokens": ("INT", {"default": 256, "min": 32, "max": 1024}),
"temperature": ("FLOAT", {"default": 0.7, "min": 0.1, "max": 1.0}),
"top_p": ("FLOAT", {"default": 0.9, "min": 0.0, "max": 1.0}),
"repetition_penalty": ("FLOAT", {"default": 1.1, "min": 0.5, "max": 2.0}),
"keep_model_loaded": ("BOOLEAN", {"default": True}),
"seed": ("INT", {"default": 1, "min": 1, "max": 2**32 - 1}),
"keep_last_prompt": ("BOOLEAN", {"default": False, "tooltip": "Keep the last generated prompt instead of creating a new one"}),
}
}
def process(
self,
model_name,
quantization,
attention_mode,
use_torch_compile,
device,
prompt_text,
enhancement_style,
custom_system_prompt,
max_tokens,
temperature,
top_p,
repetition_penalty,
keep_model_loaded,
seed,
keep_last_prompt=False,
):
global LAST_SAVED_PROMPT
# Simple keep last prompt logic
if keep_last_prompt:
print(f"[QwenVL PromptEnhancer HF] Keep last prompt enabled - using last saved prompt")
if LAST_SAVED_PROMPT:
print(f"[QwenVL PromptEnhancer HF] Using last prompt: {LAST_SAVED_PROMPT[:50]}...")
return (LAST_SAVED_PROMPT,)
else:
print(f"[QwenVL PromptEnhancer HF] No previous prompt found, returning empty")
return ("",)
# Always generate when keep last prompt is disabled
print(f"[QwenVL PromptEnhancer HF] Keep last prompt disabled - generating new prompt")
base_instruction = custom_system_prompt.strip() or self.STYLES.get(
enhancement_style,
next(iter(self.STYLES.values()), ""),
)
user_prompt = prompt_text.strip() or "Describe a scene vividly."
merged_prompt = f"{user_prompt}\n\n{base_instruction}".strip()
if model_name in HF_TEXT_MODELS:
enhanced = self._invoke_text(
model_name,
quantization,
device,
merged_prompt,
max_tokens,
temperature,
top_p,
repetition_penalty,
keep_model_loaded,
seed,
)
else:
enhanced = self._invoke_qwen(
model_name,
quantization,
attention_mode,
use_torch_compile,
device,
merged_prompt,
max_tokens,
temperature,
top_p,
repetition_penalty,
keep_model_loaded,
seed,
)
# Save the generated prompt for future bypass mode
LAST_SAVED_PROMPT = enhanced.strip()
print(f"[QwenVL PromptEnhancer HF] Saved prompt for bypass mode: {LAST_SAVED_PROMPT[:50]}...")
return (enhanced.strip(),)
def _invoke_qwen(
self,
model_name,
quantization,
attention_mode,
use_torch_compile,
device,
prompt,
max_tokens,
temperature,
top_p,
repetition_penalty,
keep_model_loaded,
seed,
):
output = self.run(
model_name=model_name,
quantization=quantization,
preset_prompt="🪄 Prompt Refine & Expand",
custom_prompt=prompt,
image=None,
video=None,
frame_count=1,
max_tokens=max_tokens,
temperature=temperature,
top_p=top_p,
num_beams=1,
repetition_penalty=repetition_penalty,
seed=seed,
keep_model_loaded=keep_model_loaded,
attention_mode=attention_mode,
use_torch_compile=use_torch_compile,
device=device,
)
return output[0]
def _load_text_model(self, model_name, quantization, device_choice):
info = HF_TEXT_MODELS.get(model_name, {})
repo_id = info.get("repo_id")
if not repo_id:
raise ValueError(f"[QwenVL] Missing repo_id for text model: {model_name}")
if device_choice == "auto":
device = "cuda" if torch.cuda.is_available() else ("mps" if getattr(torch.backends, "mps", None) and torch.backends.mps.is_available() else "cpu")
else:
device = device_choice
if quantization == Quantization.Q4:
quant_cfg = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_compute_dtype=torch.float16,
bnb_4bit_quant_type="nf4",
bnb_4bit_use_double_quant=True,
)
elif quantization == Quantization.Q8:
quant_cfg = BitsAndBytesConfig(load_in_8bit=True)
else:
quant_cfg = None
signature = (repo_id, quantization, device)
if self.text_model is not None and self.text_signature == signature:
return
self.text_model = None
self.text_tokenizer = None
self.text_signature = None
load_kwargs = {}
if quant_cfg:
load_kwargs["quantization_config"] = quant_cfg
else:
load_kwargs["torch_dtype"] = torch.float16 if device == "cuda" else torch.float32
print(f"[QwenVL] Loading text model {model_name} ({quantization})")
self.text_tokenizer = AutoTokenizer.from_pretrained(repo_id, trust_remote_code=True)
self.text_model = AutoModelForCausalLM.from_pretrained(repo_id, trust_remote_code=True, **load_kwargs).eval()
self.text_model.to(device)
self.text_signature = signature
def _invoke_text(
self,
model_name,
quantization,
device,
prompt,
max_tokens,
temperature,
top_p,
repetition_penalty,
keep_model_loaded,
seed,
):
self._load_text_model(model_name, quantization, device)
if device == "auto":
device_choice = "cuda" if torch.cuda.is_available() else ("mps" if getattr(torch.backends, "mps", None) and torch.backends.mps.is_available() else "cpu")
else:
device_choice = device
inputs = self.text_tokenizer(prompt, return_tensors="pt").to(device_choice)
kwargs = {
"max_new_tokens": max_tokens,
"repetition_penalty": repetition_penalty,
"do_sample": True,
"temperature": temperature,
"top_p": top_p,
"eos_token_id": self.text_tokenizer.eos_token_id,
"pad_token_id": self.text_tokenizer.eos_token_id,
}
outputs = self.text_model.generate(**inputs, **kwargs)
decoded = self.text_tokenizer.decode(outputs[0], skip_special_tokens=True)
prefix = self.text_tokenizer.decode(inputs["input_ids"][0], skip_special_tokens=True)
result = decoded[len(prefix) :].strip()
# Cache the generated text
# PROMPT_CACHE[cache_key] = {
# "text": result,
# "timestamp": None, # PromptEnhancer doesn't have CUDA events
# "model": model_name,
# "preset": style,
# "seed": seed,
# "image_hash": None, # PromptEnhancer doesn't use images
# "video_hash": None # PromptEnhancer doesn't use videos
# }
# save_prompt_cache() # Save cache to file
# print(f"[QwenVL PromptEnhancer HF] Cached new prompt for seed {seed}: {cache_key[:8]}...")
if not keep_model_loaded:
self.text_model = None
self.text_tokenizer = None
self.text_signature = None
if torch.cuda.is_available():
torch.cuda.empty_cache()
return result
NODE_CLASS_MAPPINGS = {
"AILab_QwenVL_PromptEnhancer": AILab_QwenVL_PromptEnhancer,
}
NODE_DISPLAY_NAME_MAPPINGS = {
"AILab_QwenVL_PromptEnhancer": "QwenVL-Mod Prompt Enhancer",
}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674 GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549# **QwenVL-Mod for ComfyUI**
[](https://github.com/comfyanonymous/ComfyUI)
[](LICENSE)
[](https://github.com/huchukato/ComfyUI-QwenVL-Mod/releases)
[](https://python.org)
[](https://pytorch.org)
[](https://developer.nvidia.com/cuda-zone)
[](https://huggingface.co/Qwen)
[](https://github.com/huchukato/ComfyUI-QwenVL-Mod)
[](https://github.com/huchukato/ComfyUI-QwenVL-Mod)
[](https://github.com/huchukato/ComfyUI-QwenVL-Mod/issues)
[](https://lightning.ai/huchukato/environments/comfyui-v0-14-2-wan2-2-qwen3-vl-autoprompt)
[](https://buymeacoffee.com/huchukato)
## 🚀 **API Support & Troubleshooting**
Having issues with ComfyUI API? We've got you covered!
### 📋 **Quick API Help**
- 📖 **[API Guide](./API_GUIDE.md)** - Complete API documentation
- 🛠️ **[Debug Script](./debug_api.py)** - Automated API diagnostics
- 🎯 **Example Workflows** - Ready-to-use API templates
### 🔧 **Common API Issues**
| Issue | Solution |
|-------|----------|
| "node not found" | Check QwenVL-Mod installation |
| "model not found" | Verify model files in `/models/` |
| "invalid input" | Check parameter formats |
| "queue full" | Wait for current jobs |
### 🧪 **Quick Debug**
```bash
# Run API diagnostics
python debug_api.py --url http://localhost:18188
# Check available nodes
curl http://localhost:18188/object_info
# Test simple workflow
curl -X POST http://localhost:18188/prompt -d @test_workflow.json
```
### 📞 **Need More Help?**
Ask user for:
1. **Error message** (exact text)
2. **Workflow JSON** (sanitized)
3. **Debug output** (from debug_api.py)
4. **ComfyUI logs** (API section)
---
The ComfyUI-QwenVL custom node integrates powerful Qwen-VL series of vision-language models (LVLMs) from Alibaba Cloud, including latest Qwen3-VL and Qwen2.5-VL, plus GGUF backends and text-only Qwen3 support. This advanced node enables seamless multimodal AI capabilities within your ComfyUI workflows, allowing for efficient text generation, image understanding, and video analysis.
<img width="749" height="513" alt="Qwen3-VL-Mod" src="https://github.com/user-attachments/assets/0f10b887-1953-4923-b813-37ccacb8a9aa" />
## **📰 News & Updates**
* **2026/03/06**: **v2.2.4** 🔧 **Critical OOM Fix + Quantization Removal**. [[Update](update.md#version-224-20260306)]
> 🚨 **BitsAndBytes Disabled**: Removed problematic quantization causing OOM on RTX 5090.
> ✅ **FP16 Only**: All HF nodes now use stable FP16 (~6GB VRAM).
> 🎯 **Cleaner Interface**: Removed quantization dropdown - use GGUF nodes for quantized models.
> 🔧 **Both Nodes Fixed**: Applied fixes to Standard and Advanced nodes with consistent parameters.
> 💡 **User Guidance**: HF nodes for quality, GGUF nodes for quantization - clear separation.
* **2026/02/27**: **v2.2.3** 🔧 **CUDA 13 Compatibility Fix + Redundancy Removal**. [[Update](update.md#version-223-20260227)]
> 🔧 **Removed unload_after_run**: Eliminated redundant checkbox from all QwenVL nodes to prevent CUDA 13 conflicts.
> 🐛 **Fixed Parameter Errors**: Resolved "missing 1 required positional argument: unload_after_run" errors in all nodes.
> 🎯 **Simplified Interface**: Cleaner node interface without redundant parameters.
> 🧠 **VRAM Cleanup Node**: Maintained for manual cleanup when needed.
> 🏆 **Community Credits**: Thanks to user feedback that identified redundancy and parameter issues.
* **2026/02/27**: **v2.2.3** 🚀 Critical T2V/I2V Fixes + ComfyUI Optimizations. [[Update](https://github.com/huchukato/ComfyUI-QwenVL-Mod/blob/main/update.md#version-223-20260227)]
> 🚀 **Batch Processing**: Fixed critical T2V → GGUF issue with batch images from video generation.
> 🔄 **Same Model Reuse**: Resolved conflict when using same model between T2V and I2V nodes.
> ⚙️ **Flash Attention 2**: Added Flash Attention 2 support for performance boost on compatible hardware.
> ⚙️ **ComfyUI Args**: Optimized startup arguments with validated experimental features.
> 🔧 **keep_model_loaded**: Added missing parameter to PromptEnhancer for consistent memory management.
> 🐳 **Final Docker Build**: Optimized build with all fixes and maximum performance.
* **2026/02/18**: **v2.2.1** 🔧 Critical GGUF VRAM Fix + Docker Optimized. [[Update](https://github.com/huchukato/ComfyUI-QwenVL-Mod/blob/main/update.md#version-221-20260218)]
> 🔧 **GGUF VRAM Fix**: Resolved critical VRAM leak issue causing crashes after 2 executions.
> 🧹 **Aggressive Cleanup**: Implemented complete VRAM cleanup for all GGUF nodes (AILab_QwenVL_GGUF and PromptEnhancer).
> 🚀 **Stable Performance**: GGUF nodes now work reliably without VRAM accumulation.
> 🐳 **Docker Enhanced**: Updated Dockerfiles with RunPod-tested methods for Jupyter and FileBrowser.
> 🔄 **ComfyUI Latest**: Always latest stable version without manual updates.
> 📡 **Complete SSH**: Server + client SSH for full networking functionality.
> 🎯 **Jupyter Terminal**: Adopted RunPod method for working terminal.
* **2026/02/15**: **v2.2.0** 🎬 WAN 2.2 Story Generation System. [[Update](https://github.com/huchukato/ComfyUI-QwenVL-Mod/blob/main/update.md#version-220-20260215)]
> 🎬 **Story Generation**: Complete 4-segment video story generation with WAN 2.2
> 🔄 **Auto-Split Node**: Intelligent prompt splitting for continuous 20-second videos
> 📝 **Show Text Node**: Built-in text display node without external dependencies
> 🎯 **Enhanced Prompts**: Optimized WAN 2.2 NSFW Story prompts with better formatting
> ⚡ **Performance**: Optimized context settings for 8B models (65,536 tokens)
> 🐳 **Docker Ready**: Complete Story system integrated in Docker containers
> 🎨 **Workflows**: Ready-to-use WAN 2.2 Story and T2V workflows included
* **2026/02/14**: **v2.1.0** User-Friendly Keep Last Prompt Feature. [[Update](https://github.com/huchukato/ComfyUI-QwenVL-Mod/blob/main/update.md#version-210-20260214)]
> [!NOTE]
* **2026/02/12**: **v2.0.9** Bypass Mode parameter for prompt persistence. [[Update](https://github.com/huchukato/ComfyUI-QwenVL-Mod/blob/main/update.md#version-209-20260212)]
> 🎛️ **Bypass Mode**: New `bypass_mode` parameter allows maintaining previously generated prompts without regeneration.
> 🔄 **Smart Cache**: When bypass mode is enabled, nodes retrieve the most recent cached prompt for the current model.
> 🎯 **Perfect Workflow**: Generate prompts once, then enable bypass mode to preserve them while changing inputs.
> ⚡ **Zero Resource Usage**: Bypass mode consumes no computational resources - instant response.
> 📋 **Universal Feature**: Available across all nodes (HF, GGUF, PromptEnhancer, Advanced variants).
> 🎮 **Simple Control**: Just toggle the bypass_mode checkbox to enable/disable prompt persistence.
* **2026/02/06**: **v2.0.8** Bug fixes and stability improvements. [[Update](https://github.com/huchukato/ComfyUI-QwenVL-Mod/blob/main/update.md#version-208-20260206)]
> [!NOTE]
> 🐛 **Bug Fixes**: Fixed JSON syntax error in system prompts and undefined variable issues.
> 🌐 **Multilingual Support**: Complete multilingual support added to all WAN 2.2 presets.
> 🎨 **Style Detection**: Enhanced visual style detection for anime, 3D, pixel art, and more.
> 🔧 **Stability**: Reverted problematic fixed seed improvements to maintain stable operation.
> 📝 **Documentation**: Updated README and changelog with today's improvements.
* **2026/02/04**: **v2.0.7** Smart prompt caching system with Fixed Seed Mode. [[Update](https://github.com/huchukato/ComfyUI-QwenVL-Mod/blob/main/update.md#version-207-20260204)]
> [!NOTE]
> 🧠 **Smart Caching**: Automatic prompt caching prevents regeneration of identical prompts.
> 🔒 **Fixed Seed Mode**: Set any fixed seed value to maintain consistent prompts regardless of media variations.
> ⚡ **Performance Boost**: Instant response for cached prompts with zero model loading time.
> 🔧 **Code Maintenance**: Removed deprecated parameters across all download functions for future compatibility.
> 📈 **GGUF Enhancement**: Increased default context size from 8192 to 32768 for better model utilization.
> 🔄 **Universal Caching**: Fixed Seed Mode and smart caching now available across all nodes (HF, GGUF, PromptEnhancer).
> 🎯 **Simplified Logic**: Streamlined caching system that always includes seed for predictable behavior across all seed values.
### 🔥 Version 2.1.0 - Enhanced NSFW Support & Lighting Accuracy
- **🔥 Stronger NSFW Instructions**: Enhanced system prompts with explicit directives for uncensored content generation
- **🔦 Fixed Lighting Invention**: Corrected AI tendency to add lights not present in source images
- **🎯 Improved Accuracy**: Better content fidelity for both NSFW descriptions and lighting analysis
- **🔄 Updated GGUF Models**: Replaced noctrex models with mradermacher v2/v3 variants for better performance
- **📦 Enhanced Model Selection**: Added Josiefied-Qwen3-VL-4B-Instruct-abliterated-beta-v1 (HF only) (HF, GGUF, PromptEnhancer).
* **2026/02/03**: **v2.0.6** Professional cinematography enhancement for all WAN 2.2 presets. [[Update](https://github.com/huchukato/ComfyUI-QwenVL-Mod/blob/main/update.md#version-206-20260203)]
> [!NOTE]
> 🎬 **Professional Specs**: All WAN 2.2 presets now include comprehensive cinematography specifications.
> 📹 **Technical Details**: Light sources, shot types, lens specs, camera movements, color tone requirements.
> 🎯 **Consistent Branding**: Updated preset names with WAN family branding for better organization.
* **2026/03/13**: **v2.2.4** 🎬 Critical I2V Timeline Fixes & NSFW Presets Optimization. [[Update](https://github.com/huchukato/ComfyUI-QwenVL-Mod/blob/main/update.md#version-240-20260313)]
> 🎬 **I2V Timeline (20s) Critical Fixes**:
> - ✅ **Style Coherence**: Fixed AI changing anime→realism mid-sequence
> - ✅ **Character Stability**: Fixed characters disappearing/appearing incorrectly
> - ✅ **Natural Lighting**: Fixed AI adding artificial lights not in image
> - ✅ **Timeline Structure**: Fixed continuous numbering (6,7,8...) instead of 0-5 restart
> - ✅ **Format Consistency**: Fixed missing parentheses and unwanted labels
> - 🔧 **All 8 NSFW Presets**: Complete specifications + emoji display restored
> - 📋 **Token Settings Guide**: Comprehensive workflow note for optimal parameters
* **2026/02/01**: **v2.0.5** Extended Storyboard preset added for WAN 2.2 format continuity. [[Update](https://github.com/huchukato/ComfyUI-QwenVL-Mod/blob/main/update.md#version-205-20260201)]
> [!NOTE]
> 🎬 **Extended Storyboard**: New preset for seamless storyboard-to-storyboard generation with timeline format.
> 🔄 **Continuity Focus**: Each paragraph repeats previous content for smooth transitions.
> 🎯 **WAN 2.2 Compatible**: Same timeline structure and NSFW support as I2V preset.
* **2026/02/01**: **v2.0.4** Stability update - removed SageAttention for better compatibility and model output reliability. [[Update](https://github.com/huchukato/ComfyUI-QwenVL-Mod/blob/main/update.md#version-204-20260201)]
> [!NOTE]
> 🔧 **Flash Attention 2**: Still available for 2-3x speedup on compatible hardware.
> 🛡️ **Enhanced Stability**: Clean attention pipeline with SDPA as reliable fallback.
* **2026/02/01**: **v2.0.3** SageAttention compatibility fix for proper patching across transformer versions. [[Update](https://github.com/huchukato/ComfyUI-QwenVL-Mod/blob/main/update.md#version-203-20260201)]
> [!NOTE]
> 🔧 **Critical Fix**: Resolved AttributeError preventing Flash Attention 2 from working with certain transformer versions.
> ⚡ **Performance Restored**: 2-5x speedup now works correctly with 8-bit quantization on compatible hardware.
* **2026/02/01**: **v2.0.2** Enhanced model accessibility, improved custom prompt logic, and expanded NSFW content generation. [[Update](https://github.com/huchukato/ComfyUI-QwenVL-Mod/blob/main/update.md#version-202-20260201)]
> [!NOTE]
> 🚀 **Free Abliterated Models**: Added token-free uncensored models as defaults for better accessibility.
> 🔧 **Custom Prompt Fix**: Now combines with preset templates instead of replacing them across all nodes.
> 📝 **Enhanced NSFW**: Comprehensive descriptions for adult content generation with detailed act specifications.
> 🎬 **WAN 2.2 Priority**: Moved video generation preset to top position for faster workflow access.
* **2026/01/30**: **v2.0.1-enhanced** Added Flash Attention 2 support and WAN 2.2 integration. [[Update](https://github.com/huchukato/ComfyUI-QwenVL-Mod/blob/main/update.md#version-201-enhanced-20260130)]
> [!NOTE]
> 🚀 **Flash Attention 2**: 2-5x performance boost with 8-bit quantized attention for RTX 30+ GPUs.
> 🎬 **WAN 2.2 Integration**: New specialized prompts for cinematic video generation - convert images/videos to 5-second timeline descriptions (I2V) or text to video (T2V) with professional scene direction.
>
* **2025/12/22**: **v2.0.0** Added GGUF supported nodes and Prompt Enhancer nodes. [[Update](https://github.com/1038lab/ComfyUI-QwenVL/blob/main/update.md#version-200-20251222)]
> [!IMPORTANT]
> Install llama-cpp-python before running GGUF nodes [instruction](docs/LLAMA_CPP_PYTHON_VISION_INSTALL.md)
>

* **2025/11/10**: **v1.1.0** Runtime overhaul with attention-mode selector, flash-attn auto detection, smarter caching, and quantization/torch.compile controls in both nodes. [[Update](https://github.com/1038lab/ComfyUI-QwenVL/blob/main/update.md#version-110-20251110)]
* **2025/10/31**: **v1.0.4** Custom Models Supported [[Update](https://github.com/1038lab/ComfyUI-QwenVL/blob/main/update.md#version-104-20251031)]
* **2025/10/22**: **v1.0.3** Models list updated [[Update](https://github.com/1038lab/ComfyUI-QwenVL/blob/main/update.md#version-103-20251022)]
* **2025/10/17**: **v1.0.0** Initial Release
* Support for Qwen3-VL and Qwen2.5-VL series models.
* Automatic model downloading from Hugging Face.
* On-the-fly quantization (4-bit, 8-bit, FP16).
* Preset and Custom Prompt system for flexible and easy use.
* **Includes both a standard and an advanced node** for users of all levels.
* Hardware-aware safeguards for FP8 model compatibility.
* Image and Video (frame sequence) input support.
* "Keep Model Loaded" option for improved performance on sequential runs.
* **Seed parameter** for reproducible generation.
[](https://github.com/1038lab/ComfyUI-QwenVL/blob/main/example_workflows/QWenVL.json)
## **✨ Features**
[](https://github.com/huchukato/ComfyUI-QwenVL-Mod)
[](https://huggingface.co/Qwen)
[](https://github.com/huchukato/ComfyUI-QwenVL-Mod)
[](https://github.com/huchukato/ComfyUI-QwenVL-Mod)
[](https://github.com/huchukato/ComfyUI-QwenVL-Mod)
[](https://github.com/huchukato/ComfyUI-QwenVL-Mod)
[](https://github.com/huchukato/ComfyUI-QwenVL-Mod)
* **Standard & Advanced Nodes**: Includes a simple QwenVL node for quick use and a QwenVL (Advanced) node with fine-grained control over generation.
* **Prompt Enhancers**: Dedicated text-only prompt enhancers for both HF and GGUF backends.
* **Preset & Custom Prompts**: Choose from a list of convenient preset prompts or write your own for full control. Custom prompts now combine with preset templates for enhanced flexibility.
* **Smart Prompt Caching**: Automatic caching system prevents regeneration of identical prompts, dramatically improving performance for repeated inputs. Cache persists across ComfyUI restarts.
* **🎛️ Bypass Mode**: New `bypass_mode` parameter allows maintaining previously generated prompts without regeneration. Generate once, then enable bypass mode to preserve prompts while changing inputs. Zero resource usage in bypass mode.
* **Fixed Seed Mode**: Set seed = 1 to ignore image/video changes and maintain consistent prompts regardless of media variations. Perfect for stable workflow outputs.
* **WAN 2.2 Integration**: Specialized prompts for WAN 2.2 I2V (image-to-video) and T2V (text-to-video) generation with professional cinematography specifications and cinematic timeline structure. I2V preset prioritized for faster workflow access.
* **Professional Cinematography**: All WAN 2.2 presets include comprehensive technical specifications - light sources, shot types, lens specifications, camera movements, and color tone requirements for professional video generation.
* **Extended Storyboard**: New preset for seamless storyboard-to-storyboard generation with WAN 2.2 format compatibility, continuity focus, and professional cinematography details.
* **WAN Family Branding**: Consistent naming across all WAN 2.2 presets for better organization and workflow clarity.
* **Free Abliterated Models**: Default models include token-free uncensored options (Qwen3-4B-abliterated-TIES, Qwen3-8B-abliterated-TIES) for immediate accessibility.
* **Multi-Model Support**: Easily switch between various official Qwen-VL models with smart 4B-first ordering for VRAM efficiency.
* **Automatic Model Download**: Models are downloaded automatically on first use.
* **Smart Quantization**: Balance VRAM and performance with 4-bit, 8-bit, and FP16 options. 8-bit quantization enabled by default for optimal accessibility.
* **Optimized Attention**: Clean attention pipeline with Flash Attention 2 support and stable SDPA fallback. No complex patching that could interfere with model output.
* **Hardware-Aware**: Automatically detects GPU capabilities and prevents errors with incompatible models (e.g., FP8).
* **Reproducible Generation**: Use the seed parameter to get consistent outputs, with Fixed Seed Mode for ultimate stability.
* **Memory Management**: "Keep Model Loaded" option to retain the model in VRAM for faster processing.
* **Image & Video Support**: Accepts both single images and video frame sequences as input.
* **Robust Error Handling**: Provides clear error messages for hardware or memory issues.
* **Clean Console Output**: Minimal and informative console logs during operation.
## **🚀 Installation**
1. Clone this repository to your ComfyUI/custom_nodes directory:
```
cd ComfyUI/custom_nodes
git clone https://github.com/huchukato/ComfyUI-QwenVL-Mod.git
```
2. Install the required dependencies:
```
cd ComfyUI/custom_nodes/ComfyUI-QwenVL-Mod
pip install -r requirements.txt
```
3. Restart ComfyUI.
### **Optional: Flash Attention 2 Installation**
For 2-3x performance boost with compatible GPUs:
```bash
# Install Flash Attention 2 (recommended)
pip install flash-attn --no-build-isolation
# Or compile from source
git clone https://github.com/Dao-AILab/flash-attention.git
cd flash-attention
python setup.py install
```
**Requirements for Flash Attention 2:**
- NVIDIA GPU with capability >= 8.6 (RTX 20/30/40/50 series)
- CUDA >= 12.0
- PyTorch >= 2.3.0
See [Flash Attention 2 section](#-flash-attention-2-performance-boost) for details.
## **🧭 Node Overview**
### **Transformers (HF) Nodes**
- **QwenVL**: Quick vision-language inference (image/video + preset/custom prompts).
- **QwenVL (Advanced)**: Full control over sampling, device, and performance settings.
- **QwenVL Prompt Enhancer**: Text-only prompt enhancement (supports both Qwen3 text models and QwenVL models in text mode).
### **GGUF (llama.cpp) Nodes**
- **QwenVL (GGUF)**: GGUF vision-language inference.
- **QwenVL (GGUF Advanced)**: Extended GGUF controls (context, GPU layers, etc.).
- **QwenVL Prompt Enhancer (GGUF)**: GGUF text-only prompt enhancement.
## **🧩 GGUF Nodes (llama.cpp backend)**
This repo includes **GGUF** nodes powered by `llama-cpp-python` (separate from the Transformers-based nodes).
- **Nodes**: `QwenVL (GGUF)`, `QwenVL (GGUF Advanced)`, `QwenVL Prompt Enhancer (GGUF)`
- **Model folder** (default): `ComfyUI/models/llm/GGUF/` (configurable via `gguf_models.json`)
- **Vision requirement**: install a vision-capable `llama-cpp-python` wheel that provides `Qwen3VLChatHandler` / `Qwen25VLChatHandler`
See [docs/LLAMA_CPP_PYTHON_VISION_INSTALL.md](docs/LLAMA_CPP_PYTHON_VISION_INSTALL.md)
## **🗂️ Config Files**
- **HF models**: `hf_models.json`
- `hf_vl_models`: vision-language models (used by QwenVL nodes).
- `hf_text_models`: text-only models (used by Prompt Enhancer).
- **GGUF models**: `gguf_models.json`
- **System prompts**: `AILab_System_Prompts.json` (includes both VL prompts and prompt-enhancer styles).
## **📥 Download Models**
The models will be automatically downloaded on first use. If you prefer to download them manually, place them in the ComfyUI/models/LLM/Qwen-VL/ directory.
### **HF Vision Models (Qwen-VL)**
| Model | Link |
| :---- | :---- |
| Qwen3-VL-2B-Instruct | [Download](https://huggingface.co/Qwen/Qwen3-VL-2B-Instruct) |
| Qwen3-VL-2B-Thinking | [Download](https://huggingface.co/Qwen/Qwen3-VL-2B-Thinking) |
| Qwen3-VL-2B-Instruct-FP8 | [Download](https://huggingface.co/Qwen/Qwen3-VL-2B-Instruct-FP8) |
| Qwen3-VL-2B-Thinking-FP8 | [Download](https://huggingface.co/Qwen/Qwen3-VL-2B-Thinking-FP8) |
| Qwen3-VL-4B-Instruct | [Download](https://huggingface.co/Qwen/Qwen3-VL-4B-Instruct) |
| Qwen3-VL-4B-Thinking | [Download](https://huggingface.co/Qwen/Qwen3-VL-4B-Thinking) |
| Qwen3-VL-4B-Instruct-FP8 | [Download](https://huggingface.co/Qwen/Qwen3-VL-4B-Instruct-FP8) |
| Qwen3-VL-4B-Thinking-FP8 | [Download](https://huggingface.co/Qwen/Qwen3-VL-4B-Thinking-FP8) |
| Qwen3-VL-8B-Instruct | [Download](https://huggingface.co/Qwen/Qwen3-VL-8B-Instruct) |
| Qwen3-VL-8B-Thinking | [Download](https://huggingface.co/Qwen/Qwen3-VL-8B-Thinking) |
| Qwen3-VL-8B-Instruct-FP8 | [Download](https://huggingface.co/Qwen/Qwen3-VL-8B-Instruct-FP8) |
| Qwen3-VL-8B-Thinking-FP8 | [Download](https://huggingface.co/Qwen/Qwen3-VL-8B-Thinking-FP8) |
| Qwen3-VL-32B-Instruct | [Download](https://huggingface.co/Qwen/Qwen3-VL-32B-Instruct) |
| Qwen3-VL-32B-Thinking | [Download](https://huggingface.co/Qwen/Qwen3-VL-32B-Thinking) |
| Qwen3-VL-32B-Instruct-FP8 | [Download](https://huggingface.co/Qwen/Qwen3-VL-32B-Instruct-FP8) |
| Qwen3-VL-32B-Thinking-FP8 | [Download](https://huggingface.co/Qwen/Qwen3-VL-32B-Thinking-FP8) |
| Qwen2.5-VL-3B-Instruct | [Download](https://huggingface.co/Qwen/Qwen2.5-VL-3B-Instruct) |
| Qwen2.5-VL-7B-Instruct | [Download](https://huggingface.co/Qwen/Qwen2.5-VL-7B-Instruct) |
### **HF Text Models (Qwen3)**
| Model | Link |
| :---- | :---- |
| Qwen3-0.6B | [Download](https://huggingface.co/Qwen/Qwen3-0.6B) |
| Qwen3-4B-Instruct-2507 | [Download](https://huggingface.co/Qwen/Qwen3-4B-Instruct-2507) |
| qwen3-4b-Z-Image-Engineer | [Download](https://huggingface.co/BennyDaBall/qwen3-4b-Z-Image-Engineer) |
### **GGUF Models (Manual Download)**
| Group | Model | Repo | Alt Repo | Model Files | MMProj |
| :-- | :-- | :-- | :-- | :-- | :-- |
| Qwen text (GGUF) | Qwen3-4B-GGUF | [Qwen/Qwen3-4B-GGUF](https://huggingface.co/Qwen/Qwen3-4B-GGUF) | | Qwen3-4B-Q4_K_M.gguf, Qwen3-4B-Q5_0.gguf, Qwen3-4B-Q5_K_M.gguf, Qwen3-4B-Q6_K.gguf, Qwen3-4B-Q8_0.gguf | |
| Qwen-VL (GGUF) | Qwen3-VL-4B-Instruct-GGUF | [Qwen/Qwen3-VL-4B-Instruct-GGUF](https://huggingface.co/Qwen/Qwen3-VL-4B-Instruct-GGUF) | | Qwen3VL-4B-Instruct-F16.gguf, Qwen3VL-4B-Instruct-Q4_K_M.gguf, Qwen3VL-4B-Instruct-Q8_0.gguf | mmproj-Qwen3VL-4B-Instruct-F16.gguf |
| Qwen-VL (GGUF) | Qwen3-VL-8B-Instruct-GGUF | [Qwen/Qwen3-VL-8B-Instruct-GGUF](https://huggingface.co/Qwen/Qwen3-VL-8B-Instruct-GGUF) | | Qwen3VL-8B-Instruct-F16.gguf, Qwen3VL-8B-Instruct-Q4_K_M.gguf, Qwen3VL-8B-Instruct-Q8_0.gguf | mmproj-Qwen3VL-8B-Instruct-F16.gguf |
| Qwen-VL (GGUF) | Qwen3-VL-4B-Thinking-GGUF | [Qwen/Qwen3-VL-4B-Thinking-GGUF](https://huggingface.co/Qwen/Qwen3-VL-4B-Thinking-GGUF) | | Qwen3VL-4B-Thinking-F16.gguf, Qwen3VL-4B-Thinking-Q4_K_M.gguf, Qwen3VL-4B-Thinking-Q8_0.gguf | mmproj-Qwen3VL-4B-Thinking-F16.gguf |
| Qwen-VL (GGUF) | Qwen3-VL-8B-Thinking-GGUF | [Qwen/Qwen3-VL-8B-Thinking-GGUF](https://huggingface.co/Qwen/Qwen3-VL-8B-Thinking-GGUF) | | Qwen3VL-8B-Thinking-F16.gguf, Qwen3VL-8B-Thinking-Q4_K_M.gguf, Qwen3VL-8B-Thinking-Q8_0.gguf | mmproj-Qwen3VL-8B-Thinking-F16.gguf |
## **📖 Usage**
### **Basic Usage**
1. Add the **"QwenVL"** node from the 🧪AILab/QwenVL category.
2. Select the **model\_name** you wish to use.
3. Connect an image or video (image sequence) source to the node.
4. Write your prompt using the preset or custom field.
5. Run the workflow.
### **Advanced Usage**
For more control, use the **"QwenVL (Advanced)"** node. This gives you access to detailed generation parameters like temperature, top\_p, beam search, and device selection.
## **⚙️ Parameters**
| Parameter | Description | Default | Range | Node(s) |
| :---- | :---- | :---- | :---- | :---- |
| **model\_name** | The Qwen-VL model to use. | Qwen3-VL-4B-Instruct | \- | Standard & Advanced |
| **quantization** | On-the-fly quantization. Ignored for pre-quantized models (e.g., FP8). | 8-bit (Balanced) | 4-bit, 8-bit, None | Standard & Advanced |
| **preset\_prompt** | A selection of pre-defined prompts for common tasks. | "Describe this..." | Any text | Standard & Advanced |
| **custom\_prompt** | Overrides the preset prompt if provided. | | Any text | Standard & Advanced |
| **max\_tokens** | Maximum number of new tokens to generate. | 1024 | 64-2048 | Standard & Advanced |
| **keep\_model\_loaded** | Keep the model in VRAM for faster subsequent runs. | True | True/False | Standard & Advanced |
| **seed** | A seed for reproducible results. | 1 | 1 \- 2^64-1 | Standard & Advanced |
| **temperature** | Controls randomness. Higher values \= more creative. (Used when num\_beams is 1). | 0.6 | 0.1-1.0 | Advanced Only |
| **top\_p** | Nucleus sampling threshold. (Used when num\_beams is 1). | 0.9 | 0.0-1.0 | Advanced Only |
| **num\_beams** | Number of beams for beam search. \> 1 disables temperature/top\_p sampling. | 1 | 1-10 | Advanced Only |
| **repetition\_penalty** | Discourages repeating tokens. | 1.2 | 0.0-2.0 | Advanced Only |
| **frame\_count** | Number of frames to sample from the video input. | 16 | 1-64 | Advanced Only |
| **device** | Override automatic device selection. | auto | auto, cuda, cpu | Advanced Only |
| **attention_mode** | Attention backend for performance optimization. | auto | auto, flash_attention_2, sdpa | Standard & Advanced |
### **💡 Quantization Options**
| Mode | Precision | Memory Usage | Speed | Quality | Recommended For |
| :---- | :---- | :---- | :---- | :---- | :---- |
| None (FP16) | 16-bit Float | High | Fastest | Best | High VRAM GPUs (16GB+) |
| 8-bit (Balanced) | 8-bit Integer | Medium | Fast | Very Good | Balanced performance (8GB+) |
| 4-bit (VRAM-friendly) | 4-bit Integer | Low | Slower\* | Good | Low VRAM GPUs (\<8GB) |
\* **Note on 4-bit Speed**: 4-bit quantization significantly reduces VRAM usage but may result in slower performance on some systems due to the computational overhead of real-time dequantization.
### **⚡ Attention Mode Options**
| Mode | Description | Speed | Memory | Requirements |
| :---- | :---- | :---- | :---- | :---- |
| **auto** | Automatically selects Flash Attention 2 if available, falls back to SDPA | Fast | Medium | flash-attn package |
| **flash_attention_2** | Uses Flash Attention v2 for optimal performance | Fastest | Low | flash-attn + CUDA GPU |
| **sdpa** | PyTorch native Scaled Dot Product Attention | Medium | Medium | PyTorch 2.0+ |
**Flash Attention 2 Requirements:**
- NVIDIA GPU with capability >= 8.6 (RTX 20/30/40/50 series)
- CUDA >= 12.0
- PyTorch >= 2.3.0
- flash-attn package installed
### **🤔 Setting Tips**
| Setting | Recommendation |
| :---- | :---- |
| **Model Choice** | For most users, Qwen3-VL-4B-Instruct is a great starting point. If you have a 40-series GPU, try the \-FP8 version for better performance. |
| **Memory Mode** | Keep keep\_model\_loaded enabled (True) for the best performance if you plan to run the node multiple times. Disable it only if you are running out of VRAM for other nodes. |
| **Quantization** | Start with the default 8-bit. If you have plenty of VRAM (\>16GB), switch to None (FP16) for the best speed and quality. If you are low on VRAM, use 4-bit. |
| **Performance** | The first time a model is loaded with a specific quantization, it may be slow. Subsequent runs (with keep\_model\_loaded enabled) will be much faster. |
| **Attention Mode** | Use "flash_attention_2" for 2-3x speedup if you have compatible GPU. Otherwise use "auto" for automatic selection. |
## **🧠 About Model**
This node utilizes the Qwen-VL series of models, developed by the Qwen Team at Alibaba Cloud. These are powerful, open-source large vision-language models (LVLMs) designed to understand and process both visual and textual information, making them ideal for tasks like detailed image and video description.
## **⚡ Flash Attention 2 Performance Boost**
This integration includes support for **Flash Attention 2**, a cutting-edge attention implementation that provides significant performance improvements:
### **🚀 Performance Gains**
| Model | Flash Attention 2 | Speedup |
|-------|----------------|---------|
| Qwen2.5-VL-3B | 100% | 200-300% | 2-3x |
| Qwen3-VL-4B | 100% | 150-250% | 1.5-2.5x |
### **🎯 How to Use**
1. **Install Flash Attention 2** (see [Installation](#-optional-flash-attention-2-installation))
2. **Select "flash_attention_2"** in the `attention_mode` parameter
3. **Run your workflow** - the system automatically applies the optimization
### **🔧 Technical Details**
- **Implementation**: Uses optimized attention kernels for better memory efficiency
- **Compatibility**: Works with all quantization modes (4-bit, 8-bit, FP16)
- **Integration**: Seamlessly integrates with existing workflows
- **Fallback**: Automatically falls back to SDPA if Flash Attention 2 is not available
### **📋 Requirements Checklist**
- [ ] flash-attn package installed
- [ ] Sufficient VRAM for your chosen model
- [ ] Compatible GPU (RTX 20 series or newer)
### **🐛 Troubleshooting**
**Flash Attention 2 not working?**
```bash
# Check installation
python -c "import flash_attn; print('Flash Attention 2 available')"
# Check GPU capability
python -c "import torch; print(f'GPU capability: {torch.cuda.get_device_capability()}')"
```
**Common Problems:**
- **"Flash Attention 2 not available"**: Install the package and check GPU compatibility
- **"CUDA not available"**: Ensure you have installed PyTorch compatible CUDA
- **"GPU capability insufficient"**: Flash Attention 2 requires RTX 20 series or newer
### **📚 References**
- [Flash Attention 2 GitHub](https://github.com/Dao-AILab/flash-attention)
- [Flash Attention 2 Paper](https://arxiv.org/abs/2308.06711)
- [Performance Benchmarks](https://github.com/Dao-AILab/flash-attention#performance)
## **🎬 WAN 2.2 Integration**
This enhanced version includes specialized prompts for **WAN 2.2** video generation, supporting both I2V (image-to-video) and T2V (text-to-video) workflows.
### **🎯 Available WAN 2.2 Prompts**
| Prompt Type | Use Case | Input | Output | Location |
|:---|:---|:---|:---|:---|
| **🍿 Wan 2.2 I2V** | Image-to-Video | Image + Text | 5-second cinematic timeline | QwenVL nodes |
| **🍿 Wan 2.2 T2V** | Text-to-Video | Text only | 5-second cinematic timeline | Prompt Enhancer nodes |
### **⚡ Features**
- **Cinematic Timeline Structure**: 5-second videos with second-by-second descriptions
- **Multilingual Support**: Italian/English input → English optimized output
- **Professional Scene Description**: Film-style direction including lighting, camera, composition
- **NSFW Handling**: Appropriate content filtering and description
- **WAN 2.2 Optimization**: Specifically formatted for best video generation results
### **📝 Output Format Example**
```
(At 0 seconds: A young woman stands facing a rack of clothes...)
(At 1 second: The blouse falls to the floor around her feet...)
(At 2 seconds: She reaches out with her right hand...)
(At 3 seconds: She turns her body slightly towards the mirror...)
(At 4 seconds: Lifting the hanger, she holds the dark fabric...)
(At 5 seconds: A subtle, thoughtful expression crosses her face...)
```
### **🔧 Usage**
1. **For I2V**: Use "🍿 Wan 2.2 I2V" preset in QwenVL nodes with image input
2. **For T2V**: Use "🍿 Wan 2.2 T2V" style in Prompt Enhancer nodes with text only
3. **For Storyboard**: Use "🍿 Wan Extended Storyboard" for seamless scene continuity
4. **For General Video**: Use "🎥 Wan Cinematic Video" for professional single-scene descriptions
### **🎨 Best Practices**
- Provide clear, descriptive input for better scene interpretation
- Use specific camera and lighting directions when possible
- Include mood and atmosphere details for cinematic results
- Leverage professional cinematography specs for optimal video quality
- The system automatically handles timeline optimization for WAN 2.2 presets
## **🗺️ Roadmap**
### **✅ Completed (v2.0.7)**
* ✅ Support for Qwen3-VL and Qwen2.5-VL models.
* ✅ GGUF backend support for faster inference.
* ✅ Prompt Enhancer nodes for text-only workflows.
* ✅ Flash Attention 2 integration for 2-3x performance boost.
* ✅ WAN 2.2 I2V and T2V video generation prompts.
* ✅ Extended Storyboard preset for scene continuity.
* ✅ Professional cinematography specifications for all WAN 2.2 presets.
* ✅ WAN family branding and consistent naming.
* ✅ Extended Storyboard preset for seamless continuity generation.
* ✅ Free abliterated models without token requirements.
* ✅ Enhanced custom prompt logic across all nodes.
* ✅ Comprehensive NSFW content generation support.
* ✅ Optimized model ordering and quantization defaults.
* ✅ Clean attention pipeline with SDPA stability.
* ✅ Removed complexity for better model output reliability.
* ✅ Smart prompt caching system for performance optimization.
* ✅ Fixed Seed Mode for stable outputs regardless of media variations.
* ✅ Persistent cache across ComfyUI restarts.
* ✅ Code maintenance updates for future compatibility.
## **🙏 Credits**
* **Qwen Team**: [Alibaba Cloud](https://github.com/QwenLM) - For development and open-source powerful Qwen-VL models.
* **ComfyUI**: [comfyanonymous](https://github.com/comfyanonymous/ComfyUI) - For incredible and extensible ComfyUI platform.
* **llama-cpp-python**: [JamePeng/llama-cpp-python](https://github.com/JamePeng/llama-cpp-python) - GGUF backend with vision support used by GGUF nodes.
* **GenorTG**: [GenorTG/ComfyUI-Genor-QwenVL-Mod](https://github.com/GenorTG/ComfyUI-Genor-QwenVL-Mod) - For innovative memory management improvements including `unload_after_run` parameter and prompt cache optimizations that prevent OOM errors in multi-node workflows.
* **ComfyUI Integration**: [1038lab](https://github.com/1038lab) - Developer of this custom node.
## **👥 Author**
- **huchukato**
- 🐙 [GitHub](https://github.com/huchukato)
- 🐦 [X (Twitter)](https://twitter.com/huchukato)
- 🎨 [Civitai](https://civitai.com/user/huchukato) - Check out my AI art models!
## **📜 License**
This repository code is released under [GPL-3.0 License](LICENSE).123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565# **QwenVL-Mod per ComfyUI**
[](https://github.com/comfyanonymous/ComfyUI)
[](LICENSE)
[](https://github.com/huchukato/ComfyUI-QwenVL-Mod/releases)
[](https://python.org)
[](https://pytorch.org)
[](https://developer.nvidia.com/cuda-zone)
[](https://huggingface.co/Qwen)
[](https://github.com/huchukato/ComfyUI-QwenVL-Mod)
[](https://github.com/huchukato/ComfyUI-QwenVL-Mod)
[](https://github.com/huchukato/ComfyUI-QwenVL-Mod/issues)
[](https://lightning.ai/huchukato/environments/comfyui-v0-14-2-qwen3-vl-autoprompt)
Il custom node ComfyUI-QwenVL integra la potente serie di modelli vision-linguaggio (LVLM) Qwen-VL di Alibaba Cloud, inclusi i più recenti Qwen3-VL e Qwen2.5-VL, oltre a backend GGUF e supporto solo testo Qwen3. Questo nodo avanzato abilita funzionalità multimodali AI senza soluzione di continuità nei tuoi workflow ComfyUI, permettendo efficiente generazione di testo, comprensione di immagini e analisi video.
<img width="749" height="513" alt="Qwen3-VL-Mod" src="https://github.com/user-attachments/assets/0f10b887-1953-4923-b813-37ccacb8a9aa" />
## 🛠️ **Fix OOM per QwenVL (v2.2.3)**
### Problema risolto
Gli utenti riscontravano errori **Out of Memory (OOM)** con il nodo QwenVL, anche avendo VRAM sufficiente (31GB totale, 22GB libera). Il modello Qwen3-VL richiede solo ~741MB ma PyTorch limitava l'allocazione a ~17GB a causa di un'impostazione errata del memory fraction.
### 🔧 Soluzioni implementate
1. **Ottimizzazioni memoria**: `max_tokens` ridotto da 4096→2048, garbage collection aggressiva
2. **Gestione OOM**: Rilevamento automatico con retry e fallback CPU
3. **Debug avanzato**: Tracking dettagliato memoria GPU (allocated, reserved, free)
4. **Controllo utente**: Funzioni per verificare e impostare il memory fraction PyTorch
### 🎯 Risultati
- **Meno OOM**: Errori drasticamente ridotti
- **Maggiore stabilità**: Gestione memoria più efficiente
- **Debugging completo**: Possibilità di diagnosticare problemi PyTorch
### 💡 Utilizzo delle nuove funzioni
```python
# Verifica impostazioni PyTorch
from AILab_QwenVL import check_pytorch_memory
check_pytorch_memory()
# Imposta memory fraction personalizzata
from AILab_QwenVL import set_pytorch_memory_fraction
set_pytorch_memory_fraction(0.8) # 80% della GPU
```
## 🧠 VRAM Cleanup Node
Il nodo **VRAM Cleanup** gestisce la memoria VRAM nei workflow ComfyUI, progettato per prevenire crash e ottimizzare le prestazioni su sistemi con VRAM limitata.
### Modalità
- **Cache Only**: Pulizia leggera della cache CUDA
- **Text Encoder**: Cleanup mirato per i text encoder
- **Full Cleanup**: Scaricamento completo dei modelli e pulizia cache aggressiva
- **T2V + QwenVL Fix**: Modalità speciale per conflitti tra modelli
- **Prevenzione OOM**: Cleanup completo quando la VRAM è quasi piena
- **Debug**: Modalità diagnostica per problemi di memoria
### Compatibilità
- ✅ **CUDA 12.8 (RunPod)**: Compatibilità nativa
- ✅ **CUDA 13 (VastAI)**: Ottimizzato con memory pressure multipla
- ✅ **Tutti i nodi QwenVL**: Cleanup automatico nel blocco `finally`
- `model_management.unload_all_models()` per scaricamento forzato
- `torch.cuda.empty_cache()` per pulizia cache CUDA
- `gc.collect()` per garbage collection Python
- Memory pressure con tensori temporanei per forzare release VRAM
- Sincronizzazione CUDA per operazioni sicure
### 📋 **Posizione nel Workflow**
```
T2V → VRAM Cleanup (Full Cleanup) → I2V-1 → VRAM Cleanup (Full Cleanup) → I2V-2 → VRAM Cleanup (Full Cleanup) → I2V-3
```
---
## **📰 Notizie & Aggiornamenti**
* **2026/02/27**: **v2.2.3** 🔧 **Fix Compatibilità CUDA 13 + Rimozione Ridondanze**. [[Aggiornamenti](update.md#version-223-20260227)]
> 🔧 **Rimozione unload_after_run**: Eliminata checkbox ridondante da tutti i nodi QwenVL per prevenire conflitti su CUDA 13.
> 🐛 **Fix Errori Parametri**: Risolti errori "missing 1 required positional argument: unload_after_run" in tutti i nodi.
> 🎯 **Interfaccia Semplificata**: Interfaccia più pulita senza parametri ridondanti.
> 🧠 **VRAM Cleanup Node**: Mantenuto per cleanup manuale quando necessario.
> 🏆 **Crediti Community**: Ringraziamenti per feedback che ha identificato problemi di ridondanza e parametri.
* **2026/02/19**: **v2.2.2** 🚀 Fix Critici T2V/I2V + Ottimizzazioni ComfyUI. [[Aggiornamenti](https://github.com/huchukato/ComfyUI-QwenVL-Mod/blob/main/update.md#version-222-20260219)]
> 🚀 **Batch Processing**: Risolto problema critico T2V → GGUF con immagini batch da generazione video.
> 🔄 **Stesso Modello**: Fix conflitto riutilizzo stesso modello tra T2V e I2V nodes.
> ⚙️ **Flash Attention 2**: Aggiunto supporto Flash Attention 2 per boost performance su hardware compatibile.
> ⚙️ **Args ComfyUI**: Ottimizzati argomenti di avvio con features sperimentali validate.
> 🔧 **keep_model_loaded**: Aggiunto parametro mancante al PromptEnhancer per gestione memoria consistente.
> 🐳 **Docker Finale**: Build ottimizzato con tutti i fix e performance massima.
* **2026/02/18**: **v2.2.1** 🔧 Fix Critico VRAM per GGUF + Docker Ottimizzato. [[Aggiornamenti](https://github.com/huchukato/ComfyUI-QwenVL-Mod/blob/main/update.md#version-221-20260218)]
> 🔧 **Fix VRAM GGUF**: Risolto problema critico di leak VRAM che causava crash dopo 2 esecuzioni.
> 🧹 **Cleanup Aggressivo**: Implementata pulizia VRAM completa per tutti i nodi GGUF (AILab_QwenVL_GGUF e PromptEnhancer).
> 🚀 **Performance Stabile**: I nodi GGUF ora funzionano in modo affidabile senza accumulare VRAM.
> 🐳 **Docker Migliorato**: Aggiornati Dockerfile con metodi RunPod testati per Jupyter e FileBrowser.
> 🔄 **ComfyUI Latest**: Sempre ultima versione stabile senza aggiornamenti manuali.
> 📡 **SSH Completo**: Server + client SSH per piena funzionalità di rete.
> 🎯 **Terminale Jupyter**: Adoptato metodo RunPod per terminale funzionante.
* **2026/02/15**: **v2.2.0** 🎬 Sistema Generazione Story WAN 2.2. [[Aggiornamenti](https://github.com/huchukato/ComfyUI-QwenVL-Mod/blob/main/update.md#version-220-20260215)]
> 🎬 **Story Generation**: Sistema completo per generazione video story a 4 segmenti con WAN 2.2
> 🔄 **Auto-Split Node**: Nodo intelligente per suddivisione automatica prompt in video continui da 20 secondi
> 📝 **Show Text Node**: Nodo display testo integrato senza dipendenze esterne
> 🎯 **Prompt Migliorati**: Prompt WAN 2.2 NSFW Story ottimizzati con formattazione migliorata
> ⚡ **Performance**: Impostazioni context ottimizzate per modelli 8B (65,536 token)
> 🐳 **Docker Ready**: Sistema Story completo integrato in container Docker
> 🎨 **Workflow**: Workflow WAN 2.2 Story pronto all'uso incluso
* **2026/02/14**: **v2.1.0** Funzione Keep Last Prompt User-Friendly + Supporto NSFW Migliorato + Modelli GGUF Aggiornati. [[Aggiornamenti](https://github.com/huchukato/ComfyUI-QwenVL-Mod/blob/main/update.md#version-210-20260214)]
> [!NOTE]
> 🔄 **Keep Last Prompt**: Nuovo parametro user-friendly `keep_last_prompt` sostituisce bypass_mode.
> 🎛️ **Controllo Semplice**: Checkbox intuitivo per mantenere i prompt generati in precedenza.
> 🎯 **Workflow Ottimizzato**: Genera prompt una volta, poi mantieni i risultati cambiando input.
> ⚡ **Zero Risorse**: Modalità cache non consuma risorse - risposta istantanea.
> 📋 **Universale**: Disponibile in tutti i nodi (HF, GGUF, PromptEnhancer, varianti Advanced).
> 🔥 **Supporto NSFW Forte**: Istruzioni esplicite per generazione contenuti non censurati.
> 🔦 **Luci Accurate**: Corretta invenzione di luci non presenti nell'immagine originale.
> 🔄 **Modelli GGUF Aggiornati**: Sostituiti modelli noctrex con mradermacher v2/v3 per migliori performance.
> 📦 **Selezione Modelli**: Aggiunto Josiefied-Qwen3-VL-4B-Instruct-abliterated-beta-v1 (solo HF).
* **2026/02/12**: **v2.0.9** Parametro Bypass Mode per persistenza prompt. [[Aggiornamenti](https://github.com/huchukato/ComfyUI-QwenVL-Mod/blob/main/update.md#version-209-20260212)]
> [!NOTE]
> 🎛️ **Bypass Mode**: Nuovo parametro `bypass_mode` permette di mantenere i prompt generati in precedenza senza rigenerarli.
> 🔄 **Smart Cache**: Quando bypass mode è abilitato, i nodi recuperano il prompt cached più recente per il modello corrente.
> 🎯 **Workflow Perfetto**: Genera prompt una volta, poi abilita bypass mode per preservarli cambiando gli input.
> ⚡ **Zero Risorse**: Bypass mode non consuma risorse computazionali - risposta istantanea.
> 📋 **Feature Universale**: Disponibile in tutti i nodi (HF, GGUF, PromptEnhancer, varianti Advanced).
> 🎮 **Controllo Semplice**: Basta attivare/disattivare il checkbox bypass_mode per abilitare/disabilitare persistenza prompt.
* **2026/02/06**: **v2.0.8** Correzioni bug e miglioramenti stabilità. [[Aggiornamenti](https://github.com/huchukato/ComfyUI-QwenVL-Mod/blob/main/update.md#version-208-20260206)]
> [!NOTE]
> 🐛 **Correzioni Bug**: Risolto errore sintassi JSON nei prompt di sistema e problemi variabili non definite.
> 🌐 **Supporto Multilingua**: Supporto multilingua completo aggiunto a tutti i preset WAN 2.2.
> 🎨 **Rilevamento Stile**: Migliorato rilevamento stile visivo per anime, 3D, pixel art e altro.
> 🔧 **Stabilità**: Ripristinati miglioramenti seed fissi problematici per mantenere operazione stabile.
> 📝 **Documentazione**: Aggiornato README e changelog con i miglioramenti di oggi.
* **2026/02/04**: **v2.0.7** Sistema intelligente cache prompt con Modalità Seed Fisso. [[Aggiornamenti](https://github.com/huchukato/ComfyUI-QwenVL-Mod/blob/main/update.md#version-207-20260204)]
> [!NOTE]
> 🧠 **Cache Intelligente**: Cache automatica prompt previene rigenerazione di prompt identici.
> 🔒 **Modalità Seed Fisso**: Imposta qualsiasi valore seed fisso per mantenere prompt consistenti indipendentemente dalle variazioni multimediali.
> ⚡ **Boost Performance**: Risposta istantanea per prompt in cache con tempo zero di caricamento modello.
> 🔧 **Manutenzione Codice**: Rimossi parametri deprecati da tutte le funzioni download per compatibilità futura.
> 📈 **Miglioramento GGUF**: Aumentata dimensione contesto predefinita da 8192 a 32768 per migliore utilizzo modello.
> 🔄 **Cache Universale**: Modalità Seed Fisso e cache intelligente ora disponibili su tutti i nodi (HF, GGUF, PromptEnhancer).
> 🎯 **Logica Semplificata**: Sistema cache semplificato che include sempre seed per comportamento prevedibile su tutti i valori seed.
* **2026/02/03**: **v2.0.6** Miglioramento cinematografia professionale per tutti i preset WAN 2.2. [[Aggiornamenti](https://github.com/huchukato/ComfyUI-QwenVL-Mod/blob/main/update.md#version-206-20260203)]
> [!NOTE]
> 🎬 **Specifiche Professionali**: Tutti i preset WAN 2.2 ora includono specifiche cinematografiche complete.
> 📹 **Dettagli Tecnici**: Sorgenti luminose, tipi ripresa, specifiche lenti, movimenti camera, requisiti tonalità colore.
> 🎯 **Branding Coerente**: Aggiornati nomi preset con branding famiglia WAN per migliore organizzazione.
* **2026/02/01**: **v2.0.5** Preset storyboard esteso aggiunto per continuità formato WAN 2.2. [[Aggiornamenti](https://github.com/huchukato/ComfyUI-QwenVL-Mod/blob/main/update.md#version-205-20260201)]
> [!NOTE]
> 🎬 **Storyboard Esteso**: Nuovo preset per generazione storyboard-to-storyboard senza soluzione di continuità con formato timeline.
> 🔄 **Focus Continuità**: Ogni paragrafo ripete contenuto precedente per transizioni fluide.
> 🎯 **Compatibile WAN 2.2**: Stessa struttura timeline e supporto NSFW del preset I2V.
* **2026/03/06**: **v2.2.4** 🔧 **Fix OOM Critico + Rimozione Quantizzazione**. [[Aggiornamenti](update.md#version-224-20260306)]
> 🚨 **BitsAndBytes Disabilitato**: Rimosso quantizzazione problematica che causava OOM su RTX 5090.
> ✅ **Solo FP16**: Tutti i nodi HF ora usano FP16 stabile (~6GB VRAM).
> 🎯 **Interfaccia Pulita**: Rimosso dropdown quantizzazione - usa nodi GGUF per modelli quantizzati.
> 🔧 **Entrambi i Nodi Fixati**: Applicati fix a nodi Standard e Advanced con parametri consistenti.
> 💡 **Guida Utente**: Nodi HF per qualità, nodi GGUF per quantizzazione - separazione chiara.
* **2026/02/27**: **v2.2.3** 🔧 **Compatibilità CUDA 13 + Rimozione Ridondanze**. [[Aggiornamenti](update.md#version-223-20260227)]
> 🔧 **Rimosso unload_after_run**: Eliminato checkbox ridondante da tutti i nodi QwenVL per prevenire conflitti CUDA 13.
> 🐛 **Fix Errori Parametri**: Risolti errori "missing 1 required positional argument: unload_after_run" in tutti i nodi.
> 🎯 **Interfaccia Semplificata**: Interfaccia nodo più pulita senza parametri ridondanti.
> 🧠 **Nodo Cleanup VRAM**: Mantenuto per cleanup manuale quando necessario.
* **2026/02/01**: **v2.0.4** Aggiornamento stabilità - rimosso SageAttention per migliore compatibilità e affidabilità output modello. [[Aggiornamenti](https://github.com/huchukato/ComfyUI-QwenVL-Mod/blob/main/update.md#version-204-20260201)]
> [!NOTE]
> 🔧 **Flash Attention 2 Rimosso**: Eliminata complessità e problemi interferenza per performance modello stabili.
> ⚡ **Flash Attention 2**: Ancora disponibile per 2-3x velocità su hardware compatibile.
> 🛡️ **Stabilità Migliorata**: Pipeline attention pulita con SDPA come fallback affidabile.
* **2026/02/01**: **v2.0.3** Correzione compatibilità SageAttention per patching corretto su versioni transformer. [[Aggiornamenti](https://github.com/huchukato/ComfyUI-QwenVL-Mod/blob/main/update.md#version-203-20260201)]
> [!NOTE]
> 🔧 **Correzione Critica**: Risolto AttributeError che impediva Flash Attention 2 di funzionare con certe versioni transformer.
> ⚡ **Performance Ripristinata**: 2-5x velocità ora funziona correttamente con quantizzazione 8-bit su hardware compatibile.
* **2026/02/01**: **v2.0.2** Accessibilità modelli migliorata, logica prompt personalizzata migliorata, espanso generazione contenuti NSFW. [[Aggiornamenti](https://github.com/huchukato/ComfyUI-QwenVL-Mod/blob/main/update.md#version-202-20260201)]
> [!NOTE]
> 🚀 **Modelli Abliterated Free**: Aggiunti modelli senza token non censurati come predefiniti per migliore accessibilità.
> 🔧 **Correzione Prompt Personalizzato**: Ora combina con template preset invece di sostituirli su tutti i nodi.
> 📝 **NSFW Migliorato**: Descrizioni complete per contenuti adulti con specifiche dettagliate atti.
> 🎬 **Priorità WAN 2.2**: Spostato preset generazione video in posizione superiore per accesso workflow più rapido.
* **2026/01/30**: **v2.0.1-enhanced** Aggiunto supporto Flash Attention 2 e integrazione WAN 2.2. [[Aggiornamenti](https://github.com/huchukato/ComfyUI-QwenVL-Mod/blob/main/update.md#version-201-enhanced-20260130)]
> [!NOTE]
> 🚀 **Flash Attention 2**: 2-5x boost performance con attention quantizzato 8-bit per GPU RTX 30+.
> 🎬 **Integrazione WAN 2.2**: Nuovi prompt specializzati per generazione video cinematografica - converti immagini/video in descrizioni timeline 5-secondi (I2V) o testo a video (T2V) con direzione scena professionale.
* **2025/12/22**: **v2.0.0** Aggiunti nodi supportati GGUF e nodi Prompt Enhancer. [[Aggiornamenti](https://github.com/1038lab/ComfyUI-QwenVL/blob/main/update.md#version-200-20251222)]
> [!IMPORTANT]
> Installa llama-cpp-python prima di eseguire nodi GGUF [istruzioni](docs/LLAMA_CPP_PYTHON_VISION_INSTALL.md)

* **2025/11/10**: **v1.1.0** Revisione runtime con selettore modalità attention, rilevamento automatico flash-attn, cache più intelligente, e controlli quantizzazione/torch.compile in entrambi i nodi. [[Aggiornamenti](https://github.com/1038lab/ComfyUI-QwenVL/blob/main/update.md#version-110-20251110)]
* **2025/10/31**: **v1.0.4** Modelli Personalizzati Supportati [[Aggiornamenti](https://github.com/1038lab/ComfyUI-QwenVL/blob/main/update.md#version-104-20251031)]
* **2025/10/22**: **v1.0.3** Elenco modelli aggiornato [[Aggiornamenti](https://github.com/1038lab/ComfyUI-QwenVL/blob/main/update.md#version-103-20251022)]
* **2025/10/17**: **v1.0.0** Rilascio Iniziale
* Supporto per serie modelli Qwen3-VL e Qwen2.5-VL.
* Download automatico modelli da Hugging Face.
* Quantizzazione al volo (4-bit, 8-bit, FP16).
* Sistema Preset e Prompt Personalizzati per uso flessibile e facile.
* **Include sia nodo standard che avanzato** per utenti di tutti i livelli.
* Salvaguardie hardware-aware per compatibilità modelli FP8.
* Supporto input immagine e video (sequenza frame).
* Opzione "Keep Model Loaded" per performance migliorate su esecuzioni sequenziali.
* **Parametro Seed** per generazione riproducibile.
[](https://github.com/1038lab/ComfyUI-QwenVL/blob/main/example_workflows/QWenVL.json)
## **✨ Funzionalità**
[](https://github.com/huchukato/ComfyUI-QwenVL-Mod)
[](https://huggingface.co/Qwen)
[](https://github.com/huchukato/ComfyUI-QwenVL-Mod)
[](https://github.com/huchukato/ComfyUI-QwenVL-Mod)
[](https://github.com/huchukato/ComfyUI-QwenVL-Mod)
[](https://github.com/huchukato/ComfyUI-QwenVL-Mod)
[](https://github.com/huchukato/ComfyUI-QwenVL-Mod)
* **Nodi Standard & Avanzati**: Include nodo QwenVL semplice per uso rapido e nodo QwenVL (Avanzato) con controllo fine-grained sulla generazione.
* **Enhancer Prompt**: Enhancer prompt solo testo dedicati per backend HF e GGUF.
* **Preset & Prompt Personalizzati**: Scegli da elenco comodo preset prompt o scrivi i tuoi per controllo completo. I prompt personalizzati ora combinano con template preset per flessibilità migliorata.
* **Cache Intelligente Prompt**: Sistema cache automatico previene rigenerazione di prompt identici, migliorando dramaticamente performance per input ripetuti. La cache persiste riavvii ComfyUI.
* **🎛️ Bypass Mode**: Nuovo parametro `bypass_mode` permette di mantenere i prompt generati in precedenza senza rigenerarli. Genera una volta, poi abilita bypass mode per preservare i prompt cambiando gli input. Zero risorse in modalità bypass.
* **Modalità Seed Fisso**: Imposta seed = 1 per ignorare cambiamenti immagine/video e mantenere prompt consistenti indipendentemente dalle variazioni multimediali. Perfetto per output workflow stabili.
* **Integrazione WAN 2.2**: Prompt specializzati per generazione WAN 2.2 I2V (immagine-a-video) e T2V (testo-a-video) con specifiche cinematografiche professionali e struttura timeline cinematografica. Preset I2V prioritizzato per accesso workflow più rapido.
* **Cinematografia Professionale**: Tutti i preset WAN 2.2 includono specifiche tecniche complete - sorgenti luminose, tipi ripresa, specifiche lenti, movimenti camera e requisiti tonalità colore per generazione video professionale.
* **Storyboard Esteso**: Nuovo preset per generazione storyboard-to-storyboard senza soluzione di continuità con compatibilità formato WAN 2.2, focus continuità e dettagli cinematografia professionale.
* **Branding Famiglia WAN**: Nomi coerenti su tutti i preset WAN 2.2 per migliore organizzazione e chiarezza workflow.
* **Modelli Abliterated Free**: Modelli predefiniti includono opzioni non censurate senza token (Qwen3-4B-abliterated-TIES, Qwen3-8B-abliterated-TIES) per accessibilità immediata.
* **Supporto Multi-Modello**: Cambia facilmente tra vari modelli ufficiali Qwen-VL con ordinamento intelligente 4B-primo per efficienza VRAM.
* **Download Automatico Modelli**: I modelli sono scaricati automaticamente al primo utilizzo.
* **Quantizzazione Intelligente**: Bilancia VRAM e performance con opzioni 4-bit, 8-bit e FP16. Quantizzazione 8-bit abilitata predefinita per accessibilità ottimale.
* **Attention Ottimizzato**: Pipeline attention pulita con supporto Flash Attention 2 e fallback stabile SDPA. Nessun patching complesso che potrebbe interferire con output modello.
* **Hardware-Aware**: Rileva automaticamente capacità GPU e previene errori con modelli incompatibili (es. FP8).
* **Generazione Riproducibile**: Usa parametro seed per output consistenti, con Modalità Seed Fisso per stabilità ultima.
* **Gestione Memoria**: Opzione "Keep Model Loaded" per mantenere modello in VRAM per elaborazione più rapida. **Nuovo parametro `unload_after_run`** per scaricare aggressivamente la memoria dopo ogni esecuzione, prevenendo errori OOM in sistemi con VRAM limitata.
* **Supporto Immagine & Video**: Accetta sia immagini singole che sequenze frame video come input.
* **Gestione Errori Robusta**: Fornisce messaggi errore chiari per problemi hardware o memoria.
* **Output Console Pulito**: Log console minimi e informativi durante operazione.
## **🚀 Installazione**
1. Clona questo repository nella tua directory ComfyUI/custom_nodes:
```
cd ComfyUI/custom_nodes
git clone https://github.com/huchukato/ComfyUI-QwenVL-Mod.git
```
2. Installa le dipendenze richieste:
```
cd ComfyUI/custom_nodes/ComfyUI-QwenVL-Mod
pip install -r requirements.txt
```
3. Riavvia ComfyUI.
### **Installazione Opzionale: Flash Attention 2**
Per 2-3x boost performance con GPU compatibili:
```bash
# Installa Flash Attention 2 (raccomandato)
pip install flash-attn --no-build-isolation
# O compila da sorgente
git clone https://github.com/Dao-AILab/flash-attention.git
cd flash-attention
python setup.py install
```
**Requisiti per Flash Attention 2:**
-- NVIDIA GPU con capability >= 8.6 (serie RTX 20/30/40/50)
-- CUDA >= 12.0
-- PyTorch >= 2.3.0
Vedi [sezione Flash Attention 2](#-boost-performance-flash-attention-2) per dettagli.
## **🧭 Panoramica Nodi**
### **Nodi Transformers (HF)**
- **QwenVL**: Inferenza vision-linguaggio rapida (immagine/video + preset/prompt personalizzati).
- **QwenVL (Avanzato)**: Controllo completo su parametri sampling, device e performance.
- **QwenVL Prompt Enhancer**: Miglioramento prompt solo testo (supporta sia modelli testo Qwen3 che modelli QwenVL in modalità testo).
### **Nodi GGUF (llama.cpp)**
- **QwenVL (GGUF)**: Inferenza vision-linguaggio GGUF.
- **QwenVL (GGUF Avanzato)**: Controlli GGUF estesi (contesto, layer GPU, ecc.).
- **QwenVL Prompt Enhancer (GGUF)**: Miglioramento prompt solo testo GGUF.
## **🧩 Nodi GGUF (backend llama.cpp)**
Questo repository include nodi **GGUF** powered by `llama-cpp-python` (separati dai nodi basati Transformers).
- **Nodi**: `QwenVL (GGUF)`, `QwenVL (GGUF Avanzato)`, `QwenVL Prompt Enhancer (GGUF)`
- **Cartella modelli** (predefinito): `ComfyUI/models/llm/GGUF/` (configurabile via `gguf_models.json`)
- **Requisito vision**: installa wheel `llama-cpp-python` con capacità vision che fornisce `Qwen3VLChatHandler` / `Qwen25VLChatHandler`
Vedi [docs/LLAMA_CPP_PYTHON_VISION_INSTALL.md](docs/LLAMA_CPP_PYTHON_VISION_INSTALL.md)
## **🗂️ File Configurazione**
- **Modelli HF**: `hf_models.json`
- `hf_vl_models`: modelli vision-linguaggio (usati da nodi QwenVL).
- `hf_text_models`: modelli solo testo (usati da Prompt Enhancer).
- **Modelli GGUF**: `gguf_models.json`
- **Prompt di sistema**: `AILab_System_Prompts.json` (include sia prompt VL che stili prompt-enhancer).
## **📥 Download Modelli**
I modelli saranno scaricati automaticamente al primo utilizzo. Se preferisci scaricarli manualmente, mettili nella directory ComfyUI/models/LLM/Qwen-VL/.
### **Modelli Vision HF (Qwen-VL)**
| Modello | Link |
| :---- | :---- |
| Qwen3-VL-2B-Instruct | [Download](https://huggingface.co/Qwen/Qwen3-VL-2B-Instruct) |
| Qwen3-VL-2B-Thinking | [Download](https://huggingface.co/Qwen/Qwen3-VL-2B-Thinking) |
| Qwen3-VL-2B-Instruct-FP8 | [Download](https://huggingface.co/Qwen/Qwen3-VL-2B-Instruct-FP8) |
| Qwen3-VL-2B-Thinking-FP8 | [Download](https://huggingface.co/Qwen/Qwen3-VL-2B-Thinking-FP8) |
| Qwen3-VL-4B-Instruct | [Download](https://huggingface.co/Qwen/Qwen3-VL-4B-Instruct) |
| Qwen3-VL-4B-Thinking | [Download](https://huggingface.co/Qwen/Qwen3-VL-4B-Thinking) |
| Qwen3-VL-4B-Instruct-FP8 | [Download](https://huggingface.co/Qwen/Qwen3-VL-4B-Instruct-FP8) |
| Qwen3-VL-4B-Thinking-FP8 | [Download](https://huggingface.co/Qwen/Qwen3-VL-4B-Thinking-FP8) |
| Qwen3-VL-8B-Instruct | [Download](https://huggingface.co/Qwen/Qwen3-VL-8B-Instruct) |
| Qwen3-VL-8B-Thinking | [Download](https://huggingface.co/Qwen/Qwen3-VL-8B-Thinking) |
| Qwen3-VL-8B-Instruct-FP8 | [Download](https://huggingface.co/Qwen/Qwen3-VL-8B-Instruct-FP8) |
| Qwen3-VL-8B-Thinking-FP8 | [Download](https://huggingface.co/Qwen/Qwen3-VL-8B-Thinking-FP8) |
| Qwen3-VL-32B-Instruct | [Download](https://huggingface.co/Qwen/Qwen3-VL-32B-Instruct) |
| Qwen3-VL-32B-Thinking | [Download](https://huggingface.co/Qwen/Qwen3-VL-32B-Thinking) |
| Qwen3-VL-32B-Instruct-FP8 | [Download](https://huggingface.co/Qwen/Qwen3-VL-32B-Instruct-FP8) |
| Qwen3-VL-32B-Thinking-FP8 | [Download](https://huggingface.co/Qwen/Qwen3-VL-32B-Thinking-FP8) |
| Qwen2.5-VL-3B-Instruct | [Download](https://huggingface.co/Qwen/Qwen2.5-VL-3B-Instruct) |
| Qwen2.5-VL-7B-Instruct | [Download](https://huggingface.co/Qwen/Qwen2.5-VL-7B-Instruct) |
### **Modelli Testo HF (Qwen3)**
| Modello | Link |
| :---- | :---- |
| Qwen3-0.6B | [Download](https://huggingface.co/Qwen/Qwen3-0.6B) |
| Qwen3-4B-Instruct-2507 | [Download](https://huggingface.co/Qwen/Qwen3-4B-Instruct-2507) |
| qwen3-4b-Z-Image-Engineer | [Download](https://huggingface.co/BennyDaBall/qwen3-4b-Z-Image-Engineer) |
### **Modelli GGUF (Download Manuale)**
| Gruppo | Modello | Repo | Alt Repo | File Modelli | MMProj |
| :-- | :-- | :-- | :-- | :-- | :-- |
| Qwen testo (GGUF) | Qwen3-4B-GGUF | [Qwen/Qwen3-4B-GGUF](https://huggingface.co/Qwen/Qwen3-4B-GGUF) | | Qwen3-4B-Q4_K_M.gguf, Qwen3-4B-Q5_0.gguf, Qwen3-4B-Q5_K_M.gguf, Qwen3-4B-Q6_K.gguf, Qwen3-4B-Q8_0.gguf | |
| Qwen-VL (GGUF) | Qwen3-VL-4B-Instruct-GGUF | [Qwen/Qwen3-VL-4B-Instruct-GGUF](https://huggingface.co/Qwen/Qwen3-VL-4B-Instruct-GGUF) | | Qwen3VL-4B-Instruct-F16.gguf, Qwen3VL-4B-Instruct-Q4_K_M.gguf, Qwen3VL-4B-Instruct-Q8_0.gguf | mmproj-Qwen3VL-4B-Instruct-F16.gguf |
| Qwen-VL (GGUF) | Qwen3-VL-8B-Instruct-GGUF | [Qwen/Qwen3-VL-8B-Instruct-GGUF](https://huggingface.co/Qwen/Qwen3-VL-8B-Instruct-GGUF) | | Qwen3VL-8B-Instruct-F16.gguf, Qwen3VL-8B-Instruct-Q4_K_M.gguf, Qwen3VL-8B-Instruct-Q8_0.gguf | mmproj-Qwen3VL-8B-Instruct-F16.gguf |
| Qwen-VL (GGUF) | Qwen3-VL-4B-Thinking-GGUF | [Qwen/Qwen3-VL-4B-Thinking-GGUF](https://huggingface.co/Qwen/Qwen3-VL-4B-Thinking-GGUF) | | Qwen3VL-4B-Thinking-F16.gguf, Qwen3VL-4B-Thinking-Q4_K_M.gguf, Qwen3VL-4B-Thinking-Q8_0.gguf | mmproj-Qwen3VL-4B-Thinking-F16.gguf |
| Qwen-VL (GGUF) | Qwen3-VL-8B-Thinking-GGUF | [Qwen/Qwen3-VL-8B-Thinking-GGUF](https://huggingface.co/Qwen/Qwen3-VL-8B-Thinking-GGUF) | | Qwen3VL-8B-Thinking-F16.gguf, Qwen3VL-8B-Thinking-Q4_K_M.gguf, Qwen3VL-8B-Thinking-Q8_0.gguf | mmproj-Qwen3VL-8B-Thinking-F16.gguf |
## **📖 Utilizzo**
### **Uso Base**
1. Aggiungi il nodo **"QwenVL"** dalla categoria 🧪AILab/QwenVL.
2. Seleziona il **model\_name** che desideri utilizzare.
3. Connetti un'immagine o video (sequenza frame) al nodo.
4. Scrivi il tuo prompt usando campo preset o personalizzato.
5. Esegui il workflow.
### **Uso Avanzato**
Per più controllo, usa il nodo **"QwenVL (Avanzato)"**. Questo ti dà accesso a parametri generazione dettagliati come temperatura, top\_p, beam search e selezione device.
## **⚙️ Parametri**
| Parametro | Descrizione | Predefinito | Range | Nodi |
| :---- | :---- | :---- | :---- | :---- |
| **model\_name** | Il modello Qwen-VL da usare. | Qwen3-VL-4B-Instruct | \- | Standard & Avanzato |
| **quantization** | Quantizzazione al volo. Ignorata per modelli pre-quantizzati (es. FP8). | 8-bit (Bilanciato) | 4-bit, 8-bit, None | Standard & Avanzato |
| **preset\_prompt** | Selezione di prompt predefiniti per compiti comuni. | "Describe this..." | Testo qualsiasi | Standard & Avanzato |
| **custom\_prompt** | Sostituisce preset prompt se fornito. | | Testo qualsiasi | Standard & Avanzato |
| **max\_tokens** | Numero massimo nuovi token da generare. | 1024 | 64-2048 | Standard & Avanzato |
| **keep\_model\_loaded** | Mantiene modello in VRAM per esecuzioni successive più veloci. | True | True/False | Standard & Avanzato |
| **seed** | Seed per risultati riproducibili. | 1 | 1 \- 2^64-1 | Standard & Avanzato |
| **temperature** | Controlla casualità. Valori più alti = più creativi. (Usato quando num\_beams è 1). | 0.6 | 0.1-1.0 | Solo Avanzato |
| **top\_p** | Soglia sampling nucleo. (Usato quando num\_beams è 1). | 0.9 | 0.0-1.0 | Solo Avanzato |
| **num\_beams** | Numero di beam per beam search. > 1 disabilita sampling temperature/top\_p. | 1 | 1-10 | Solo Avanzato |
| **repetition\_penalty** | Scoraggia token ripetuti. | 1.2 | 0.0-2.0 | Solo Avanzato |
| **frame\_count** | Numero di frame da campionare da input video. | 16 | 1-64 | Solo Avanzato |
| **device** | Sovrascrive selezione device automatica. | auto | auto, cuda, cpu | Solo Avanzato |
| **attention_mode** | Backend attention per ottimizzazione performance. | auto | auto, flash_attention_2, sdpa | Standard & Avanzato |
### **💡 Opzioni Quantizzazione**
| Modalità | Precisione | Uso Memoria | Velocità | Qualità | Raccomandato Per |
| :---- | :---- | :---- | :---- | :---- | :---- |
| None (FP16) | Float 16-bit | Alto | Velocissimo | Migliore | GPU VRAM alta (16GB+) |
| 8-bit (Bilanciato) | Intero 8-bit | Medio | Veloce | Ottimo | Performance bilanciata (8GB+) |
| 4-bit (VRAM-friendly) | Intero 4-bit | Basso | Più lento* | Buono | GPU VRAM bassa (<8GB) |
\* **Nota Velocità 4-bit**: La quantizzazione 4-bit riduce significativamente uso VRAM ma può risultare in performance più lente su alcuni sistemi a causa overhead computazionale dequantizzazione real-time.
### **⚡ Opzioni Modalità Attention**
| Modalità | Descrizione | Velocità | Memoria | Requisiti |
| :---- | :---- | :---- | :---- | :---- |
| **auto** | Seleziona automaticamente Flash Attention 2 se disponibile, fallback SDPA | Veloce | Medio | pacchetto flash-attn |
| **flash_attention_2** | Usa Flash Attention v2 per performance ottimali | Velocissimo | Basso | flash-attn + GPU CUDA |
| **sdpa** | PyTorch nativo Scaled Dot Product Attention | Medio | Medio | PyTorch 2.0+ |
**Requisiti Flash Attention 2:**
-- NVIDIA GPU con capability >= 8.6 (serie RTX 20/30/40/50)
-- CUDA >= 12.0
-- PyTorch >= 2.3.0
-- pacchetto flash-attn installato
### **🤔 Consigli Impostazioni**
| Impostazione | Raccomandazione |
| :---- | :---- |
| **Scelta Modello** | Per molti utenti, Qwen3-VL-4B-Instruct è ottimo punto di partenza. Se hai GPU serie 40, prova versione -FP8 per performance migliori. |
| **Modalità Memoria** | Mantieni keep\_model\_loaded abilitato (True) per performance migliori se prevedi eseguire nodo più volte. Disabilitalo solo se esaurisci VRAM per altri nodi. |
| **Quantizzazione** | Inizia con predefinito 8-bit. Se hai VRAM abbondante (>16GB), passa a None (FP16) per velocità e qualità migliori. Se sei basso in VRAM, usa 4-bit. |
| **Performance** | La prima volta che un modello viene caricato con quantizzazione specifica, può essere lento. Esecuzioni successive (con keep\_model\_loaded abilitato) saranno molto più veloci. |
| **Modalità Attention** | Usa "flash_attention_2" per 2-3x velocità se hai GPU compatibile. Altrimenti usa "auto" per selezione automatica. |
## **🧠 Informazioni Modello**
Questo nodo utilizza serie modelli Qwen-VL, sviluppati dal Qwen Team di Alibaba Cloud. Questi sono potenti modelli vision-linguaggio open-source (LVLM) progettati per capire e processare informazioni sia visive che testuali, rendendoli ideali per compiti come descrizione dettagliata immagini e video.
## **⚡ Boost Performance Flash Attention 2**
Questa integrazione include supporto per **Flash Attention 2**, un'implementazione attention all'avanguardia che fornisce significativi miglioramenti performance:
### **🚀 Guadagni Performance**
| Modello | Flash Attention 2 | Velocità |
|-------|----------------|---------|
| Qwen2.5-VL-3B | 100% | 200-300% | 2-3x |
| Qwen3-VL-4B | 100% | 150-250% | 1.5-2.5x |
### **🎯 Come Usare**
1. **Installa Flash Attention 2** (vedi [Installazione](#-installazione-opzionale-flash-attention-2))
2. **Seleziona "flash_attention_2"** nel parametro `attention_mode`
3. **Esegui il tuo workflow** - il sistema applica automaticamente l'ottimizzazione
### **🔧 Dettagli Tecnici**
-- **Implementazione**: Usa kernel attention ottimizzati per migliore efficienza memoria
-- **Compatibilità**: Funziona con tutte modalità quantizzazione (4-bit, 8-bit, FP16)
-- **Integrazione**: Si integra senza soluzione di continuità con workflow esistenti
-- **Fallback**: Ripiega automaticamente su SDPA se Flash Attention 2 non è disponibile
### **📋 Checklist Requisiti**
- [ ] pacchetto flash-attn installato
- [ ] VRAM sufficiente per modello scelto
- [ ] GPU compatibile (RTX 20 series o più recente)
### **🐛 Risoluzione Problemi**
**Flash Attention 2 non funziona?**
```bash
# Controlla installazione
python -c "import flash_attn; print('Flash Attention 2 disponibile')"
# Controlla capability GPU
python -c "import torch; print(f'GPU capability: {torch.cuda.get_device_capability()}')"
```
**Problemi Comuni:**
- **"Flash Attention 2 non disponibile"**: Installa il pacchetto e controlla compatibilità GPU
- **"CUDA non disponibile"**: Assicurati di avere installazione PyTorch compatibile CUDA
- **"GPU capability insufficiente"**: Flash Attention 2 richiede serie RTX 20 o più recente
### **📚 Riferimenti**
- [Flash Attention 2 GitHub](https://github.com/Dao-AILab/flash-attention)
- [Flash Attention 2 Paper](https://arxiv.org/abs/2304.01252)
- [Benchmark Performance](https://github.com/Dao-AILab/flash-attention#performance)
## **🎬 Integrazione WAN 2.2**
Questa versione migliorata include prompt specializzati per **WAN 2.2** generazione video, supportando sia workflow I2V (immagine-a-video) che T2V (testo-a-video).
### **🎯 Prompt WAN 2.2 Disponibili**
| Tipo Prompt | Caso Uso | Input | Output | Posizione |
|:---|:---|:---|:---|:---|
| **🍿 Wan 2.2 I2V** | Immagine-a-Video | Immagine + Testo | Timeline cinematografica 5-secondi | Nodi QwenVL |
| **🍿 Wan 2.2 T2V** | Testo-a-Video | Testo solo | Timeline cinematografica 5-secondi | Nodi Prompt Enhancer |
### **⚡ Funzionalità**
- **Struttura Timeline Cinematografica**: Video 5-secondi con descrizioni secondo per secondo
- **Supporto Multilingua**: Input Italiano/Inglese → Output ottimizzato Inglese
- **Descrizione Scena Professionale**: Direzione stile film inclusi illuminazione, camera, composizione
- **Gestione NSFW**: Filtro contenuti e descrizione appropriati
- **Ottimizzazione WAN 2.2**: Formattato specificamente per migliori risultati generazione video
### **📝 Esempio Formato Output**
```
(At 0 seconds: A young woman stands facing a rack of clothes...)
(At 1 second: The blouse falls to the floor around her feet...)
(At 2 seconds: She reaches out with her right hand...)
(At 3 seconds: She turns her body slightly towards the mirror...)
(At 4 seconds: Lifting the hanger, she holds the dark fabric...)
(At 5 seconds: A subtle, thoughtful expression crosses her face...)
```
### **🔧 Utilizzo**
1. **Per I2V**: Usa preset "🍿 Wan 2.2 I2V" in nodi QwenVL con input immagine
2. **Per T2V**: Usa stile "🍿 Wan 2.2 T2V" in nodi Prompt Enhancer con solo testo
3. **Per Storyboard**: Usa "🍿 Wan Extended Storyboard" per continuità scena senza soluzione di continuità
4. **Per Video Generale**: Usa "🎥 Wan Cinematic Video" per descrizioni scena professionali singole
### **🎨 Best Practices**
- Fornisci input chiaro e descrittivo per migliore interpretazione scena
- Usa direzioni camera e illuminazione specifiche quando possibile
- Includi dettagli umore e atmosfera per risultati cinematografici
- Sfrutta specifiche cinematografia professionale per qualità video ottimale
- Il sistema gestisce automaticamente ottimizzazione timeline per preset WAN 2.2
## **🗺️ Roadmap**
### **✅ Completato (v2.0.7)**
* ✅ Supporto per modelli Qwen3-VL e Qwen2.5-VL.
* ✅ Supporto backend GGUF per inferenza più rapida.
* ✅ Nodi Prompt Enhancer per workflow solo testo.
* ✅ Integrazione Flash Attention 2 per 2-3x boost performance.
* ✅ Prompt generazione video WAN 2.2 I2V e T2V.
* ✅ Preset Storyboard Esteso per continuità scena.
* ✅ Specifiche cinematografia professionale per tutti preset WAN 2.2.
* ✅ Branding famiglia WAN e nomi coerenti.
* ✅ Preset Storyboard Esteso per generazione continuità senza soluzione di continuità.
* ✅ Modelli abliterated free senza requisiti token.
* ✅ Logica prompt personalizzata migliorata su tutti i nodi.
* ✅ Supporto completo generazione contenuti NSFW.
* ✅ Ordinamento modelli ottimizzato e predefiniti quantizzazione.
* ✅ Pipeline attention pulita con stabilità SDPA.
* ✅ Rimossa complessità per migliore affidabilità output modello.
* ✅ Sistema cache intelligente prompt per ottimizzazione performance.
* ✅ Modalità Seed Fisso per output stabili indipendentemente da variazioni multimediali.
* ✅ Cache persistente riavvii ComfyUI.
* ✅ Aggiornamenti manutenzione codice per compatibilità futura.
## **🙏 Crediti**
* **Qwen Team**: [Alibaba Cloud](https://github.com/QwenLM) - Per sviluppo e open-source potenti modelli Qwen-VL.
* **ComfyUI**: [comfyanonymous](https://github.com/comfyanonymous/ComfyUI) - Per incredibile e estensibile piattaforma ComfyUI.
* **llama-cpp-python**: [JamePeng/llama-cpp-python](https://github.com/JamePeng/llama-cpp-python) - Backend GGUF con supporto vision usato da nodi GGUF.
* **GenorTG**: [GenorTG/ComfyUI-Genor-QwenVL-Mod](https://github.com/GenorTG/ComfyUI-Genor-QwenVL-Mod) - Per innovativi miglioramenti di gestione memoria incluso il parametro `unload_after_run` e ottimizzazioni cache prompt che prevengono errori OOM in workflow multi-nodo.
* **Integrazione ComfyUI**: [1038lab](https://github.com/1038lab) - Sviluppatore di questo custom node.
## **👥 Autore**
- **huchukato**
- 🐙 [GitHub](https://github.com/huchukato)
- 🐦 [X (Twitter)](https://twitter.com/huchukato)
- 🎨 [Civitai](https://civitai.com/user/huchukato) - Dai un'occhiata ai miei modelli arte AI!
## **📜 Licenza**
Il codice di questo repository è rilasciato sotto [Licenza GPL-3.0](LICENSE).123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657"""
{
"name": "QwenVL-Mod: Enhanced Vision-Language",
"description": "Enhanced QwenVL node with Flash Attention 2, WAN 2.2 video generation, free abliterated models, and comprehensive NSFW support. Advanced fork with major improvements over original for stable multimodal AI workflows.",
"author": "huchukato",
"version": "2.0.4",
"url": "https://github.com/huchukato/ComfyUI-QwenVL-Mod",
"category": "image"
}
"""
import importlib.util
import os
import sys
# Get the directory of the current script
current_dir = os.path.dirname(__file__)
sys.path.insert(0, current_dir)
NODE_CLASS_MAPPINGS = {}
NODE_DISPLAY_NAME_MAPPINGS = {}
WEB_DIRECTORY = "./web"
def load_modules_from_directory(directory):
for file in os.listdir(directory):
if file.endswith(".py"):
file_path = os.path.join(directory, file)
module_name = os.path.basename(file)[:-3]
if module_name == os.path.basename(__file__)[:-3]:
continue
try:
spec = importlib.util.spec_from_file_location(module_name, file_path)
module = importlib.util.module_from_spec(spec)
sys.modules[module_name] = module
spec.loader.exec_module(module)
if hasattr(module, "NODE_CLASS_MAPPINGS"):
NODE_CLASS_MAPPINGS.update(module.NODE_CLASS_MAPPINGS)
if hasattr(module, "NODE_DISPLAY_NAME_MAPPINGS"):
NODE_DISPLAY_NAME_MAPPINGS.update(module.NODE_DISPLAY_NAME_MAPPINGS)
except Exception as e:
print(f"Error loading module {module_name}: {e}")
load_modules_from_directory(current_dir)
# Also load from nodes subdirectory
nodes_dir = os.path.join(current_dir, "nodes")
if os.path.exists(nodes_dir):
load_modules_from_directory(nodes_dir)
NODE_CLASS_MAPPINGS = dict(sorted(NODE_CLASS_MAPPINGS.items(), key=lambda x: NODE_DISPLAY_NAME_MAPPINGS.get(x[0], x[0])))
NODE_DISPLAY_NAME_MAPPINGS = dict(sorted(NODE_DISPLAY_NAME_MAPPINGS.items(), key=lambda x: x[1]))
__all__ = [
"NODE_CLASS_MAPPINGS",
"NODE_DISPLAY_NAME_MAPPINGS"
]123456789101112131415161718192021222324{
"hf_models": {
"My QwenVL Finetune": {
"repo_id": "myusername/MyQwenVL-Finetune",
"default": false,
"quantized": false,
"vram_requirement": {
"4bit": 4,
"8bit": 6,
"full": 10
}
},
"QwenVL Mini 4bit": {
"repo_id": "huggingface-user/qwenvl-mini-4bit",
"default": false,
"quantized": false,
"vram_requirement": {
"4bit": 2,
"8bit": 4,
"full": 8
}
}
}
}12345678910111213{
"author": "huchukato",
"title": "QwenVL-Mod: Enhanced Vision-Language",
"reference": "https://github.com/huchukato/ComfyUI-QwenVL-Mod",
"files": [
"https://github.com/huchukato/ComfyUI-QwenVL-Mod"
],
"install_type": "git-clone",
"description": "Enhanced QwenVL node with smart prompt caching, Fixed Seed Mode, professional cinematography specifications, WAN 2.2 video generation, Extended Storyboard preset, free abliterated models, and comprehensive NSFW support. Advanced fork with major improvements over original for stable multimodal AI workflows.",
"category": "image",
"tags": ["vision", "language", "multimodal", "qwen", "flash_attention", "performance", "wan2.2", "video", "i2v", "t2v", "storyboard", "cinematography", "professional", "caching", "fixed_seed", "abliterated", "nsfw", "enhanced", "fork"],
"version": "2.0.7"
}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113# Install `llama-cpp-python` (Vision / Qwen-VL GGUF)
This plugin’s **QwenVL (GGUF)** vision nodes require a `llama-cpp-python` build that includes multimodal chat handlers such as:
- `Qwen3VLChatHandler`
- `Qwen25VLChatHandler`
The upstream `llama-cpp-python` from PyPI often does **not** include these vision handlers. Use a fork/build that provides them (e.g. JamePeng’s fork) and install a **Release wheel**.
Release wheels (download `.whl` here):
- [https://github.com/JamePeng/llama-cpp-python/releases](https://github.com/JamePeng/llama-cpp-python/releases/)
## 0) Close ComfyUI first
Stop ComfyUI before installing/replacing packages, especially on Windows portable.
## 1) Identify the exact Python ComfyUI uses
### Windows portable (common)
Your Python is usually:
`ComfyUI\\python_embeded\\python.exe`
Check:
```bat
C:\AI\ComfyUI\python_embeded\python.exe -V
C:\AI\ComfyUI\python_embeded\python.exe -c "import sys; print(sys.executable)"
```
### venv / conda
Activate your env, then:
```bash
python -V
python -c "import sys; print(sys.executable)"
```
## 2) Backup your environment (recommended)
```bat
C:\AI\ComfyUI\python_embeded\python.exe -m pip freeze > C:\AI\ComfyUI\requirements-backup.txt
```
## 3) Install the Release wheel (recommended)
Download a **Release `.whl`** from:
[https://github.com/JamePeng/llama-cpp-python/releases/](https://github.com/JamePeng/llama-cpp-python/releases/)
The wheel **must match ALL of the following**:
* **Python version** used by ComfyUI
(`cp310` / `cp311` / `cp312` / `cp313`)
* **Platform**
`win_amd64` (Windows 64-bit)
* **Build type**
* **CPU wheel** → safest option (no CUDA toolkit required)
* **CUDA wheel (`cuXXX`)** → requires a compatible CUDA runtime / toolkit
> [!WARNING]
> **Windows note (important)**
> If you install a CUDA wheel, the CUDA build tag (e.g. `cu121`, `cu122`) must be compatible with your installed CUDA runtime/toolkit.
A mismatch can cause errors like **“cannot load ggml.dll” even though the file exists**.
If you are unsure, **use a CPU wheel**.
Install with force-reinstall (safer than manual uninstall):
```
C:\AI\ComfyUI\python_embeded\python.exe -m pip install --upgrade --force-reinstall C:\path\to\llama_cpp_python-*.whl
```
Notes:
* Warnings about leftover folders like `~umpy` are usually safe to ignore while ComfyUI is closed.
* Make sure ComfyUI is **fully stopped** before installing.
## 4) Verify vision handlers exist
```bat
C:\AI\ComfyUI\python_embeded\python.exe -c "from llama_cpp.llama_chat_format import Qwen3VLChatHandler, Qwen25VLChatHandler; print('handlers OK')"
```
If this fails, you installed a wheel that does not include vision support (or installed into the wrong Python environment).
## 5) Fix common dependency conflicts (Windows)
Some wheels may upgrade dependencies (notably `numpy` / `pillow`) and cause conflicts with other packages (like OpenCV).
### OpenCV conflict (recommended fix)
If you see errors like:
- `opencv-python ... requires numpy<2.3.0,>=2; ... but you have numpy 2.3.x`
Pin numpy back:
```bat
C:\AI\ComfyUI\python_embeded\python.exe -m pip install --upgrade "numpy<2.3"
```
### Pillow conflicts (optional)
If you don’t use packages that depend on an older Pillow, you can ignore Pillow warnings. Otherwise:
```bat
C:\AI\ComfyUI\python_embeded\python.exe -m pip install --upgrade "pillow<12"
```1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162# 🧩 ComfyUI-QwenVL — Custom Models Guide
You can add your own HuggingFace or local fine-tuned QwenVL models
without modifying the main code.
---
## 📁 File location
Place a file named `custom_models.json` in this folder:
```
ComfyUI/custom_nodes/ComfyUI-QwenVL/
````
When ComfyUI starts, it will automatically detect and merge this file
with the default `config.json`.
---
## ⚙️ File format
Use the following JSON structure:
```json
{
"hf_models": {
"My QwenVL Finetune": {
"repo_id": "myusername/MyQwenVL-Finetune",
"default": false,
"quantized": false,
"vram_requirement": {
"4bit": 4,
"8bit": 6,
"full": 10
}
},
"QwenVL Mini 4bit": {
"repo_id": "huggingface-user/qwenvl-mini-4bit",
"default": false,
"quantized": false,
"vram_requirement": {
"4bit": 2,
"8bit": 4,
"full": 8
}
}
}
}
````
* The **key** (e.g. `"My QwenVL Finetune"`) is what appears in the model dropdown list.
* `"repo_id"` can be a HuggingFace model name or a local directory path.
* `"vram_requirement"` is optional but helps ComfyUI display VRAM recommendations.
---
## 🧠 Notes
* If `custom_models.json` doesn’t exist, the system just skips it (no errors).
* You can edit and reload it anytime — simply restart ComfyUI to apply changes.
* Compatible with both Qwen2-VL and Qwen3-VL model architectures.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466{
"id": "b1b52a7e-e128-4de3-83e0-2238301079ca",
"revision": 0,
"last_node_id": 18,
"last_link_id": 18,
"nodes": [
{
"id": 12,
"type": "PreviewAny",
"pos": [
-470,
70
],
"size": [
890,
350
],
"flags": {},
"order": 5,
"mode": 0,
"inputs": [
{
"name": "source",
"type": "*",
"link": 16
}
],
"outputs": [],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.65",
"Node name for S&R": "PreviewAny",
"enableTabs": false,
"tabWidth": 65,
"tabXOffset": 10,
"hasSecondTab": false,
"secondTabText": "Send Back",
"secondTabOffset": 80,
"secondTabWidth": 65,
"ue_properties": {
"widget_ue_connectable": {},
"input_ue_unconnectable": {},
"version": "7.3"
}
},
"widgets_values": [
null,
null,
false
]
},
{
"id": 16,
"type": "MarkdownNote",
"pos": [
-1780,
80
],
"size": [
550,
530
],
"flags": {},
"order": 0,
"mode": 0,
"inputs": [],
"outputs": [],
"properties": {
"ue_properties": {
"widget_ue_connectable": {},
"version": "7.5.2",
"input_ue_unconnectable": {}
}
},
"widgets_values": [
"## **⚙️ Parameters**\n\n| Parameter | Description | Default | Range | Node(s) |\n| :---- | :---- | :---- | :---- | :---- |\n| **model\\_name** | The Qwen-VL model to use. | Qwen3-VL-4B-Instruct | \\- | Standard & Advanced |\n| **quantization** | On-the-fly quantization. Ignored for pre-quantized models (e.g., FP8). | 8-bit (Balanced) | 4-bit, 8-bit, None | Standard & Advanced |\n| **preset\\_prompt** | A selection of pre-defined prompts for common tasks. | \"Describe this...\" | Any text | Standard & Advanced |\n| **custom\\_prompt** | Overrides the preset prompt if provided. | | Any text | Standard & Advanced |\n| **max\\_tokens** | Maximum number of new tokens to generate. | 1024 | 64-2048 | Standard & Advanced |\n| **keep\\_model\\_loaded** | Keep the model in VRAM for faster subsequent runs. | True | True/False | Standard & Advanced |\n| **seed** | A seed for reproducible results. | 1 | 1 \\- 2^64-1 | Standard & Advanced |\n| **temperature** | Controls randomness. Higher values \\= more creative. (Used when num\\_beams is 1). | 0.6 | 0.1-1.0 | Advanced Only |\n| **top\\_p** | Nucleus sampling threshold. (Used when num\\_beams is 1). | 0.9 | 0.0-1.0 | Advanced Only |\n| **num\\_beams** | Number of beams for beam search. \\> 1 disables temperature/top\\_p sampling. | 1 | 1-10 | Advanced Only |\n| **repetition\\_penalty** | Discourages repeating tokens. | 1.2 | 0.0-2.0 | Advanced Only |\n| **frame\\_count** | Number of frames to sample from the video input. | 16 | 1-64 | Advanced Only |\n| **device** | Override automatic device selection. | auto | auto, cuda, cpu | Advanced Only |"
],
"color": "#432",
"bgcolor": "#653"
},
{
"id": 17,
"type": "AILab_QwenVL",
"pos": [
-885,
70
],
"size": [
394.1806388251093,
303.45832648511134
],
"flags": {},
"order": 3,
"mode": 0,
"inputs": [
{
"name": "image",
"shape": 7,
"type": "IMAGE",
"link": 15
},
{
"name": "video",
"shape": 7,
"type": "IMAGE",
"link": null
}
],
"outputs": [
{
"name": "RESPONSE",
"type": "STRING",
"links": [
16
]
}
],
"properties": {
"ue_properties": {
"widget_ue_connectable": {},
"input_ue_unconnectable": {}
},
"Node name for S&R": "AILab_QwenVL"
},
"widgets_values": [
"Qwen3-VL-2B-Instruct",
"None (FP16)",
"auto",
"🖼️ Detailed Description",
"",
512,
true,
1,
"randomize"
],
"color": "#28403f",
"bgcolor": "#374539"
},
{
"id": 7,
"type": "AILab_LoadImage",
"pos": [
-1200,
70
],
"size": [
300,
720
],
"flags": {},
"order": 1,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
15
]
},
{
"name": "MASK",
"type": "MASK",
"links": null
},
{
"name": "WIDTH",
"type": "INT",
"links": null
},
{
"name": "HEIGHT",
"type": "INT",
"links": null
}
],
"properties": {
"Node name for S&R": "AILab_LoadImage",
"enableTabs": false,
"tabWidth": 65,
"tabXOffset": 10,
"hasSecondTab": false,
"secondTabText": "Send Back",
"secondTabOffset": 80,
"secondTabWidth": 65,
"ue_properties": {
"widget_ue_connectable": {},
"input_ue_unconnectable": {},
"version": "7.3"
}
},
"widgets_values": [
"",
"2430364.png",
"lanczos",
1,
1,
"longest_side",
0,
"image"
],
"color": "#2e3e57",
"bgcolor": "#4b5b73"
},
{
"id": 13,
"type": "PreviewAny",
"pos": [
-200,
480
],
"size": [
620,
370
],
"flags": {},
"order": 6,
"mode": 0,
"inputs": [
{
"name": "source",
"type": "*",
"link": 18
}
],
"outputs": [],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.65",
"Node name for S&R": "PreviewAny",
"enableTabs": false,
"tabWidth": 65,
"tabXOffset": 10,
"hasSecondTab": false,
"secondTabText": "Send Back",
"secondTabOffset": 80,
"secondTabWidth": 65,
"ue_properties": {
"widget_ue_connectable": {},
"input_ue_unconnectable": {},
"version": "7.3"
}
},
"widgets_values": [
null,
null,
false
]
},
{
"id": 18,
"type": "AILab_QwenVL_Advanced",
"pos": [
-610.5085688039786,
481.1527608367014
],
"size": [
396.48624844852634,
468
],
"flags": {},
"order": 4,
"mode": 0,
"inputs": [
{
"name": "image",
"shape": 7,
"type": "IMAGE",
"link": null
},
{
"name": "video",
"shape": 7,
"type": "IMAGE",
"link": 17
}
],
"outputs": [
{
"name": "RESPONSE",
"type": "STRING",
"links": [
18
]
}
],
"properties": {
"ue_properties": {
"widget_ue_connectable": {},
"input_ue_unconnectable": {}
},
"Node name for S&R": "AILab_QwenVL_Advanced"
},
"widgets_values": [
"Qwen3-VL-2B-Instruct",
"None (FP16)",
"auto",
false,
"auto",
"🖼️ Detailed Description",
"",
512,
0.6,
0.9,
1,
1.2,
16,
true,
1,
"randomize"
],
"color": "#28403f",
"bgcolor": "#374539"
},
{
"id": 11,
"type": "VHS_LoadVideo",
"pos": [
-880,
480
],
"size": [
255.8291015625,
560.3298002919321
],
"flags": {},
"order": 2,
"mode": 0,
"inputs": [
{
"name": "meta_batch",
"shape": 7,
"type": "VHS_BatchManager",
"link": null
},
{
"name": "vae",
"shape": 7,
"type": "VAE",
"link": null
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
17
]
},
{
"name": "frame_count",
"type": "INT",
"links": null
},
{
"name": "audio",
"type": "AUDIO",
"links": null
},
{
"name": "video_info",
"type": "VHS_VIDEOINFO",
"links": null
}
],
"properties": {
"cnr_id": "comfyui-videohelpersuite",
"ver": "08e8df15db24da292d4b7f943c460dc2ab442b24",
"Node name for S&R": "VHS_LoadVideo",
"enableTabs": false,
"tabWidth": 65,
"tabXOffset": 10,
"hasSecondTab": false,
"secondTabText": "Send Back",
"secondTabOffset": 80,
"secondTabWidth": 65,
"ue_properties": {
"widget_ue_connectable": {},
"input_ue_unconnectable": {},
"version": "7.3"
}
},
"widgets_values": {
"video": "sing_1.mp4",
"force_rate": 0,
"custom_width": 0,
"custom_height": 0,
"frame_load_cap": 0,
"skip_first_frames": 0,
"select_every_nth": 1,
"format": "AnimateDiff",
"videopreview": {
"hidden": false,
"paused": false,
"params": {
"filename": "sing_1.mp4",
"type": "input",
"format": "video/mp4",
"force_rate": 0,
"custom_width": 0,
"custom_height": 0,
"frame_load_cap": 0,
"skip_first_frames": 0,
"select_every_nth": 1
}
}
}
}
],
"links": [
[
15,
7,
0,
17,
0,
"IMAGE"
],
[
16,
17,
0,
12,
0,
"STRING"
],
[
17,
11,
0,
18,
1,
"IMAGE"
],
[
18,
18,
0,
13,
0,
"STRING"
]
],
"groups": [],
"config": {},
"extra": {
"frontendVersion": "1.34.9",
"VHS_latentpreview": false,
"VHS_latentpreviewrate": 0,
"VHS_MetadataImage": true,
"VHS_KeepIntermediate": true,
"ue_links": [],
"links_added_by_ue": [],
"ds": {
"scale": 0.693975512958857,
"offset": [
1764.4004214905397,
359.36315462869436
]
},
"workflowRendererVersion": "LG"
},
"version": 0.4
}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364{
"id": "afd623e3-56b5-44d1-915f-4b020a0c435d",
"revision": 0,
"last_node_id": 25,
"last_link_id": 0,
"nodes": [
{
"id": 17,
"type": "AILab_QwenVL_GGUF_Advanced",
"pos": [
1090.7435866951005,
541.3632089660127
],
"size": [
340,
516
],
"flags": {},
"order": 0,
"mode": 0,
"inputs": [
{
"name": "image",
"shape": 7,
"type": "IMAGE",
"link": null
},
{
"name": "video",
"shape": 7,
"type": "IMAGE",
"link": null
}
],
"outputs": [
{
"name": "RESPONSE",
"type": "STRING",
"links": null
}
],
"properties": {
"Node name for S&R": "AILab_QwenVL_GGUF_Advanced",
"ue_properties": {
"widget_ue_connectable": {},
"input_ue_unconnectable": {},
"version": "7.5.2"
}
},
"widgets_values": [
"Qwen2.5-VL-3B-Instruct-BF16.gguf",
"auto",
"🖼️ Detailed Description",
"",
512,
0.6,
0.9,
1.2,
16,
8192,
512,
-1,
4096,
0,
4194304,
true,
1,
"randomize"
],
"color": "#474539",
"bgcolor": "#374445"
},
{
"id": 21,
"type": "AILab_QwenVL_Advanced",
"pos": [
1090.7435866951005,
1103.0165621245635
],
"size": [
340,
468
],
"flags": {},
"order": 1,
"mode": 0,
"inputs": [
{
"name": "image",
"shape": 7,
"type": "IMAGE",
"link": null
},
{
"name": "video",
"shape": 7,
"type": "IMAGE",
"link": null
}
],
"outputs": [
{
"name": "RESPONSE",
"type": "STRING",
"links": null
}
],
"properties": {
"Node name for S&R": "AILab_QwenVL_Advanced",
"ue_properties": {
"widget_ue_connectable": {},
"input_ue_unconnectable": {},
"version": "7.5.2"
}
},
"widgets_values": [
"Qwen3-VL-2B-Instruct",
"None (FP16)",
"auto",
false,
"auto",
"🖼️ Detailed Description",
"",
512,
0.6,
0.9,
1,
1.2,
16,
true,
1,
"randomize"
],
"color": "#28403f",
"bgcolor": "#374539"
},
{
"id": 20,
"type": "AILab_QwenVL",
"pos": [
728.3779414208888,
1103.0165621245635
],
"size": [
340,
300
],
"flags": {},
"order": 2,
"mode": 0,
"inputs": [
{
"name": "image",
"shape": 7,
"type": "IMAGE",
"link": null
},
{
"name": "video",
"shape": 7,
"type": "IMAGE",
"link": null
}
],
"outputs": [
{
"name": "RESPONSE",
"type": "STRING",
"links": null
}
],
"properties": {
"Node name for S&R": "AILab_QwenVL",
"ue_properties": {
"widget_ue_connectable": {},
"input_ue_unconnectable": {},
"version": "7.5.2"
}
},
"widgets_values": [
"Qwen3-VL-2B-Instruct",
"None (FP16)",
"auto",
"🖼️ Detailed Description",
"",
512,
true,
1,
"randomize"
],
"color": "#28403f",
"bgcolor": "#374539"
},
{
"id": 23,
"type": "AILab_QwenVL_GGUF_PromptEnhancer",
"pos": [
1453.109231969312,
541.3632089660127
],
"size": [
340,
382
],
"flags": {},
"order": 3,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "ENHANCED_OUTPUT",
"type": "STRING",
"links": null
}
],
"properties": {
"ue_properties": {
"widget_ue_connectable": {},
"input_ue_unconnectable": {}
},
"Node name for S&R": "AILab_QwenVL_GGUF_PromptEnhancer"
},
"widgets_values": [
"Qwen3-4B-Q4_K_M.gguf",
"",
"📝 Enhance",
"",
256,
0.7,
0.9,
1.1,
false,
"auto",
1,
"randomize"
],
"color": "#374445",
"bgcolor": "#474539"
},
{
"id": 24,
"type": "AILab_QwenVL_PromptEnhancer",
"pos": [
1453.109231969312,
1103.0165621245635
],
"size": [
340,
454
],
"flags": {},
"order": 4,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "ENHANCED_OUTPUT",
"type": "STRING",
"links": null
}
],
"properties": {
"ue_properties": {
"widget_ue_connectable": {},
"input_ue_unconnectable": {}
},
"Node name for S&R": "AILab_QwenVL_PromptEnhancer"
},
"widgets_values": [
"Qwen3-0.6B",
"None (FP16)",
"auto",
false,
"auto",
"",
"📝 Enhance",
"",
256,
0.7,
0.9,
1.1,
true,
1,
"randomize"
],
"color": "#374445",
"bgcolor": "#474539"
},
{
"id": 25,
"type": "AILab_QwenVL_GGUF",
"pos": [
728.3779414208888,
541.3632089660127
],
"size": [
340,
252
],
"flags": {},
"order": 5,
"mode": 0,
"inputs": [
{
"name": "image",
"shape": 7,
"type": "IMAGE",
"link": null
},
{
"name": "video",
"shape": 7,
"type": "IMAGE",
"link": null
}
],
"outputs": [
{
"name": "RESPONSE",
"type": "STRING",
"links": null
}
],
"properties": {
"ue_properties": {
"widget_ue_connectable": {},
"input_ue_unconnectable": {}
},
"Node name for S&R": "AILab_QwenVL_GGUF"
},
"widgets_values": [
"Qwen3-VL-4B-Thinking-Q4_K_M (bartowski)",
"🖼️ Detailed Description",
"",
512,
true,
1,
"randomize"
],
"color": "#474539",
"bgcolor": "#2c4045"
}
],
"links": [],
"groups": [],
"config": {},
"extra": {
"workflowRendererVersion": "LG",
"ue_links": [],
"ds": {
"scale": 0.8334122337245743,
"offset": [
-262.4276486336808,
-189.67302442340656
]
},
"frontendVersion": "1.34.9",
"VHS_latentpreview": false,
"VHS_latentpreviewrate": 0,
"VHS_MetadataImage": true,
"VHS_KeepIntermediate": true
},
"version": 0.4
}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288{
"base_dir": "LLM/GGUF",
"Qwen_model": {
"Qwen3-4B-abliterated-GGUF": {
"author": "mradermacher",
"repo_name": "Qwen3-4B-abliterated-GGUF",
"repo_id": "mradermacher/Qwen3-4B-abliterated-GGUF",
"model_files": [
"Qwen3-4B-abliterated.Q4_K_M.gguf",
"Qwen3-4B-abliterated.Q5_K_M.gguf",
"Qwen3-4B-abliterated.Q6_K.gguf",
"Qwen3-4B-abliterated.Q8_0.gguf",
"Qwen3-4B-abliterated.f16.gguf"
],
"defaults": {
"context_length": 32768
}
},
"Josiefied-Qwen3-4B-abliterated-v1-GGUF": {
"author": "mradermacher",
"repo_name": "Josiefied-Qwen3-4B-abliterated-v1-GGUF",
"repo_id": "mradermacher/Josiefied-Qwen3-4B-abliterated-v1-GGUF",
"model_files": [
"Josiefied-Qwen3-4B-abliterated-v1.Q4_K_M.gguf",
"Josiefied-Qwen3-4B-abliterated-v1.Q5_K_M.gguf",
"Josiefied-Qwen3-4B-abliterated-v1.Q6_K.gguf",
"Josiefied-Qwen3-4B-abliterated-v1.Q8_0.gguf",
"Josiefied-Qwen3-4B-abliterated-v1.f16.gguf"
],
"defaults": {
"context_length": 32768
}
},
"Josiefied-Qwen3-8B-abliterated-v1-GGUF": {
"author": "mradermacher",
"repo_name": "Josiefied-Qwen3-8B-abliterated-v1-GGUF",
"repo_id": "mradermacher/Josiefied-Qwen3-8B-abliterated-v1-GGUF",
"model_files": [
"Josiefied-Qwen3-8B-abliterated-v1.Q4_K_M.gguf",
"Josiefied-Qwen3-8B-abliterated-v1.Q5_K_M.gguf",
"Josiefied-Qwen3-8B-abliterated-v1.Q6_K.gguf",
"Josiefied-Qwen3-8B-abliterated-v1.Q8_0.gguf",
"Josiefied-Qwen3-8B-abliterated-v1.f16.gguf"
],
"defaults": {
"context_length": 32768
}
},
"Qwen3-VL-4B-Instruct-c_abliterated-v2-GGUF": {
"author": "mradermacher",
"repo_name": "Qwen3-VL-4B-Instruct-c_abliterated-v2-GGUF",
"repo_id": "mradermacher/Qwen3-VL-4B-Instruct-c_abliterated-v2-GGUF",
"model_files": [
"Qwen3-VL-4B-Instruct-c_abliterated-v2.Q4_K_M.gguf",
"Qwen3-VL-4B-Instruct-c_abliterated-v2.Q5_K_M.gguf",
"Qwen3-VL-4B-Instruct-c_abliterated-v2.Q6_K.gguf",
"Qwen3-VL-4B-Instruct-c_abliterated-v2.Q8_0.gguf",
"Qwen3-VL-4B-Instruct-c_abliterated-v2.f16.gguf"
],
"defaults": {
"context_length": 32768
}
},
"Qwen3-VL-8B-Instruct-c_abliterated-v3-GGUF": {
"author": "mradermacher",
"repo_name": "Qwen3-VL-8B-Instruct-c_abliterated-v3-GGUF",
"repo_id": "mradermacher/Qwen3-VL-8B-Instruct-c_abliterated-v3-GGUF",
"model_files": [
"Qwen3-VL-8B-Instruct-c_abliterated-v3.Q4_K_M.gguf",
"Qwen3-VL-8B-Instruct-c_abliterated-v3.Q5_K_M.gguf",
"Qwen3-VL-8B-Instruct-c_abliterated-v3.Q6_K.gguf",
"Qwen3-VL-8B-Instruct-c_abliterated-v3.Q8_0.gguf",
"Qwen3-VL-8B-Instruct-c_abliterated-v3.f16.gguf"
],
"defaults": {
"context_length": 65536
}
},
"Josiefied-Qwen3-4B-Instruct-2507-gabliterated-v1-GGUF": {
"author": "DevQuasar",
"repo_name": "Josiefied-Qwen3-4B-Instruct-2507-gabliterated-v1-GGUF",
"repo_id": "DevQuasar/Goekdeniz-Guelmez.Josiefied-Qwen3-4B-Instruct-2507-gabliterated-v1-GGUF",
"model_files": [
"Goekdeniz-Guelmez.Josiefied-Qwen3-4B-Instruct-2507-gabliterated-v1.Q4_K_M.gguf",
"Goekdeniz-Guelmez.Josiefied-Qwen3-4B-Instruct-2507-gabliterated-v1.Q5_K_M.gguf",
"Goekdeniz-Guelmez.Josiefied-Qwen3-4B-Instruct-2507-gabliterated-v1.Q6_K.gguf",
"Goekdeniz-Guelmez.Josiefied-Qwen3-4B-Instruct-2507-gabliterated-v1.Q8_0.gguf",
"Goekdeniz-Guelmez.Josiefied-Qwen3-4B-Instruct-2507-gabliterated-v1.f16.gguf"
],
"defaults": {
"context_length": 32768
}
},
"Qwen3-4B-GGUF": {
"author": "Qwen",
"repo_name": "Qwen3-4B-GGUF",
"repo_id": "Qwen/Qwen3-4B-GGUF",
"model_files": [
"Qwen3-4B-Q4_K_M.gguf",
"Qwen3-4B-Q5_K_M.gguf",
"Qwen3-4B-Q6_K.gguf",
"Qwen3-4B-Q8_0.gguf",
"Qwen3-4B-F16.gguf"
],
"defaults": {
"context_length": 32768
}
},
"Qwen3-4B-Instruct-GGUF": {
"author": "Qwen",
"repo_name": "Qwen3-4B-Instruct-GGUF",
"repo_id": "Qwen/Qwen3-4B-Instruct-GGUF",
"model_files": [
"Qwen3-4B-Instruct-Q4_K_M.gguf",
"Qwen3-4B-Instruct-Q5_K_M.gguf",
"Qwen3-4B-Instruct-Q6_K.gguf",
"Qwen3-4B-Instruct-Q8_0.gguf",
"Qwen3-4B-Instruct-F16.gguf"
],
"defaults": {
"context_length": 32768
}
},
"Qwen3-8B-Instruct-GGUF": {
"author": "Qwen",
"repo_name": "Qwen3-8B-Instruct-GGUF",
"repo_id": "Qwen/Qwen3-8B-Instruct-GGUF",
"model_files": [
"Qwen3-8B-Instruct-Q4_K_M.gguf",
"Qwen3-8B-Instruct-Q5_K_M.gguf",
"Qwen3-8B-Instruct-Q6_K.gguf",
"Qwen3-8B-Instruct-Q8_0.gguf",
"Qwen3-8B-Instruct-F16.gguf"
],
"defaults": {
"context_length": 32768
}
}
},
"qwenVL_model": {
"Qwen3-VL-4B-Instruct-c_abliterated-v2-GGUF": {
"author": "mradermacher",
"repo_name": "Qwen3-VL-4B-Instruct-c_abliterated-v2-GGUF",
"repo_id": "mradermacher/Qwen3-VL-4B-Instruct-c_abliterated-v2-GGUF",
"mmproj_file": "Qwen3-VL-4B-Instruct-c_abliterated-v2.mmproj-f16.gguf",
"model_files": [
"Qwen3-VL-4B-Instruct-c_abliterated-v2.Q4_K_M.gguf",
"Qwen3-VL-4B-Instruct-c_abliterated-v2.Q5_K_M.gguf",
"Qwen3-VL-4B-Instruct-c_abliterated-v2.Q6_K.gguf",
"Qwen3-VL-4B-Instruct-c_abliterated-v2.Q8_0.gguf",
"Qwen3-VL-4B-Instruct-c_abliterated-v2.f16.gguf"
],
"defaults": {
"context_length": 32768,
"image_max_tokens": 4096,
"n_batch": 512,
"gpu_layers": -1,
"top_k": 0,
"pool_size": 4194304
}
},
"Qwen3-VL-8B-Instruct-c_abliterated-v3-GGUF": {
"author": "mradermacher",
"repo_name": "Qwen3-VL-8B-Instruct-c_abliterated-v3-GGUF",
"repo_id": "mradermacher/Qwen3-VL-8B-Instruct-c_abliterated-v3-GGUF",
"mmproj_file": "Qwen3-VL-8B-Instruct-c_abliterated-v3.mmproj-f16.gguf",
"model_files": [
"Qwen3-VL-8B-Instruct-c_abliterated-v3.Q4_K_M.gguf",
"Qwen3-VL-8B-Instruct-c_abliterated-v3.Q5_K_M.gguf",
"Qwen3-VL-8B-Instruct-c_abliterated-v3.Q6_K.gguf",
"Qwen3-VL-8B-Instruct-c_abliterated-v3.Q8_0.gguf",
"Qwen3-VL-8B-Instruct-c_abliterated-v3.f16.gguf"
],
"defaults": {
"context_length": 65536,
"image_max_tokens": 4096,
"n_batch": 512,
"gpu_layers": -1,
"top_k": 0,
"pool_size": 4194304
}
},
"Qwen3-VL-32B-Heretic-v2-GGUF": {
"author": "mradermacher",
"repo_name": "Qwen3-VL-32B-Heretic-v2-GGUF",
"repo_id": "mradermacher/Qwen3-VL-32B-Heretic-v2-GGUF",
"mmproj_file": "Qwen3-VL-32B-Heretic-v2.mmproj-f16.gguf",
"model_files": [
"Qwen3-VL-32B-Heretic-v2.Q4_K_M.gguf",
"Qwen3-VL-32B-Heretic-v2.Q5_K_M.gguf",
"Qwen3-VL-32B-Heretic-v2.Q6_K.gguf",
"Qwen3-VL-32B-Heretic-v2.Q8_0.gguf"
],
"defaults": {
"context_length": 32768,
"image_max_tokens": 4096,
"n_batch": 512,
"gpu_layers": -1,
"top_k": 0,
"pool_size": 4194304
}
},
"Qwen3-VL-4B-Instruct-GGUF": {
"author": "Qwen",
"repo_name": "Qwen3-VL-4B-Instruct-GGUF",
"repo_id": "Qwen/Qwen3-VL-4B-Instruct-GGUF",
"mmproj_file": "mmproj-Qwen3VL-4B-Instruct-F16.gguf",
"model_files": [
"Qwen3VL-4B-Instruct-Q4_K_M.gguf",
"Qwen3-VL-4B-Instruct-Q5_K_M.gguf",
"Qwen3-VL-4B-Instruct-Q6_K.gguf",
"Qwen3VL-4B-Instruct-Q8_0.gguf",
"Qwen3VL-4B-Instruct-F16.gguf"
],
"defaults": {
"context_length": 32768,
"image_max_tokens": 4096,
"n_batch": 512,
"gpu_layers": -1,
"top_k": 0,
"pool_size": 4194304
}
},
"Qwen3-VL-8B-Instruct-GGUF": {
"author": "Qwen",
"repo_name": "Qwen3-VL-8B-Instruct-GGUF",
"repo_id": "Qwen/Qwen3-VL-8B-Instruct-GGUF",
"mmproj_file": "mmproj-Qwen3VL-8B-Instruct-F16.gguf",
"model_files": [
"Qwen3VL-8B-Instruct-Q4_K_M.gguf",
"Qwen3-VL-8B-Instruct-Q5_K_M.gguf",
"Qwen3-VL-8B-Instruct-Q6_K.gguf",
"Qwen3VL-8B-Instruct-Q8_0.gguf",
"Qwen3VL-8B-Instruct-F16.gguf"
],
"defaults": {
"context_length": 32768,
"image_max_tokens": 4096,
"n_batch": 512,
"gpu_layers": -1,
"top_k": 0,
"pool_size": 4194304
}
},
"Qwen3-VL-4B-Thinking-GGUF": {
"author": "Qwen",
"repo_name": "Qwen3-VL-4B-Thinking-GGUF",
"repo_id": "Qwen/Qwen3-VL-4B-Thinking-GGUF",
"mmproj_file": "mmproj-Qwen3VL-4B-Thinking-F16.gguf",
"model_files": [
"Qwen3VL-4B-Thinking-Q4_K_M.gguf",
"Qwen3-VL-4B-Thinking-Q5_K_M.gguf",
"Qwen3-VL-4B-Thinking-Q6_K.gguf",
"Qwen3VL-4B-Thinking-Q8_0.gguf",
"Qwen3VL-4B-Thinking-F16.gguf"
],
"defaults": {
"context_length": 32768,
"image_max_tokens": 4096,
"n_batch": 512,
"gpu_layers": -1,
"top_k": 0,
"pool_size": 4194304
}
},
"Qwen3-VL-8B-Thinking-GGUF": {
"author": "Qwen",
"repo_name": "Qwen3-VL-8B-Thinking-GGUF",
"repo_id": "Qwen/Qwen3-VL-8B-Thinking-GGUF",
"mmproj_file": "mmproj-Qwen3VL-8B-Thinking-F16.gguf",
"model_files": [
"Qwen3VL-8B-Thinking-Q4_K_M.gguf",
"Qwen3-VL-8B-Thinking-Q5_K_M.gguf",
"Qwen3-VL-8B-Thinking-Q6_K.gguf",
"Qwen3VL-8B-Thinking-Q8_0.gguf",
"Qwen3VL-8B-Thinking-F16.gguf"
],
"defaults": {
"context_length": 32768,
"image_max_tokens": 4096,
"n_batch": 512,
"gpu_layers": -1,
"top_k": 0,
"pool_size": 4194304
}
}
}
}123456789101112131415# GGUF backend requirements (vision-capable llama-cpp-python).
# Follow the platform-specific install guide:
# docs/LLAMA_CPP_PYTHON_VISION_INSTALL.md
#
# Linux (CUDA) example:
# pip install --upgrade --force-reinstall --no-cache-dir \
# llama-cpp-python==<version> --extra-index-url <vision-wheel-index>
#
# Windows example:
# 1) Install a vision-capable wheel from the guide.
# 2) Then verify with:
# python -c "import llama_cpp; print(llama_cpp.__version__)"
#
# Placeholder only; do not rely on this line alone:
# llama-cpp-python123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101{
"hf_vl_models": {
"Qwen3-VL-4B-Instruct-Abliterated": {
"repo_id": "huihui-ai/Huihui-Qwen3-VL-4B-Instruct-abliterated",
"default": true,
"quantized": true,
"vram_requirement": {
"full": 6.0,
"8bit": 3.5,
"4bit": 2.0
}
},
"Qwen3-VL-8B-Instruct-Abliterated": {
"repo_id": "huihui-ai/Huihui-Qwen3-VL-8B-Instruct-abliterated",
"default": false,
"quantized": true,
"vram_requirement": {
"full": 12.0,
"8bit": 7.0,
"4bit": 4.5
}
},
"Qwen3-VL-4B-Instruct-Unredacted-MAX": {
"repo_id": "prithivMLmods/Qwen3-VL-4B-Instruct-Unredacted-MAX",
"default": false,
"quantized": false,
"vram_requirement": {
"full": 6.0,
"8bit": 3.5,
"4bit": 2.0
}
},
"Qwen3-VL-8B-Instruct-Unredacted-MAX": {
"repo_id": "prithivMLmods/Qwen3-VL-8B-Instruct-Unredacted-MAX",
"default": false,
"quantized": false,
"vram_requirement": {
"full": 12.0,
"8bit": 7.0,
"4bit": 4.5
}
},
"Qwen3-VL-8B-Instruct-abliterated-v1": {
"repo_id": "prithivMLmods/Qwen3-VL-8B-Instruct-abliterated-v1",
"default": false,
"quantized": false,
"vram_requirement": {
"full": 12.0,
"8bit": 7.0,
"4bit": 4.5
}
},
"Qwen3-VL-4B-Instruct-abliterated-v1": {
"repo_id": "prithivMLmods/Qwen3-VL-4B-Instruct-abliterated-v1",
"default": false,
"quantized": false,
"vram_requirement": {
"full": 6.0,
"8bit": 3.5,
"4bit": 2.0
}
},
"Qwen3-VL-32B-Heretic-v2": {
"repo_id": "rpDungeon/Qwen3-VL-32B-Heretic-v2",
"default": false,
"quantized": false,
"vram_requirement": {
"full": 48.0,
"8bit": 28.0,
"4bit": 16.0
}
}
},
"hf_text_models": {
"Qwen3-VL-4B-Instruct-Abliterated": {
"repo_id": "huihui-ai/Huihui-Qwen3-VL-4B-Instruct-abliterated",
"default": true,
"quantized": true,
"vram_requirement": {
"full": 6.0,
"8bit": 3.5,
"4bit": 2.0
}
},
"Qwen3-VL-8B-Instruct-Abliterated": {
"repo_id": "huihui-ai/Huihui-Qwen3-VL-8B-Instruct-abliterated",
"default": false,
"quantized": true,
"vram_requirement": {
"full": 12.0,
"8bit": 7.0,
"4bit": 4.5
}
},
"qwen3-4b-Z-Image-Engineer": {
"repo_id": "BennyDaBall/qwen3-4b-Z-Image-Engineer",
"default": false,
"quantized": false
}
}
}12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485"""
Custom node for splitting WAN 2.2 Story prompts
Handles various separators automatically
"""
class StorySplitNode:
"""
Splits WAN 2.2 Story output into 4 separate prompts
Handles different separators: \n, \n\n, \n\n\n
"""
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"text": ("STRING", {"multiline": True, "default": ""}),
},
"optional": {
"auto_split": ("BOOLEAN", {"default": True}),
"custom_delimiter": ("STRING", {"multiline": False, "default": ""}),
}
}
RETURN_TYPES = ("STRING", "STRING", "STRING", "STRING", "STRING")
RETURN_NAMES = ("prompt_1", "prompt_2", "prompt_3", "prompt_4", "debug_info")
FUNCTION = "split_story"
CATEGORY = "🔷 QwenVL-Mod/Utils"
def split_story(self, text, auto_split=True, custom_delimiter=""):
"""
Split story text into 4 prompts
"""
if not text:
return ("", "", "", "", "Empty input")
text = text.strip()
if auto_split and not custom_delimiter:
# Try different separators automatically
if '\n\n\n' in text:
prompts = text.split('\n\n\n')
elif '\n\n' in text:
prompts = text.split('\n\n')
elif '\n' in text:
prompts = text.split('\n')
else:
# No clear separator, split by paragraphs
prompts = [p for p in text.split('\n') if p.strip()]
else:
# Use custom delimiter
delimiter = custom_delimiter if custom_delimiter else '\n\n'
prompts = text.split(delimiter)
# Clean up prompts
clean_prompts = []
for prompt in prompts:
clean_prompt = prompt.strip()
if clean_prompt and not clean_prompt.startswith("Prompt") and "content describing" not in clean_prompt:
clean_prompts.append(clean_prompt)
# Ensure we have exactly 4 prompts
while len(clean_prompts) < 4:
clean_prompts.append("")
result_prompts = clean_prompts[:4]
# Debug info
debug = f"Found {len(prompts)} parts, cleaned to {len(clean_prompts)} prompts"
return (
result_prompts[0],
result_prompts[1],
result_prompts[2],
result_prompts[3],
debug
)
# Node mapping for ComfyUI
NODE_CLASS_MAPPINGS = {
"StorySplitNode": StorySplitNode
}
NODE_DISPLAY_NAME_MAPPINGS = {
"StorySplitNode": "Story Split Node"
}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168#!/usr/bin/env python3
"""
ComfyUI VRAM Cleanup Node
Generic VRAM cleanup for preventing memory issues in workflows
"""
import gc
import torch
import folder_paths
from comfy import model_management
class VRAMCleanup:
"""
Generic VRAM cleanup node for preventing memory issues in workflows
Prevents memory accumulation and crashes in multi-model workflows
"""
def __init__(self):
pass
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"input": ("*",), # Any input to allow connection
"cleanup_mode": ([
"Cache Only",
"Text Encoder",
"Full Cleanup",
"T2V + QwenVL Fix"
], {"default": "Cache Only"}),
}
}
RETURN_TYPES = ("*",) # Pass through the input
RETURN_NAMES = ("output",)
FUNCTION = "cleanup_vram_memory"
CATEGORY = "🔷 QwenVL-Mod/Utils"
OUTPUT_NODE = True
def cleanup_vram_memory(self, input, cleanup_mode):
"""
Generic VRAM cleanup for preventing memory issues in workflows
"""
try:
print(f"🧹 VRAM Cleanup: Starting {cleanup_mode} cleanup...")
# Get current memory state
if torch.cuda.is_available():
initial_memory = torch.cuda.memory_allocated()
print(f"📊 Initial VRAM: {initial_memory / 1024**3:.2f} GB")
# Mode-specific cleanup
if cleanup_mode == "Cache Only":
self._cache_only()
elif cleanup_mode == "Text Encoder":
self._text_encoder()
elif cleanup_mode == "Full Cleanup":
self._full_cleanup()
elif cleanup_mode == "T2V + QwenVL Fix":
self._t2v_qwen_fix()
# Report final memory state
if torch.cuda.is_available():
final_memory = torch.cuda.memory_allocated()
freed_memory = initial_memory - final_memory
print(f"📉 Final VRAM: {final_memory / 1024**3:.2f} GB")
print(f"💾 Freed: {freed_memory / 1024**3:.2f} GB")
print("✅ VRAM Cleanup completed successfully!")
except Exception as e:
print(f"❌ VRAM Cleanup failed: {str(e)}")
raise e
return (input,) # Pass through the input
def _cache_only(self):
"""Simple cache cleanup only"""
try:
if torch.cuda.is_available():
torch.cuda.empty_cache()
print(" Cache cleared")
except Exception as e:
print(f"⚠️ Cache cleanup warning: {e}")
def _text_encoder(self):
"""Targeted cleanup for WAN text encoder"""
try:
if torch.cuda.is_available():
for i in range(3):
torch.cuda.empty_cache()
if i == 1:
torch.cuda.synchronize()
print(f" Text encoder clear {i+1}/3")
print(" Text encoder cleanup completed")
except Exception as e:
print(f"⚠️ Text encoder cleanup warning: {e}")
def _full_cleanup(self):
"""Complete cleanup - unload all models"""
try:
if torch.cuda.is_available():
try:
print(" Attempting full model unload...")
model_management.unload_all_models()
print(" All models unloaded successfully")
except Exception as unload_error:
print(f" Model unload failed: {unload_error}")
print(" Continuing with cache cleanup only...")
for _ in range(5):
torch.cuda.empty_cache()
torch.cuda.synchronize()
gc.collect()
print(" Full cleanup completed")
except Exception as e:
print(f"⚠️ Full cleanup warning: {e}")
def _t2v_qwen_fix(self):
"""Special fix for T2V + QwenVL conflict - uses Easy Use method"""
try:
if torch.cuda.is_available():
try:
print(" Attempting model unload (Easy Use method)...")
model_management.unload_all_models()
print(" Models unloaded successfully")
except Exception as unload_error:
print(f" Model unload failed: {unload_error}")
print(" Continuing with cache cleanup only...")
for i in range(3):
torch.cuda.empty_cache()
if i == 1:
torch.cuda.synchronize()
print(f" T2V residue clear {i+1}/3")
try:
temp_tensor = torch.randn(1500, 1500, device='cuda')
del temp_tensor
torch.cuda.empty_cache()
torch.cuda.synchronize()
print(" Memory pressure applied")
except:
pass
torch.cuda.synchronize()
gc.collect()
print(" T2V + QwenVL fix completed")
except Exception as e:
print(f"⚠️ T2V + QwenVL fix warning: {e}")
# Register the node
NODE_CLASS_MAPPINGS = {
"VRAMCleanup": VRAMCleanup
}
NODE_DISPLAY_NAME_MAPPINGS = {
"VRAMCleanup": "VRAM Cleanup"
}
__all__ = ['NODE_CLASS_MAPPINGS', 'NODE_DISPLAY_NAME_MAPPINGS']123456789101112131415[project]
name = "ComfyUI-QwenVL-Mod"
description = "Enhanced QwenVL node with WAN 2.2 workflows, multilingual support, visual style detection, smart prompt caching, and GGUF backend for professional video generation and multimodal AI."
version = "2.2.3"
license = {file = "LICENSE"}
dependencies = ["transformers", "torch", "huggingface-hub", "hf_xet", "psutil", "numpy", "Pillow", "opencv-python", "bitsandbytes", "accelerate", "llama-cpp-python"]
[project.urls]
Repository = "https://github.com/huchukato/ComfyUI-QwenVL-Mod"
[tool.comfy]
PublisherId = "huchukato"
DisplayName = "ComfyUI-QwenVL-Mod"
Icon = ""
Category = "video"1234567891011121314151617181920212223# ComfyUI-QwenVL requirements
# Note: Qwen3-VL models require transformers >= 4.57.0
transformers
torch
huggingface-hub
hf_xet
psutil
numpy
Pillow
opencv-python
bitsandbytes
accelerate
# For running GGUF models with vision support
# The [server] extra installs necessary components for multimodal models
# llama-cpp-python[server]
# Optional: Flash Attention 2 for 2-3x performance boost (RTX 20+)
# flash-attn>=2.0.0 # Uncomment for Flash Attention 2 support
# Optional: SageAttention for 2-5x performance boost (RTX 30+)
# sageattention>=1.0.0 # Uncomment for SageAttention support123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103# Git
.git
.gitignore
.gitattributes
# Documentation
*.md
docs/
# Python
__pycache__
*.pyc
*.pyo
*.pyd
.Python
env/
pip-log.txt
pip-delete-this-directory.txt
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.log
.git
.mypy_cache
.pytest_cache
.hypothesis
# Virtual environments
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# IDE
.vscode/
.idea/
*.swp
*.swo
*~
# OS
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
# ComfyUI
models/*
!models/.gitkeep
output/*
!output/.gitkeep
input/*
!input/.gitkeep
temp/*
!temp/.gitkeep
# Large files
*.h5
*.pkl
*.pth
*.ckpt
*.safetensors
*.bin
*.pt
# Logs
*.log
logs/
# Test files
test/
tests/
*.test.py
# Build artifacts
build/
dist/
*.egg-info/
# Cache
.cache/
cache/
# Node modules (if any)
node_modules/
# Environment files
.env
.env.local
.env.*.local
# Docker
.dockerignore
docker-compose.override.yml12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879# Build Scripts - Docker Images
## 📁 Script Files
### 🏗️ Local Build Scripts (Public)
For users who want to build and run ComfyUI locally:
- **`build-local-5090.sh`** - Build RTX 5090 image locally
- **`build-local-4090.sh`** - Build RTX 4090 image locally
**Usage:**
```bash
./build-local-5090.sh # RTX 5090 (CUDA 12.8)
./build-local-4090.sh # RTX 4090 (CUDA 12.4)
```
**Output:** Local Docker images (`comfyui-qwenvl-local:5090` / `comfyui-qwenvl-local:4090`)
### 🔐 Private Build Scripts (Maintainer Only)
For repository maintainer to build and push to Docker Hub:
- **`build-and-push-5090-private.sh`** - Build & push RTX 5090 to Docker Hub
- **`build-and-push-4090-private.sh`** - Build & push RTX 4090 to Docker Hub
**Usage:** (Maintainer only)
```bash
./build-and-push-5090-private.sh # Push to huchukato/comfyui-qwenvl-runpod
./build-and-push-4090-private.sh # Push to huchukato/comfyui-qwenvl-runpod-4090
```
## 🎯 Why This Separation?
### ✅ Benefits:
- **Security**: Only maintainer can push to Docker Hub
- **Clarity**: Users know exactly what scripts do
- **Functionality**: Everyone can use Docker locally
- **No Confusion**: Clear distinction between local vs production builds
### 🚀 For Users:
- Use `build-local-*.sh` for local Docker development
- Use pre-built images from Docker Hub for RunPod deployment
### 🔐 For Maintainer:
- Use `build-and-push-*-private.sh` for production builds
- Private scripts are NOT committed to public repository
## 📦 Docker Hub Images
### Production Images (Ready for RunPod):
- **RTX 5090**: `huchukato/comfyui-qwenvl-runpod:latest`
- **RTX 4090**: `huchukato/comfyui-qwenvl-runpod-4090:latest`
### Local Images (For Development):
- **RTX 5090**: `comfyui-qwenvl-local:5090`
- **RTX 4090**: `comfyui-qwenvl-local:4090`
## 🐳 Local Docker Run
After building locally:
```bash
# RTX 5090
docker run -d --gpus all \
-p 8080:8080 -p 8888:8888 -p 8188:8188 \
-v $(pwd)/output:/ComfyUI/output \
comfyui-qwenvl-local:5090
# RTX 4090
docker run -d --gpus all \
-p 8080:8080 -p 8888:8888 -p 8188:8188 \
-v $(pwd)/output:/ComfyUI/output \
comfyui-qwenvl-local:4090
```
## 📋 Port Mappings
- **8080** → FileBrowser
- **8888** → JupyterLab (Terminal included)
- **8188** → ComfyUI123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418# ComfyUI-QwenVL-Mod RunPod Worker
# Enhanced with WAN 2.2 workflows, multilingual support, and GGUF backend
# Optimized for RTX 5090 and professional video generation
FROM nvidia/cuda:12.8.0-cudnn-devel-ubuntu24.04
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
ENV IMAGEIO_FFMPEG_EXE=/usr/bin/ffmpeg
ENV PYTHONUNBUFFERED=1
ENV CUDA_HOME=/usr/local/cuda
ENV PATH=$PATH:$CUDA_HOME/bin
ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64
# Install system dependencies (CUDA already included in base image)
RUN apt update && \
apt install -y --no-install-recommends \
git \
make \
wget \
curl \
unzip \
pkg-config \
ca-certificates \
build-essential \
python3.12 \
python3.12-venv \
python3.12-dev \
python3-pip \
libglx-mesa0 \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender-dev \
libgomp1 \
ffmpeg \
openssh-server \
openssh-client \
&& apt clean \
&& rm -rf /var/lib/apt/lists/*
# Verify Python version
RUN python3.12 --version
# CUDA toolkit and cuDNN already included in nvidia/cuda base image
# Configure SSH for root login
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config && \
sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config && \
mkdir -p /run/sshd && \
rm -f /etc/ssh/ssh_host_*
# Create virtual environment to avoid externally-managed-environment error
RUN python3.12 -m venv /opt/comfyui-env && \
/opt/comfyui-env/bin/pip install --upgrade pip
# Install PyTorch with CUDA 12.8 (compatible with base image CUDA 12.8.0) - optimized for RTX 5090
RUN /opt/comfyui-env/bin/pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cu128 && \
/opt/comfyui-env/bin/pip cache purge
# Remove uv to force ComfyUI-Manager to use pip (uv doesn't respect --system-site-packages properly)
RUN pip uninstall -y uv 2>/dev/null || true && \
rm -f /usr/local/bin/uv /usr/local/bin/uvx
# Install ComfyUI latest stable version
WORKDIR /ComfyUI
RUN git clone https://github.com/comfyanonymous/ComfyUI.git . && \
/opt/comfyui-env/bin/pip install --no-cache-dir -r requirements.txt && \
/opt/comfyui-env/bin/pip install --no-cache-dir GitPython opencv-python && \
/opt/comfyui-env/bin/pip cache purge
# Install llama-cpp-python for GGUF support (CUDA 12.8 compatible with base image)
RUN /opt/comfyui-env/bin/pip install --upgrade --force-reinstall --no-cache-dir \
https://github.com/JamePeng/llama-cpp-python/releases/download/v0.3.34-cu128-Basic-linux-20260331/llama_cpp_python-0.3.34+cu128.basic-cp312-cp312-linux_x86_64.whl && \
/opt/comfyui-env/bin/pip cache purge
# Install ALL ComfyUI custom nodes from VastAI provisioning + RunpodDirect
RUN cd /ComfyUI/custom_nodes && \
git clone https://github.com/ltdrdata/ComfyUI-Manager.git && \
git clone https://github.com/kijai/ComfyUI_essentials.git && \
git clone https://github.com/huchukato/comfy-tagcomplete.git && \
git clone https://github.com/huchukato/ComfyUI-QwenVL-Mod.git && \
git clone https://github.com/huchukato/ComfyUI-RIFE-TensorRT-Auto.git && \
git clone https://github.com/huchukato/ComfyUI-Upscaler-TensorRT-Auto.git && \
git clone https://github.com/huchukato/ComfyUI-HuggingFace.git && \
git clone https://github.com/MadiatorLabs/ComfyUI-RunpodDirect.git && \
git clone https://github.com/city96/ComfyUI-GGUF.git && \
git clone https://github.com/MoonGoblinDev/Civicomfy.git && \
git clone https://github.com/Koishi-Star/Euler-Smea-Dyn-Sampler.git && \
git clone https://github.com/ltdrdata/was-node-suite-comfyui.git && \
git clone https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite.git && \
git clone https://github.com/rgthree/rgthree-comfy.git && \
git clone https://github.com/yolain/ComfyUI-Easy-Use.git && \
git clone https://github.com/kijai/ComfyUI-KJNodes.git && \
git clone https://github.com/Fannovel16/ComfyUI-Frame-Interpolation.git && \
git clone https://github.com/Smirnov75/ComfyUI-mxToolkit.git && \
git clone https://github.com/princepainter/ComfyUI-PainterI2V.git && \
git clone https://github.com/princepainter/ComfyUI-PainterLongVideo.git && \
git clone https://github.com/ashtar1984/comfyui-find-perfect-resolution.git && \
git clone https://github.com/huchukato/ComfyUI-Selectors.git && \
git clone https://github.com/kijai/ComfyUI-MMAudio.git && \
git clone https://github.com/GACLove/ComfyUI-VFI.git && \
git clone https://github.com/stduhpf/ComfyUI-WanMoeKSampler.git && \
git clone https://github.com/melMass/comfy_mtb.git
# Copy wildcards to Easy-Use (required for wildcard workflows)
RUN cp -r /ComfyUI/custom_nodes/comfy-tagcomplete/wildcards/mbe /ComfyUI/custom_nodes/ComfyUI-Easy-Use/wildcards || echo "Wildcards copy completed (or already exists)"
# Install requirements for all custom nodes
RUN bash -c 'cd /ComfyUI/custom_nodes && for node_dir in */; do if [ -f "$node_dir/requirements.txt" ]; then echo "Installing requirements for $node_dir..." && /opt/comfyui-env/bin/pip install --no-cache-dir -r "$node_dir/requirements.txt" || echo "Failed to install requirements for $node_dir"; fi; done' && \
/opt/comfyui-env/bin/pip cache purge
# Install additional essential dependencies
RUN /opt/comfyui-env/bin/pip install --no-cache-dir jupyter sageattention && \
/opt/comfyui-env/bin/pip cache purge
# Clean up heavy Git files to save space (keep repo structure for updates)
RUN find /ComfyUI/custom_nodes -name ".git" -type d -exec find {} -name "*.pack" -delete + || true && \
find /ComfyUI/custom_nodes -name ".git" -type d -exec find {} -name "pack-*.idx" -delete + || true && \
find /ComfyUI/custom_nodes -name ".git" -type d -exec find {} -name "objects" -type d -exec rm -rf {} + || true
# Create FileBrowser (RunPod method)
RUN curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash
# Create FileBrowser database and directories
RUN mkdir -p /filebrowser && \
mkdir -p /filebrowser/database && \
mkdir -p /filebrowser/files && \
ln -sf /ComfyUI /filebrowser/files/ComfyUI && \
echo '{"port": 8080, "baseURL": "", "address": "0.0.0.0", "log": "stdout", "database": "/filebrowser/database/filebrowser.db", "root": "/filebrowser/files", "noauth": true}' > /filebrowser/.config.json
# Create FileBrowser startup script
RUN echo '#!/bin/bash\n\
echo "�� Starting FileBrowser on port 8080"\n\
echo "�� Access at: http://0.0.0.0:8080"\n\
echo "�� No authentication required"\n\
echo ""\n\
cd /filebrowser\n\
filebrowser --config /filebrowser/.config.json\n\
' > /usr/local/bin/start-filebrowser.sh && chmod +x /usr/local/bin/start-filebrowser.sh
# Create Jupyter Lab startup script
RUN cat > /usr/local/bin/start-jupyter.sh << 'EOF'
#!/bin/bash
echo "📓 Starting Jupyter Lab on port 8888"
echo "🌐 Access at: http://0.0.0.0:8888"
echo "🔑 No token required"
echo ""
cd /ComfyUI
echo "🔧 Starting Jupyter Lab with terminal support..."
nohup /opt/comfyui-env/bin/jupyter lab \
--allow-root \
--no-browser \
--port=8888 \
--ip=0.0.0.0 \
--FileContentsManager.delete_to_trash=False \
--FileContentsManager.preferred_dir=/ComfyUI \
--ServerApp.root_dir=/ComfyUI \
--ServerApp.terminado_settings='{"shell_command":["/bin/bash"]}' \
--IdentityProvider.token="" \
--ServerApp.allow_origin=* &> /jupyter.log &
echo "✅ Jupyter Lab started"
echo "🔍 Checking Jupyter Lab status..."
sleep 5
if pgrep -f "jupyter lab" > /dev/null; then
echo "✅ Jupyter Lab started successfully"
echo "📊 Jupyter Lab logs:"
tail -10 /jupyter.log
else
echo "❌ Jupyter Lab failed to start"
echo "📊 Full error logs:"
cat /jupyter.log
echo "🔍 Checking what went wrong..."
echo "🐍 Python version in virtual env:"
/opt/comfyui-env/bin/python --version
echo "📦 Jupyter Lab version in virtual env:"
/opt/comfyui-env/bin/jupyter lab --version
fi
EOF
RUN chmod +x /usr/local/bin/start-jupyter.sh
# Create user directory structure
RUN mkdir -p /ComfyUI/user/default/workflows
# Create models directories
RUN mkdir -p /ComfyUI/models/vae && \
mkdir -p /ComfyUI/models/upscale_models && \
mkdir -p /ComfyUI/models/text_encoders
# Clean up heavy Git files to save space (keep repo structure for updates)
RUN find /ComfyUI/custom_nodes -name ".git" -type d -exec find {} -name "*.pack" -delete + || true && \
find /ComfyUI/custom_nodes -name ".git" -type d -exec find {} -name "pack-*.idx" -delete + || true && \
find /ComfyUI/custom_nodes -name ".git" -type d -exec find {} -name "objects" -type d -exec rm -rf {} + || true
# Aggressive cleanup to reduce image size
RUN rm -rf /tmp/* \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /var/cache/apt/archives/* \
&& find /ComfyUI -name "*.pyc" -delete \
&& find /ComfyUI -name "__pycache__" -type d -exec rm -rf {} + 2>/dev/null || true \
&& /opt/comfyui-env/bin/pip cache purge
# Set ComfyUI arguments (optimized for WAN2.2 with SageAttention)
ENV COMFYUI_ARGS="--listen 0.0.0.0 --port 8188 --disable-auto-launch --enable-cors-header --fast fp16_accumulation --use-sage-attention --reserve-vram 2 --cuda-malloc --async-offload"
# Create startup script (RunPod style with dynamic workflow updates)
RUN cat > /ComfyUI/start.sh << 'EOF'
#!/bin/bash
set -e # Exit the script if any statement returns a non-true return value
COMFYUI_DIR="/ComfyUI"
FILEBROWSER_CONFIG="/filebrowser/.config.json"
DB_FILE="/filebrowser/database/filebrowser.db"
# Function to update custom nodes
update_nodes() {
echo "🔄 Updating custom nodes..."
cd /ComfyUI/custom_nodes
# List of custom nodes to update
nodes=(
"https://github.com/ltdrdata/ComfyUI-Manager.git"
"https://github.com/kijai/ComfyUI_essentials.git"
"https://github.com/huchukato/comfy-tagcomplete.git"
"https://github.com/huchukato/ComfyUI-QwenVL-Mod.git"
"https://github.com/huchukato/ComfyUI-RIFE-TensorRT-Auto.git"
"https://github.com/huchukato/ComfyUI-Upscaler-TensorRT-Auto.git"
"https://github.com/huchukato/ComfyUI-HuggingFace.git"
"https://github.com/MadiatorLabs/ComfyUI-RunpodDirect.git"
"https://github.com/city96/ComfyUI-GGUF.git"
"https://github.com/MoonGoblinDev/Civicomfy.git"
"https://github.com/Koishi-Star/Euler-Smea-Dyn-Sampler.git"
"https://github.com/ltdrdata/was-node-suite-comfyui.git"
"https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite.git"
"https://github.com/rgthree/rgthree-comfy.git"
"https://github.com/yolain/ComfyUI-Easy-Use.git"
"https://github.com/kijai/ComfyUI-KJNodes.git"
"https://github.com/Fannovel16/ComfyUI-Frame-Interpolation.git"
"https://github.com/Smirnov75/ComfyUI-mxToolkit.git"
"https://github.com/princepainter/ComfyUI-PainterI2V.git"
"https://github.com/princepainter/ComfyUI-PainterLongVideo.git"
"https://github.com/ashtar1984/comfyui-find-perfect-resolution.git"
"https://github.com/huchukato/ComfyUI-Selectors.git"
"https://github.com/kijai/ComfyUI-MMAudio.git"
"https://github.com/GACLove/ComfyUI-VFI.git"
"https://github.com/stduhpf/ComfyUI-WanMoeKSampler.git"
"https://github.com/melMass/comfy_mtb.git"
)
for node_url in "${nodes[@]}"; do
node_name=$(basename "$node_url" .git)
if [ -d "$node_name" ]; then
echo " 🔄 Updating: $node_name"
cd "$node_name"
git pull origin main 2>/dev/null || git pull origin master 2>/dev/null || echo " ⚠️ Failed to update $node_name"
cd ..
else
echo " 📥 Installing: $node_name"
git clone "$node_url" || echo " ⚠️ Failed to clone $node_name"
fi
done
# Install requirements for updated nodes
echo "📦 Installing updated requirements..."
bash -c 'for node_dir in */; do if [ -f "$node_dir/requirements.txt" ]; then echo "Installing requirements for $node_dir..." && /opt/comfyui-env/bin/pip install --no-cache-dir -r "$node_dir/requirements.txt" || echo "Failed to install requirements for $node_dir"; fi; done'
echo "✅ Node update completed"
}
# Function to download latest workflows
update_workflows() {
echo "🔄 Updating workflows from latest versions..."
mkdir -p /ComfyUI/user/default/workflows
cd /ComfyUI/user/default/workflows
# List of latest workflows
workflows=(
"PMP-LoRaStack-Upscale-Wildcards.json"
"WAN2.2-I2V-AutoPrompt-Story.json"
"WAN2.2-T2V-I2V-AutoPrompt-Story.json"
"WAN2.2-I2V-SVI-AutoPrompt-Story.json"
"WAN2.2-I2V-AutoPrompt.json"
"WAN2.2-I2V-AutoPrompt-GGUF.json"
"WAN2.2-T2V-AutoPrompt.json"
"WAN2.2-T2V-AutoPrompt-GGUF.json"
"WAN2.2-I2V-SVI-AutoPrompt.json"
"WAN2.2-I2V-SVI-AutoPrompt-GGUF.json"
"WAN2.2-I2V-Full-AutoPrompt-MMAudio.json"
"WAN2.2-I2V-Full-AutoPrompt-MMAudio-GGUF.json"
"WAN2.2-T2V-I2V-Full-AutoPrompt-MMAudio-GGUF.json"
)
for workflow in "${workflows[@]}"; do
echo " 📥 Downloading: $workflow"
wget -q "https://github.com/huchukato/ComfyUI-QwenVL-Mod/raw/main/vastai/workflows/$workflow" -O "$workflow" || echo " ⚠️ Failed to download $workflow"
done
echo "✅ Workflow update completed"
}
download_models() {
echo "🔄 Downloading essential models..."
cd /ComfyUI
# Download VAE models
if [ ! -f "/ComfyUI/models/vae/wan_2.1_vae.safetensors" ]; then
echo " 📥 Downloading WAN 2.1 VAE..."
wget -q "https://huggingface.co/Comfy-Org/Wan_2.2_ComfyUI_Repackaged/resolve/main/split_files/vae/wan_2.1_vae.safetensors" -O "/ComfyUI/models/vae/wan_2.1_vae.safetensors" || echo " ⚠️ Failed to download WAN 2.1 VAE"
fi
if [ ! -f "/ComfyUI/models/vae/sdxl_vae.safetensors" ]; then
echo " 📥 Downloading SDXL VAE..."
wget -q "https://huggingface.co/huchukato/favs/resolve/main/VAE/sdxl.vae.safetensors" -O "/ComfyUI/models/vae/sdxl_vae.safetensors" || echo " ⚠️ Failed to download SDXL VAE"
fi
# Download upscale models
if [ ! -f "/ComfyUI/models/upscale_models/2xLexicaRRDBNet.pth" ]; then
echo " 📥 Downloading 2xLexicaRRDBNet upscale model..."
wget -q "https://huggingface.co/huchukato/favs/resolve/main/ESRGAN/2xLexicaRRDBNet.pth" -O "/ComfyUI/models/upscale_models/2xLexicaRRDBNet.pth" || echo " ⚠️ Failed to download upscale model"
fi
if [ ! -f "/ComfyUI/models/upscale_models/2xLexicaRRDBNet_Sharp.pth" ]; then
echo " 📥 Downloading 2xLexicaRRDBNet Sharp upscale model..."
wget -q "https://huggingface.co/huchukato/favs/resolve/main/ESRGAN/2xLexicaRRDBNet_Sharp.pth" -O "/ComfyUI/models/upscale_models/2xLexicaRRDBNet_Sharp.pth" || echo " ⚠️ Failed to download Sharp upscale model"
fi
# Download text encoder
if [ ! -f "/ComfyUI/models/text_encoders/nsfw_wan_umt5-xxl_fp8_scaled.safetensors" ]; then
echo " 📥 Downloading NSFW WAN UMT5-XXL text encoder..."
wget -q "https://huggingface.co/NSFW-API/NSFW-Wan-UMT5-XXL/resolve/main/nsfw_wan_umt5-xxl_fp8_scaled.safetensors" -O "/ComfyUI/models/text_encoders/nsfw_wan_umt5-xxl_fp8_scaled.safetensors" || echo " ⚠️ Failed to download text encoder"
fi
echo "✅ Model download completed"
echo "📋 Available models:"
ls -la /ComfyUI/models/vae/
ls -la /ComfyUI/models/upscale_models/
ls -la /ComfyUI/models/text_encoders/
}
echo "🚀 Starting ComfyUI-QwenVL-Mod on RunPod (Full Version)"
echo "🎬 WAN 2.2 workflows ready"
echo "🌐 Multilingual support enabled"
echo "🎨 Visual style detection ready"
echo "⚡ GGUF backend optimized"
echo ""
# Update workflows to latest versions
update_workflows
# Update custom nodes to latest versions
update_nodes
# Download essential models
download_models
echo "🔧 Services starting:"
echo "📁 FileBrowser: http://0.0.0.0:8080"
echo "📓 Jupyter Lab: http://0.0.0.0:8888 (Terminal included)"
echo "🎨 ComfyUI: http://0.0.0.0:8188"
echo "📋 Available workflows:"
ls -la /ComfyUI/user/default/workflows/
echo ""
echo "💡 Models pre-loaded for immediate use"
echo ""
# Start FileBrowser
echo "🔧 Starting FileBrowser..."
nohup /usr/local/bin/start-filebrowser.sh &> /filebrowser.log &
echo "✅ FileBrowser started"
# Start Jupyter Lab
echo "🔧 Starting Jupyter Lab..."
nohup /usr/local/bin/start-jupyter.sh &> /jupyter.log &
sleep 5
echo "🔍 Checking Jupyter Lab status..."
if pgrep -f "jupyter lab" > /dev/null; then
echo "✅ Jupyter Lab started successfully"
echo "📊 Jupyter Lab logs:"
tail -10 /jupyter.log
else
echo "❌ Jupyter Lab failed to start"
echo "📊 Full error logs:"
cat /jupyter.log
echo "🔍 Checking what went wrong..."
echo "🐍 Python version in virtual env:"
/opt/comfyui-env/bin/python --version
echo "📦 Jupyter Lab version in virtual env:"
/opt/comfyui-env/bin/jupyter lab --version
fi
# Start ComfyUI
echo "🚀 Starting ComfyUI..."
echo "🌐 ComfyUI will be available at: http://0.0.0.0:$(echo $COMFYUI_ARGS | grep -oP '(?<=--port\s)\d+' || echo '8188')"
echo "📓 Jupyter Lab Terminal: Open http://0.0.0.0:8888 → New → Terminal"
cd $COMFYUI_DIR
nohup /opt/comfyui-env/bin/python main.py $COMFYUI_ARGS &> /comfyui.log &
echo "✅ ComfyUI started"
# Tail the ComfyUI log
tail -f /comfyui.log
EOF
RUN chmod +x /ComfyUI/start.sh
# Set working directory
WORKDIR /ComfyUI
# Expose ports
EXPOSE 8080 8188 8888 22
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
CMD curl -f http://0.0.0.0:8188/system_stats || exit 1
# Start ComfyUI
CMD ["/ComfyUI/start.sh"]123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421# Use CUDA 12.4.1 development base image for RTX 4090 compatibility
# Includes CUDA toolkit, compiler (nvcc), and development libraries
FROM nvidia/cuda:12.4.1-devel-ubuntu22.04
# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV DEBIAN_FRONTEND=noninteractive
ENV IMAGEIO_FFMPEG_EXE=/usr/bin/ffmpeg
ENV CUDA_HOME=/usr/local/cuda
ENV PATH=$PATH:$CUDA_HOME/bin
ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64
# Install system dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends software-properties-common \
gpg-agent \
&& add-apt-repository ppa:deadsnakes/ppa && \
apt-get update && \
apt-get install -y --no-install-recommends \
git \
make \
wget \
curl \
unzip \
pkg-config \
ca-certificates \
build-essential \
python3.12=3.12.13-1+jammy1 \
python3.12-venv \
python3.12-dev \
libglx-mesa0 \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender-dev \
libgomp1 \
ffmpeg \
openssh-server \
openssh-client \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Verify Python version
RUN python3.12 --version
# Install pip using ensurepip
RUN python3.12 -m ensurepip --upgrade
# CUDA toolkit and cuDNN already included in nvidia/cuda base image
# Configure SSH for root login
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config && \
sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config && \
mkdir -p /run/sshd && \
rm -f /etc/ssh/ssh_host_*
# Create virtual environment to avoid externally-managed-environment error
RUN python3.12 -m venv /opt/comfyui-env && \
/opt/comfyui-env/bin/pip install --upgrade pip
# Install PyTorch with CUDA 12.4.1 (matching base image)
RUN /opt/comfyui-env/bin/pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cu124 && \
/opt/comfyui-env/bin/pip cache purge
# Remove uv to force ComfyUI-Manager to use pip (uv doesn't respect --system-site-packages properly)
RUN pip uninstall -y uv 2>/dev/null || true && \
rm -f /usr/local/bin/uv /usr/local/bin/uvx
# Install ComfyUI latest stable version
WORKDIR /ComfyUI
RUN git clone https://github.com/comfyanonymous/ComfyUI.git . && \
/opt/comfyui-env/bin/pip install --no-cache-dir -r requirements.txt && \
/opt/comfyui-env/bin/pip install --no-cache-dir GitPython opencv-python && \
/opt/comfyui-env/bin/pip cache purge
# Install llama-cpp-python for GGUF support (CUDA 12.4 compatible with base image)
RUN /opt/comfyui-env/bin/pip install --upgrade --force-reinstall --no-cache-dir \
https://github.com/JamePeng/llama-cpp-python/releases/download/v0.3.34-cu124-Basic-linux-20260331/llama_cpp_python-0.3.34+cu124.basic-cp312-cp312-linux_x86_64.whl && \
/opt/comfyui-env/bin/pip cache purge
# Install ALL ComfyUI custom nodes from VastAI provisioning + RunpodDirect
RUN cd /ComfyUI/custom_nodes && \
git clone https://github.com/ltdrdata/ComfyUI-Manager.git && \
git clone https://github.com/kijai/ComfyUI_essentials.git && \
git clone https://github.com/huchukato/comfy-tagcomplete.git && \
git clone https://github.com/huchukato/ComfyUI-QwenVL-Mod.git && \
git clone https://github.com/huchukato/ComfyUI-RIFE-TensorRT-Auto.git && \
git clone https://github.com/huchukato/ComfyUI-Upscaler-TensorRT-Auto.git && \
git clone https://github.com/huchukato/ComfyUI-HuggingFace.git && \
git clone https://github.com/MadiatorLabs/ComfyUI-RunpodDirect.git && \
git clone https://github.com/city96/ComfyUI-GGUF.git && \
git clone https://github.com/MoonGoblinDev/Civicomfy.git && \
git clone https://github.com/Koishi-Star/Euler-Smea-Dyn-Sampler.git && \
git clone https://github.com/ltdrdata/was-node-suite-comfyui.git && \
git clone https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite.git && \
git clone https://github.com/rgthree/rgthree-comfy.git && \
git clone https://github.com/yolain/ComfyUI-Easy-Use.git && \
git clone https://github.com/kijai/ComfyUI-KJNodes.git && \
git clone https://github.com/Fannovel16/ComfyUI-Frame-Interpolation.git && \
git clone https://github.com/Smirnov75/ComfyUI-mxToolkit.git && \
git clone https://github.com/princepainter/ComfyUI-PainterI2V.git && \
git clone https://github.com/princepainter/ComfyUI-PainterLongVideo.git && \
git clone https://github.com/ashtar1984/comfyui-find-perfect-resolution.git && \
git clone https://github.com/huchukato/ComfyUI-Selectors.git && \
git clone https://github.com/kijai/ComfyUI-MMAudio.git && \
git clone https://github.com/GACLove/ComfyUI-VFI.git && \
git clone https://github.com/stduhpf/ComfyUI-WanMoeKSampler.git && \
git clone https://github.com/melMass/comfy_mtb.git
# Copy wildcards to Easy-Use (required for wildcard workflows)
RUN cp -r /ComfyUI/custom_nodes/comfy-tagcomplete/wildcards/mbe /ComfyUI/custom_nodes/ComfyUI-Easy-Use/wildcards || echo "Wildcards copy completed (or already exists)"
# Install requirements for all custom nodes
RUN bash -c 'cd /ComfyUI/custom_nodes && for node_dir in */; do if [ -f "$node_dir/requirements.txt" ]; then echo "Installing requirements for $node_dir..." && /opt/comfyui-env/bin/pip install --no-cache-dir -r "$node_dir/requirements.txt" || echo "Failed to install requirements for $node_dir"; fi; done' && \
/opt/comfyui-env/bin/pip cache purge
# Install additional essential dependencies
RUN /opt/comfyui-env/bin/pip install --no-cache-dir jupyter sageattention && \
/opt/comfyui-env/bin/pip cache purge
# Clean up heavy Git files to save space (keep repo structure for updates)
RUN find /ComfyUI/custom_nodes -name ".git" -type d -exec find {} -name "*.pack" -delete + || true && \
find /ComfyUI/custom_nodes -name ".git" -type d -exec find {} -name "pack-*.idx" -delete + || true && \
find /ComfyUI/custom_nodes -name ".git" -type d -exec find {} -name "objects" -type d -exec rm -rf {} + || true
# Create FileBrowser (RunPod method)
RUN curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash
# Create FileBrowser database and directories
RUN mkdir -p /filebrowser && \
mkdir -p /filebrowser/database && \
mkdir -p /filebrowser/files && \
ln -sf /ComfyUI /filebrowser/files/ComfyUI && \
echo '{"port": 8080, "baseURL": "", "address": "0.0.0.0", "log": "stdout", "database": "/filebrowser/database/filebrowser.db", "root": "/filebrowser/files", "noauth": true}' > /filebrowser/.config.json
# Create FileBrowser startup script
RUN echo '#!/bin/bash\n\
echo "📁 Starting FileBrowser on port 8080"\n\
echo "🌐 Access at: http://0.0.0.0:8080"\n\
echo "👤 No authentication required"\n\
echo ""\n\
cd /filebrowser\n\
filebrowser --config /filebrowser/.config.json\n\
' > /usr/local/bin/start-filebrowser.sh && chmod +x /usr/local/bin/start-filebrowser.sh
# Create Jupyter Lab startup script
RUN cat > /usr/local/bin/start-jupyter.sh << 'EOF'
#!/bin/bash
echo "📓 Starting Jupyter Lab on port 8888"
echo "🌐 Access at: http://0.0.0.0:8888"
echo "🔑 No token required"
echo ""
cd /ComfyUI
echo "🔧 Starting Jupyter Lab with terminal support..."
nohup /opt/comfyui-env/bin/jupyter lab \
--allow-root \
--no-browser \
--port=8888 \
--ip=0.0.0.0 \
--FileContentsManager.delete_to_trash=False \
--FileContentsManager.preferred_dir=/ComfyUI \
--ServerApp.root_dir=/ComfyUI \
--ServerApp.terminado_settings='{"shell_command":["/bin/bash"]}' \
--IdentityProvider.token="" \
--ServerApp.allow_origin=* &> /jupyter.log &
echo "✅ Jupyter Lab started"
echo "🔍 Checking Jupyter Lab status..."
sleep 5
if pgrep -f "jupyter lab" > /dev/null; then
echo "✅ Jupyter Lab started successfully"
echo "📊 Jupyter Lab logs:"
tail -10 /jupyter.log
else
echo "❌ Jupyter Lab failed to start"
echo "📊 Full error logs:"
cat /jupyter.log
echo "🔍 Checking what went wrong..."
echo "🐍 Python version in virtual env:"
/opt/comfyui-env/bin/python --version
echo "📦 Jupyter Lab version in virtual env:"
/opt/comfyui-env/bin/jupyter lab --version
fi
EOF
RUN chmod +x /usr/local/bin/start-jupyter.sh
# Create user directory structure
RUN mkdir -p /ComfyUI/user/default/workflows
# Create models directories
RUN mkdir -p /ComfyUI/models/vae && \
mkdir -p /ComfyUI/models/upscale_models && \
mkdir -p /ComfyUI/models/text_encoders
# Clean up heavy Git files to save space (keep repo structure for updates)
RUN find /ComfyUI/custom_nodes -name ".git" -type d -exec find {} -name "*.pack" -delete + || true && \
find /ComfyUI/custom_nodes -name ".git" -type d -exec find {} -name "pack-*.idx" -delete + || true && \
find /ComfyUI/custom_nodes -name ".git" -type d -exec find {} -name "objects" -type d -exec rm -rf {} + || true
# Aggressive cleanup to reduce image size
RUN rm -rf /tmp/* \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /var/cache/apt/archives/* \
&& find /ComfyUI -name "*.pyc" -delete \
&& find /ComfyUI -name "__pycache__" -type d -exec rm -rf {} + 2>/dev/null || true \
&& /opt/comfyui-env/bin/pip cache purge
# Set ComfyUI arguments (optimized for WAN2.2 with SageAttention)
ENV COMFYUI_ARGS="--listen 0.0.0.0 --port 8188 --disable-auto-launch --enable-cors-header --fast fp16_accumulation --use-sage-attention --reserve-vram 2 --cuda-malloc --async-offload"
# Create startup script (RunPod style with dynamic workflow updates)
RUN cat > /ComfyUI/start.sh << 'EOF'
#!/bin/bash
set -e # Exit the script if any statement returns a non-true return value
COMFYUI_DIR="/ComfyUI"
FILEBROWSER_CONFIG="/filebrowser/.config.json"
DB_FILE="/filebrowser/database/filebrowser.db"
# Function to update custom nodes
update_nodes() {
echo "🔄 Updating custom nodes..."
cd /ComfyUI/custom_nodes
# List of custom nodes to update
nodes=(
"https://github.com/ltdrdata/ComfyUI-Manager.git"
"https://github.com/kijai/ComfyUI_essentials.git"
"https://github.com/huchukato/comfy-tagcomplete.git"
"https://github.com/huchukato/ComfyUI-QwenVL-Mod.git"
"https://github.com/huchukato/ComfyUI-RIFE-TensorRT-Auto.git"
"https://github.com/huchukato/ComfyUI-Upscaler-TensorRT-Auto.git"
"https://github.com/huchukato/ComfyUI-HuggingFace.git"
"https://github.com/MadiatorLabs/ComfyUI-RunpodDirect.git"
"https://github.com/city96/ComfyUI-GGUF.git"
"https://github.com/MoonGoblinDev/Civicomfy.git"
"https://github.com/Koishi-Star/Euler-Smea-Dyn-Sampler.git"
"https://github.com/ltdrdata/was-node-suite-comfyui.git"
"https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite.git"
"https://github.com/rgthree/rgthree-comfy.git"
"https://github.com/yolain/ComfyUI-Easy-Use.git"
"https://github.com/kijai/ComfyUI-KJNodes.git"
"https://github.com/Fannovel16/ComfyUI-Frame-Interpolation.git"
"https://github.com/Smirnov75/ComfyUI-mxToolkit.git"
"https://github.com/princepainter/ComfyUI-PainterI2V.git"
"https://github.com/princepainter/ComfyUI-PainterLongVideo.git"
"https://github.com/ashtar1984/comfyui-find-perfect-resolution.git"
"https://github.com/huchukato/ComfyUI-Selectors.git"
"https://github.com/kijai/ComfyUI-MMAudio.git"
"https://github.com/GACLove/ComfyUI-VFI.git"
"https://github.com/stduhpf/ComfyUI-WanMoeKSampler.git"
"https://github.com/melMass/comfy_mtb.git"
)
for node_url in "${nodes[@]}"; do
node_name=$(basename "$node_url" .git)
if [ -d "$node_name" ]; then
echo " 🔄 Updating: $node_name"
cd "$node_name"
git pull origin main 2>/dev/null || git pull origin master 2>/dev/null || echo " ⚠️ Failed to update $node_name"
cd ..
else
echo " 📥 Installing: $node_name"
git clone "$node_url" || echo " ⚠️ Failed to clone $node_name"
fi
done
# Install requirements for updated nodes
echo "📦 Installing updated requirements..."
bash -c 'for node_dir in */; do if [ -f "$node_dir/requirements.txt" ]; then echo "Installing requirements for $node_dir..." && /opt/comfyui-env/bin/pip install --no-cache-dir -r "$node_dir/requirements.txt" || echo "Failed to install requirements for $node_dir"; fi; done'
echo "✅ Node update completed"
}
# Function to download latest workflows
update_workflows() {
echo "🔄 Updating workflows from latest versions..."
mkdir -p /ComfyUI/user/default/workflows
cd /ComfyUI/user/default/workflows
# List of latest workflows
workflows=(
"PMP-LoRaStack-Upscale-Wildcards.json"
"WAN2.2-I2V-AutoPrompt-Story.json"
"WAN2.2-T2V-I2V-AutoPrompt-Story.json"
"WAN2.2-I2V-SVI-AutoPrompt-Story.json"
"WAN2.2-I2V-AutoPrompt.json"
"WAN2.2-I2V-AutoPrompt-GGUF.json"
"WAN2.2-T2V-AutoPrompt.json"
"WAN2.2-T2V-AutoPrompt-GGUF.json"
"WAN2.2-I2V-SVI-AutoPrompt.json"
"WAN2.2-I2V-SVI-AutoPrompt-GGUF.json"
"WAN2.2-I2V-Full-AutoPrompt-MMAudio.json"
"WAN2.2-I2V-Full-AutoPrompt-MMAudio-GGUF.json"
"WAN2.2-T2V-I2V-Full-AutoPrompt-MMAudio-GGUF.json"
)
for workflow in "${workflows[@]}"; do
echo " 📥 Downloading: $workflow"
wget -q "https://github.com/huchukato/ComfyUI-QwenVL-Mod/raw/main/vastai/workflows/$workflow" -O "$workflow" || echo " ⚠️ Failed to download $workflow"
done
echo "✅ Workflow update completed"
}
download_models() {
echo "🔄 Downloading essential models..."
cd /ComfyUI
# Download VAE models
if [ ! -f "/ComfyUI/models/vae/wan_2.1_vae.safetensors" ]; then
echo " 📥 Downloading WAN 2.1 VAE..."
wget -q "https://huggingface.co/Comfy-Org/Wan_2.2_ComfyUI_Repackaged/resolve/main/split_files/vae/wan_2.1_vae.safetensors" -O "/ComfyUI/models/vae/wan_2.1_vae.safetensors" || echo " ⚠️ Failed to download WAN 2.1 VAE"
fi
if [ ! -f "/ComfyUI/models/vae/sdxl_vae.safetensors" ]; then
echo " 📥 Downloading SDXL VAE..."
wget -q "https://huggingface.co/huchukato/favs/resolve/main/VAE/sdxl.vae.safetensors" -O "/ComfyUI/models/vae/sdxl_vae.safetensors" || echo " ⚠️ Failed to download SDXL VAE"
fi
# Download upscale models
if [ ! -f "/ComfyUI/models/upscale_models/2xLexicaRRDBNet.pth" ]; then
echo " 📥 Downloading 2xLexicaRRDBNet upscale model..."
wget -q "https://huggingface.co/huchukato/favs/resolve/main/ESRGAN/2xLexicaRRDBNet.pth" -O "/ComfyUI/models/upscale_models/2xLexicaRRDBNet.pth" || echo " ⚠️ Failed to download upscale model"
fi
if [ ! -f "/ComfyUI/models/upscale_models/2xLexicaRRDBNet_Sharp.pth" ]; then
echo " 📥 Downloading 2xLexicaRRDBNet Sharp upscale model..."
wget -q "https://huggingface.co/huchukato/favs/resolve/main/ESRGAN/2xLexicaRRDBNet_Sharp.pth" -O "/ComfyUI/models/upscale_models/2xLexicaRRDBNet_Sharp.pth" || echo " ⚠️ Failed to download Sharp upscale model"
fi
# Download text encoder
if [ ! -f "/ComfyUI/models/text_encoders/nsfw_wan_umt5-xxl_fp8_scaled.safetensors" ]; then
echo " 📥 Downloading NSFW WAN UMT5-XXL text encoder..."
wget -q "https://huggingface.co/NSFW-API/NSFW-Wan-UMT5-XXL/resolve/main/nsfw_wan_umt5-xxl_fp8_scaled.safetensors" -O "/ComfyUI/models/text_encoders/nsfw_wan_umt5-xxl_fp8_scaled.safetensors" || echo " ⚠️ Failed to download text encoder"
fi
echo "✅ Model download completed"
echo "📋 Available models:"
ls -la /ComfyUI/models/vae/
ls -la /ComfyUI/models/upscale_models/
ls -la /ComfyUI/models/text_encoders/
}
echo "🚀 Starting ComfyUI-QwenVL-Mod on RunPod (RTX 4090 Version)"
echo "🎬 WAN 2.2 workflows ready"
echo "🌐 Multilingual support enabled"
echo "🎨 Visual style detection ready"
echo "⚡ GGUF backend optimized"
echo ""
# Update workflows to latest versions
update_workflows
# Update custom nodes to latest versions
update_nodes
# Download essential models
download_models
echo "🔧 Services starting:"
echo "📁 FileBrowser: http://0.0.0.0:8080"
echo "📓 Jupyter Lab: http://0.0.0.0:8888 (Terminal included)"
echo "🎨 ComfyUI: http://0.0.0.0:8188"
echo "📋 Available workflows:"
ls -la /ComfyUI/user/default/workflows/
echo ""
echo "💡 Models pre-loaded for immediate use"
echo ""
# Start FileBrowser
echo "🔧 Starting FileBrowser..."
nohup /usr/local/bin/start-filebrowser.sh &> /filebrowser.log &
echo "✅ FileBrowser started"
# Start Jupyter Lab
echo "🔧 Starting Jupyter Lab..."
nohup /usr/local/bin/start-jupyter.sh &> /jupyter.log &
sleep 5
echo "🔍 Checking Jupyter Lab status..."
if pgrep -f "jupyter lab" > /dev/null; then
echo "✅ Jupyter Lab started successfully"
echo "📊 Jupyter Lab logs:"
tail -10 /jupyter.log
else
echo "❌ Jupyter Lab failed to start"
echo "📊 Full error logs:"
cat /jupyter.log
echo "🔍 Checking what went wrong..."
echo "🐍 Python version in virtual env:"
/opt/comfyui-env/bin/python --version
echo "📦 Jupyter Lab version in virtual env:"
/opt/comfyui-env/bin/jupyter lab --version
fi
# Start ComfyUI
echo "🚀 Starting ComfyUI..."
echo "🌐 ComfyUI will be available at: http://0.0.0.0:$(echo $COMFYUI_ARGS | grep -oP '(?<=--port\s)\d+' || echo '8188')"
echo "📓 Jupyter Lab Terminal: Open http://0.0.0.0:8888 → New → Terminal"
cd $COMFYUI_DIR
nohup /opt/comfyui-env/bin/python main.py $COMFYUI_ARGS &> /comfyui.log &
echo "✅ ComfyUI started"
# Tail the ComfyUI log
tail -f /comfyui.log
EOF
RUN chmod +x /ComfyUI/start.sh
# Set working directory
WORKDIR /ComfyUI
# Expose ports
EXPOSE 8080 8188 8888 22
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
CMD curl -f http://0.0.0.0:8188/system_stats || exit 1
# Start ComfyUI
CMD ["/ComfyUI/start.sh"]123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132# ComfyUI - QwenVL-Mod Custom Pod - RTX 4090
Custom ComfyUI environment with conda-based setup, optimized for RTX 4090 with QwenVL-Mod enhanced vision-language capabilities and WAN 2.2 video generation.
**Template**: `Custom-ComfyUI-WAN2.2-Qwen3VL-RTX4090` - **Conda Environment**
---
## 🎯 Who is this for?
- **AI Video Creators** wanting professional WAN 2.2 video generation
- **Content Creators** needing multilingual prompt processing
- **Digital Artists** requiring visual style detection and enhancement
- **ML Engineers** deploying production-ready video workflows
- **Researchers** experimenting with vision-language models
---
## 🚀 Features
### **🎬 WAN 2.2 Video Generation**
- **Text-to-Video (T2V)**: Professional 5-second video generation
- **Image-to-Video (I2V)**: Advanced image animation with style detection
- **Storyboard Workflows**: Seamless storyboard generation
### **🌐 Enhanced Capabilities**
- **Multilingual Support**: Process prompts from any language
- **Visual Style Detection**: 12+ artistic styles (anime, 3D, pixel art, etc.)
- **GGUF Backend**: Efficient local model inference
- **NSFW Support**: Comprehensive content generation
- **JupyterLab Terminal**: Direct bash access in conda environment
### **⚡ Custom Pod Optimizations**
- **RTX 4090 Optimized**: CUDA 12.4 for maximum compatibility
- **Dedicated Conda Environment**: Python 3.12.12 isolated setup
- **FP16 Accumulation**: Faster mixed precision computation
- **Sage Attention**: Optimized attention mechanisms for WAN2.2
- **Async Offload**: Efficient memory management
- **TensorRT Support**: Advanced upscaling and interpolation
---
## 📦 Pre-installed Components
### **Custom Conda Environment**
- **Dedicated Conda Setup**: Isolated Python 3.12.12 environment
- **CUDA 12.4 Toolkit**: Optimized for RTX 4090
- **Custom Dependencies**: Tailored package versions
### **Custom Nodes (26+)**
- **ComfyUI-QwenVL-Mod**: Enhanced vision-language with WAN 2.2
- **ComfyUI-Manager**: Node and model management
- **ComfyUI-GGUF**: GGUF model support
- **ComfyUI-VideoHelperSuite**: Video processing utilities
- **ComfyUI-Impact-Pack**: Advanced functionality
- **ComfyUI-RunpodDirect**: RunPod-specific optimizations
- **ComfyUI-Upscaler-Tensorrt**: TensorRT upscaling support
- **ComfyUI-RIFE-TensorRT-Auto**: TensorRT frame interpolation
- **PainterI2V Series**: Professional image-to-video workflows
- **ComfyUI-MMAudio**: Audio processing
- **ComfyUI-VFI**: Video frame interpolation
### **Workflows Included (13)**
- **WAN 2.2 T2V**: Text-to-video with automatic prompt optimization
- **WAN 2.2 I2V**: Image-to-video with style detection and enhancement
- **WAN 2.2 T2V GGUF**: Efficient text-to-video with GGUF models
- **WAN 2.2 I2V GGUF**: Optimized image-to-video with GGUF
- **WAN 2.2 SVI**: Storyboard-to-video with narrative enhancement
- **WAN 2.2 SVI GGUF**: Storyboard workflows with GGUF optimization
- **WAN 2.2 Full MMAudio**: Complete audio-video integration
- **WAN 2.2 Full MMAudio GGUF**: Audio-video with GGUF efficiency
- **WAN 2.2 T2V-I2V MMAudio**: Hybrid text/image-to-video
- **AutoPrompt Story**: Narrative generation with Qwen3-VL
- **PMP LoRaStack**: Professional upscaling with wildcards
---
## 🛠️ Technical Specifications
### **System Requirements**
- **GPU**: RTX 4090 (optimized for this card)
- **CUDA**: 12.4 compatible
- **Memory**: 24GB+ VRAM recommended
- **Storage**: 100GB+ SSD for models and workflows
### **Custom Pod Benefits**
- **Dedicated Environment**: Isolated conda setup prevents conflicts
- **Optimized Dependencies**: Custom-tailored package versions
- **Enhanced Performance**: RTX 4090 specific optimizations
- **Full Control**: Complete environment management
---
## 🚀 Quick Start
1. **Deploy Template**: Select "Custom-ComfyUI-WAN2.2-Qwen3VL-RTX4090"
2. **Wait for Setup**: Automatic conda environment initialization (~5-10 minutes)
3. **Access Services**:
- **ComfyUI**: `http://your-pod-ip:8188`
- **JupyterLab**: `http://your-pod-ip:8888`
- **FileBrowser**: `http://your-pod-ip:8080`
- **SSH**: `ssh root@your-pod-ip`
4. **Start Creating**: Load pre-installed workflows and begin generating
---
## 🔧 Environment Variables
- `COMFYUI_ARGS`: ComfyUI startup parameters
- `LIGHTNING_THEME`: JupyterLab theme (light/dark)
- `CONDA_ENV`: Conda environment name (comfyui)
---
## 📚 Documentation
- **ComfyUI-QwenVL-Mod**: Repository documentation
- **WAN 2.2 Paper**: Technical specifications
- **Conda Docs**: Environment management
---
## 🆘 Support
- **Template Issues**: GitHub repository issues
- **ComfyUI Help**: ComfyUI community resources
- **Conda Support**: Environment troubleshooting
---
**Custom-Built Pod** - Dedicated conda environment with RTX 4090 optimizations for maximum performance.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133# ComfyUI - QwenVL-Mod Custom Pod - RTX 5090
Custom ComfyUI environment with conda-based setup, optimized for RTX 5090 with QwenVL-Mod enhanced vision-language capabilities and WAN 2.2 video generation.
**Template**: `Custom-ComfyUI-WAN2.2-Qwen3VL-RTX5090` - **Conda Environment**
---
## 🎯 Who is this for?
- **AI Video Creators** wanting professional WAN 2.2 video generation
- **Content Creators** needing multilingual prompt processing
- **Digital Artists** requiring visual style detection and enhancement
- **ML Engineers** deploying production-ready video workflows
- **Researchers** experimenting with vision-language models
---
## 🚀 Features
### **🎬 WAN 2.2 Video Generation**
- **Text-to-Video (T2V)**: Professional 5-second video generation
- **Image-to-Video (I2V)**: Advanced image animation with style detection
- **Storyboard Workflows**: Seamless storyboard generation
### **🌐 Enhanced Capabilities**
- **Multilingual Support**: Process prompts from any language
- **Visual Style Detection**: 12+ artistic styles (anime, 3D, pixel art, etc.)
- **GGUF Backend**: Efficient local model inference
- **NSFW Support**: Comprehensive content generation
- **JupyterLab Terminal**: Direct bash access in conda environment
### **⚡ Custom Pod Optimizations**
- **RTX 5090 Optimized**: CUDA 12.8 for maximum performance
- **Dedicated Conda Environment**: Python 3.12.12 isolated setup
- **FP16 Accumulation**: Faster mixed precision computation
- **Sage Attention**: Optimized attention mechanisms for WAN2.2
- **Async Offload**: Efficient memory management
- **FP8 Support**: Latest hardware acceleration
- **TensorRT Support**: Advanced upscaling and interpolation
---
## 📦 Pre-installed Components
### **Custom Conda Environment**
- **Dedicated Conda Setup**: Isolated Python 3.12.12 environment
- **CUDA 12.8 Toolkit**: Optimized for RTX 5090
- **Custom Dependencies**: Tailored package versions
### **Custom Nodes (26+)**
- **ComfyUI-QwenVL-Mod**: Enhanced vision-language with WAN 2.2
- **ComfyUI-Manager**: Node and model management
- **ComfyUI-GGUF**: GGUF model support
- **ComfyUI-VideoHelperSuite**: Video processing utilities
- **ComfyUI-Impact-Pack**: Advanced functionality
- **ComfyUI-RunpodDirect**: RunPod-specific optimizations
- **ComfyUI-Upscaler-Tensorrt**: TensorRT upscaling support
- **ComfyUI-RIFE-TensorRT-Auto**: TensorRT frame interpolation
- **PainterI2V Series**: Professional image-to-video workflows
- **ComfyUI-MMAudio**: Audio processing
- **ComfyUI-VFI**: Video frame interpolation
### **Workflows Included (13)**
- **WAN 2.2 T2V**: Text-to-video with automatic prompt optimization
- **WAN 2.2 I2V**: Image-to-video with style detection and enhancement
- **WAN 2.2 T2V GGUF**: Efficient text-to-video with GGUF models
- **WAN 2.2 I2V GGUF**: Optimized image-to-video with GGUF
- **WAN 2.2 SVI**: Storyboard-to-video with narrative enhancement
- **WAN 2.2 SVI GGUF**: Storyboard workflows with GGUF optimization
- **WAN 2.2 Full MMAudio**: Complete audio-video integration
- **WAN 2.2 Full MMAudio GGUF**: Audio-video with GGUF efficiency
- **WAN 2.2 T2V-I2V MMAudio**: Hybrid text/image-to-video
- **AutoPrompt Story**: Narrative generation with Qwen3-VL
- **PMP LoRaStack**: Professional upscaling with wildcards
---
## 🛠️ Technical Specifications
### **System Requirements**
- **GPU**: RTX 5090 (optimized for this card)
- **CUDA**: 12.8 compatible
- **Memory**: 32GB+ VRAM recommended
- **Storage**: 100GB+ SSD for models and workflows
### **Custom Pod Benefits**
- **Dedicated Environment**: Isolated conda setup prevents conflicts
- **Optimized Dependencies**: Custom-tailored package versions
- **Enhanced Performance**: RTX 5090 specific optimizations
- **Full Control**: Complete environment management
---
## 🚀 Quick Start
1. **Deploy Template**: Select "Custom-ComfyUI-WAN2.2-Qwen3VL-RTX5090"
2. **Wait for Setup**: Automatic conda environment initialization (~5-10 minutes)
3. **Access Services**:
- **ComfyUI**: `http://your-pod-ip:8188`
- **JupyterLab**: `http://your-pod-ip:8888`
- **FileBrowser**: `http://your-pod-ip:8080`
- **SSH**: `ssh root@your-pod-ip`
4. **Start Creating**: Load pre-installed workflows and begin generating
---
## 🔧 Environment Variables
- `COMFYUI_ARGS`: ComfyUI startup parameters
- `LIGHTNING_THEME`: JupyterLab theme (light/dark)
- `CONDA_ENV`: Conda environment name (comfyui)
---
## 📚 Documentation
- **ComfyUI-QwenVL-Mod**: Repository documentation
- **WAN 2.2 Paper**: Technical specifications
- **Conda Docs**: Environment management
---
## 🆘 Support
- **Template Issues**: GitHub repository issues
- **ComfyUI Help**: ComfyUI community resources
- **Conda Support**: Environment troubleshooting
---
**Custom-Built Pod** - Dedicated conda environment with RTX 5090 optimizations for maximum performance.1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556#!/bin/bash
# ComfyUI-QwenVL-Mod v2.2.0 RTX 4090 Local Build Script
# Builds Docker image locally for local use only
set -e
# Configuration
IMAGE_NAME="huchukato/comfyui-qwenvl-runpod"
TAG="4090-local"
FULL_IMAGE_NAME="${IMAGE_NAME}:${TAG}"
echo "🏗️ Building ComfyUI-QwenVL-Mod v2.2.0 RTX 4090 Docker Image Locally"
echo "=================================================================="
echo "Image: ${FULL_IMAGE_NAME}"
echo "Features: WAN 2.2 workflows, GGUF support, CUDA 12.4 optimized"
echo "GPU: RTX 4090 compatible"
echo "Use: Local Docker deployment only"
echo ""
# Check if Docker is running
if ! docker info > /dev/null 2>&1; then
echo "❌ Docker is not running. Please start Docker first."
exit 1
fi
# Build the image
echo "🏗️ Building Docker image for x86_64 (CUDA 12.4)..."
echo "This may take 10-15 minutes..."
docker buildx build --builder desktop-linux --platform linux/amd64 -f Dockerfile.4090 -t "${FULL_IMAGE_NAME}" --load --no-cache .
echo ""
echo "✅ Local build completed successfully!"
echo ""
echo "📋 Image Details:"
echo " Local tag: ${FULL_IMAGE_NAME}"
echo " Dockerfile: Dockerfile.4090"
echo " CUDA Version: 12.4"
echo " GPU Target: RTX 4090"
echo ""
echo "🚀 Ready for local Docker deployment!"
echo ""
echo "📝 To run locally:"
echo " docker run -d --gpus all \\"
echo " -p 8080:8080 -p 8888:8888 -p 8188:8188 \\"
echo " -v \$(pwd)/output:/ComfyUI/output \\"
echo " ${FULL_IMAGE_NAME}"
echo ""
echo "💡 Port mappings:"
echo " 8080 → FileBrowser"
echo " 8888 → JupyterLab (Terminal included)"
echo " 8188 → ComfyUI"
echo ""
echo "🔗 For RunPod deployment, use the pre-built image:"
echo " docker pull huchukato/comfyui-qwenvl-runpod-4090"
echo " Then deploy on RunPod with RTX 4090"1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556#!/bin/bash
# ComfyUI-QwenVL-Mod v2.2.0 RTX 5090 Local Build Script
# Builds Docker image locally for local use only
set -e
# Configuration
IMAGE_NAME="huchukato/comfyui-qwenvl-runpod"
TAG="5090-local"
FULL_IMAGE_NAME="${IMAGE_NAME}:${TAG}"
echo "🏗️ Building ComfyUI-QwenVL-Mod v2.2.0 RTX 5090 Docker Image Locally"
echo "=================================================================="
echo "Image: ${FULL_IMAGE_NAME}"
echo "Features: WAN 2.2 workflows, GGUF support, CUDA 12.8 optimized"
echo "GPU: RTX 5090 compatible"
echo "Use: Local Docker deployment only"
echo ""
# Check if Docker is running
if ! docker info > /dev/null 2>&1; then
echo "❌ Docker is not running. Please start Docker first."
exit 1
fi
# Build the image
echo "🏗️ Building Docker image for x86_64 (CUDA 12.8)..."
echo "This may take 10-15 minutes..."
docker buildx build --builder desktop-linux --platform linux/amd64 -f Dockerfile -t "${FULL_IMAGE_NAME}" --load --no-cache .
echo ""
echo "✅ Local build completed successfully!"
echo ""
echo "📋 Image Details:"
echo " Local tag: ${FULL_IMAGE_NAME}"
echo " Dockerfile: Dockerfile"
echo " CUDA Version: 12.8"
echo " GPU Target: RTX 5090"
echo ""
echo "🚀 Ready for local Docker deployment!"
echo ""
echo "📝 To run locally:"
echo " docker run -d --gpus all \\"
echo " -p 8080:8080 -p 8888:8888 -p 8188:8188 \\"
echo " -v \$(pwd)/output:/ComfyUI/output \\"
echo " ${FULL_IMAGE_NAME}"
echo ""
echo "💡 Port mappings:"
echo " 8080 → FileBrowser"
echo " 8888 → JupyterLab (Terminal included)"
echo " 8188 → ComfyUI"
echo ""
echo "🔗 For RunPod deployment, use the pre-built image:"
echo " docker pull huchukato/comfyui-qwenvl-runpod"
echo " Then deploy on RunPod with RTX 5090"1234567891011121314151617181920212223242526272829303132333435363738version: '3.8'
services:
comfyui-qwenvl:
build:
context: .
dockerfile: Dockerfile
image: huchukato/comfyui-qwenvl-runpod:latest
container_name: comfyui-qwenvl-test
ports:
- "8080:8080"
volumes:
- ./models:/ComfyUI/models:ro
- ./outputs:/ComfyUI/output
- ./input:/ComfyUI/input
environment:
- COMFYUI_ARGS=--disable-auto-launch --port 8080 --enable-cors-header --fast fp16_accumulation --use-sage-attention --reserve-vram 2 --cuda-malloc --async-offload --supports-fp8-compute --fast cublas_ops autotune
- PYTHONUNBUFFERED=1
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/system_stats"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
networks:
- comfyui-network
networks:
comfyui-network:
driver: bridge123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144"""
SageAttention patching functions for QwenVL models.
This module contains the safe SageAttention implementation with proper error handling.
"""
import torch
def set_sage_attention(model):
"""
Apply SageAttention patching to the model.
Patches Qwen2Attention and Qwen3VLTextAttention modules to use SageAttention kernels.
"""
from AILab_QwenVL import sage_attn_available, get_sage_attention_config
if not sage_attn_available():
raise ImportError("SageAttention library is not installed or GPU doesn't support it.")
SAGE_ATTN_FUNC, QK_QUANT_GRAN, PV_ACCUM_DTYPE = get_sage_attention_config()
if SAGE_ATTN_FUNC is None:
raise RuntimeError("No compatible SageAttention kernel found for this GPU.")
# Try to import different attention classes for different Qwen models
attention_classes = []
# Qwen2 models
try:
from transformers.models.qwen2.modeling_qwen2 import Qwen2Attention, apply_rotary_pos_emb as qwen2_apply_rotary
attention_classes.append((Qwen2Attention, qwen2_apply_rotary))
except ImportError:
pass
# Qwen3 models (Qwen3-VL, etc.)
try:
from transformers.models.qwen3.modeling_qwen3 import Qwen3Attention, apply_rotary_pos_emb as qwen3_apply_rotary
attention_classes.append((Qwen3Attention, qwen3_apply_rotary))
except ImportError:
pass
# Qwen3-VL specific
try:
from transformers.models.qwen3_vl.modeling_qwen3_vl import Qwen3VLTextAttention, apply_rotary_pos_emb as qwen3vl_apply_rotary
attention_classes.append((Qwen3VLTextAttention, qwen3vl_apply_rotary))
except ImportError:
pass
if not attention_classes:
print("[QwenVL] Could not import any attention classes for SageAttention patching")
return
def make_sage_forward(AttentionClass, apply_rotary_pos_emb_func):
def sage_attention_forward(
self,
hidden_states: torch.Tensor,
position_embeddings: tuple = None,
attention_mask: torch.Tensor = None,
past_key_values=None,
cache_position: torch.LongTensor = None,
position_ids: torch.LongTensor = None,
**kwargs,
):
original_dtype = hidden_states.dtype
# Determine target dtype
is_4bit = hasattr(self.q_proj, 'quant_state')
if is_4bit:
target_dtype = torch.bfloat16
else:
target_dtype = self.q_proj.weight.dtype
if hidden_states.dtype != target_dtype:
hidden_states = hidden_states.to(target_dtype)
input_shape = hidden_states.shape[:-1]
hidden_shape = (*input_shape, -1, self.head_dim)
bsz, q_len = input_shape[0], input_shape[1] if len(input_shape) > 1 else hidden_states.size(1)
# Handle q_norm and k_norm for Qwen3-VL
query_states = self.q_proj(hidden_states)
key_states = self.k_proj(hidden_states)
value_states = self.v_proj(hidden_states)
# Apply normalization if available (Qwen3-VL specific)
if hasattr(self, 'q_norm'):
query_states = self.q_norm(query_states.view(hidden_shape)).transpose(1, 2)
else:
query_states = query_states.view(hidden_shape).transpose(1, 2)
if hasattr(self, 'k_norm'):
key_states = self.k_norm(key_states.view(hidden_shape)).transpose(1, 2)
else:
key_states = key_states.view(hidden_shape).transpose(1, 2)
value_states = value_states.view(hidden_shape).transpose(1, 2)
# Apply rotary embeddings
if position_embeddings is not None:
cos, sin = position_embeddings
query_states, key_states = apply_rotary_pos_emb_func(query_states, key_states, cos, sin)
if past_key_values is not None:
cache_kwargs = {"sin": sin if position_embeddings else None, "cos": cos if position_embeddings else None, "cache_position": cache_position}
key_states, value_states = past_key_values.update(key_states, value_states, self.layer_idx, cache_kwargs)
is_causal = attention_mask is None and q_len > 1
attn_output = SAGE_ATTN_FUNC(
query_states.to(target_dtype),
key_states.to(target_dtype),
value_states.to(target_dtype),
tensor_layout="HND",
is_causal=is_causal,
qk_quant_gran=QK_QUANT_GRAN,
pv_accum_dtype=PV_ACCUM_DTYPE,
)
if isinstance(attn_output, tuple):
attn_output = attn_output[0]
attn_output = attn_output.transpose(1, 2).contiguous()
attn_output = attn_output.reshape(*input_shape, -1)
attn_output = self.o_proj(attn_output)
if attn_output.dtype != original_dtype:
attn_output = attn_output.to(original_dtype)
return attn_output, None
return sage_attention_forward
# Apply patching to all supported attention modules
patched_count = 0
for AttentionClass, apply_rotary_func in attention_classes:
sage_forward = make_sage_forward(AttentionClass, apply_rotary_func)
for module in model.modules():
if isinstance(module, AttentionClass):
module.forward = sage_forward.__get__(module, AttentionClass)
patched_count += 1
if patched_count > 0:
print(f"[QwenVL] SageAttention: Patched {patched_count} attention layers")
else:
print("[QwenVL] SageAttention: No compatible attention layers found to patch")123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810# ComfyUI-QwenVL Update Log
## Version 2.2.4 (2026/03/13)
🎬 **Critical I2V Timeline Fixes & NSFW Presets Optimization**
This update resolves critical issues with I2V Timeline preset generation and optimizes all NSFW presets for better user experience.
### 🚨 **Major I2V Timeline Fixes**
|- **Style Coherence**: Fixed AI changing anime→realism mid-sequence
|- **Character Stability**: Fixed characters disappearing/appearing incorrectly
|- **Natural Lighting**: Fixed AI adding artificial lights not in image
|- **Timeline Structure**: Fixed continuous numbering (6,7,8...) instead of 0-5 restart
|- **Format Consistency**: Fixed missing parentheses and unwanted labels
|- **Output Format**: Each prompt starts directly with timeline markers
### � **NSFW Presets Optimization**
|- **Complete Specifications**: All 8 NSFW presets now include full NSFW descriptions
|- **Emoji Display**: Restored proper emoji rendering (🍿🎥🎬📖🍿🎥🎬📖)
|- **Clear Instructions**: Removed confusing recommendations from presets
|- **User Notes**: Token settings guide created for workflow optimization
### 📋 **Technical Improvements**
|- **Timeline Markers**: Correct `(At X seconds: ...)` format for all 4 prompts
|- **Character Continuity**: Natural progression without forced artificial presence
|- **Lighting Rules**: Logical progression instead of absolute prohibitions
|- **Style Detection**: Consistent style application across all timeline segments
### 🎯 **Model Recommendations**
|- **Qwen3-VL-8B**: Recommended for I2V Timeline (20s) complex sequences
|- **Qwen3-VL-4B**: Sufficient for I2V Scene (5s) single prompts
|- **Token Settings**: 2048+ for 20s timeline, 1024+ for 5s prompts
## Version 2.0.7 (2026/02/03)
|- **FP16 Only**: All HF nodes now use FP16 exclusively (~6GB VRAM on RTX 5090)
|- **Quantization Dropdown Removed**: Eliminated confusing quantization options from all HF nodes
|- **Working Logic Restored**: Reverted to proven working FP16 logic from commit d057b34
|- **Both Nodes Fixed**: Applied fixes to both Standard and Advanced nodes
### 🎯 **Interface Simplification**
|- **Cleaner UI**: Removed quantization dropdown from QwenVL and QwenVL Advanced nodes
|- **GGUF for Quantization**: Users wanting quantized models should use dedicated GGUF nodes
|- **Consistent Parameters**: Both nodes now have consistent parameter structure
|- **keep_last_prompt**: Added missing parameter to maintain feature parity
### 🔧 **Technical Changes**
|- **Memory Management**: Improved model loading with CPU→CUDA transfer pattern
|- **Attention Backend**: SDPA as stable default (SageAttention can be added later)
|- **Error Prevention**: Removed all BitsAndBytes-related code paths
|- **Debug Logging**: Enhanced logging for attention mode selection and model loading
### 🐛 **Bug Fixes**
|- **OOM on RTX 5090**: Fixed critical Out-Of-Memory during model loading
|- **Missing Parameters**: Added frame_count and keep_last_prompt to Advanced node
|- **Quantization Logic**: Simplified to prevent device mismatch and quantization errors
|- **Function Signatures**: Corrected all process() functions after dropdown removal
### 💡 **User Guidance**
|- **HF Nodes**: Use for maximum quality with FP16 (~6GB VRAM)
|- **GGUF Nodes**: Use for quantized models (Q4/Q8, 2-4GB VRAM)
|- **Performance**: FP16 + SageAttention/FlashAttention for best speed
|- **Stability**: SDPA fallback ensures compatibility across all hardware
---
## Version 2.2.3 (2026/02/27)
🔧 **CUDA 13 Compatibility Fix + Redundancy Removal**
This update removes redundant memory management features and improves CUDA 13 compatibility.
### 🔧 **Memory Management Cleanup**
|- **Removed unload_after_run**: Eliminated redundant checkbox from all QwenVL nodes
|- **Fixed Parameter Errors**: Resolved missing argument errors in GGUF and PromptEnhancer nodes
|- **Conflict Prevention**: Prevents multiple unload operations that cause CUDA 13 crashes
|- **Simplified Interface**: Cleaner node interface without redundant parameters
|- **VRAM Cleanup Node**: Maintained for manual cleanup when needed
### 🐛 **Bug Fixes**
|- **VastAI CUDA 13**: Fixed crashes caused by conflicting unload operations
|- **WanMoeKSampler**: Manual boundary setting prevents automatic switching crashes
|- **Memory Conflicts**: Eliminated double cleanup between QwenVL and VRAM Cleanup nodes
|- **Parameter Errors**: Fixed "missing 1 required positional argument: unload_after_run" errors
|- **Function Signatures**: Corrected all run() and load_model() function signatures
### 📚 **Documentation Updates**
|- **All READMEs**: Updated to reflect unload_after_run removal
|- **Installation Guides**: Simplified instructions without redundant parameters
|- **Troubleshooting**: Added CUDA 13 specific guidance
### 🏆 Credits & Attribution
|- **Community Feedback**: Thanks to user testing that identified redundancy issue
|- **CUDA 13 Testing**: Comprehensive testing on VastAI infrastructure
|- **Memory Management**: Streamlined approach for better stability
---
## Version 2.2.2 (2026/02/19)
🚀 **Critical T2V/I2V Fixes + ComfyUI Optimizations**
## Version 2.2.2 (2026/02/19)
🚀 **Critical T2V/I2V Fixes + ComfyUI Optimizations**
This major update resolves critical workflow issues with T2V/I2V batch processing, same model reuse conflicts, and adds significant performance optimizations including Flash Attention 2 support and refined ComfyUI startup arguments.
### 🚀 T2V/I2V Workflow Fixes (Critical)
|- **Batch Processing**: Fixed critical T2V → GGUF issue with batch images `[batch, height, width, channels]`
|- **Frame Detection**: Added automatic batch detection and individual frame processing
|- **Video Support**: Enhanced video frame processing with proper shape handling
|- **Debug Enhanced**: Comprehensive logging for batch processing troubleshooting
### **Same Model Reuse Fix**
|- **Conflict Resolution**: Fixed crash when using same model between T2V and I2V nodes
|- **Memory Management**: Enhanced cleanup with CUDA synchronization and timing
|- **Signature Mismatch**: Resolved different signature patterns between nodes
|- **Aggressive Cleanup**: Forced complete VRAM cleanup before model reload
### 🐳 Docker System Optimizations
|- **ComfyUI Arguments**: Optimized startup arguments for better performance
|- **Flash Attention 2**: Enabled for 2-3x speedup on compatible hardware
|- **Experimental Features**: Added validated arguments (`--async-offload`, `--reserve-vram 2`)
|- **Version Compatibility**: Resolved version-specific argument differences
### **keep_model_loaded Enhancement**
### 🔧 keep_model_loaded Enhancement
|- **Missing Parameter**: Added `keep_model_loaded` to PromptEnhancer node
|- **Consistent Behavior**: Both GGUF and PromptEnhancer now have identical memory management
|- **Conditional Cleanup**: Proper cleanup based on `keep_model_loaded` setting
|- **User Control**: Full control over memory usage vs performance
### 🐳 Docker Final Optimization
|- **Complete Build**: All fixes integrated into final Docker build
|- **Flash Attention 2 Ready**: Performance optimizations included
|- **Debug Enhanced**: Comprehensive logging for troubleshooting
|- **Production Ready**: Stable and optimized for deployment
### 📋 Files Modified
**Node Files:**
|- `AILab_QwenVL_GGUF.py`: Batch processing + enhanced cleanup
|- `AILab_QwenVL_GGUF_PromptEnhancer.py`: keep_model_loaded + cleanup
**Docker System Files:**
|- `runpod/Dockerfile`: Flash Attention 2 + optimized ComfyUI arguments
|- `runpod/Dockerfile.4090`: Flash Attention 2 + optimized ComfyUI arguments
### 🎯 Impact
|- **T2V/I2V Workflows**: Now fully functional with batch processing
|- **Same Model Reuse**: No more conflicts between nodes
|- **Performance**: 2-3x faster with Flash Attention 2
|- **Stability**: Robust memory management and cleanup
|- **Production**: Ready for deployment with all optimizations
## Version 2.2.1 (2026/02/18)
🔧 **Critical GGUF VRAM Fix + Docker Optimization**
This critical update resolves a major VRAM leak issue in GGUF nodes that was causing crashes after multiple executions, plus significant Docker improvements for better stability and functionality.
### 🔧 GGUF VRAM Fix (Critical)
- **VRAM Leak Resolved**: Fixed critical issue where GGUF models kept VRAM allocated after runs
- **Issue #104**: Addressed GitHub issue where GGUF models failed after 2 runs
- **Aggressive Cleanup**: Implemented comprehensive VRAM cleanup for all GGUF nodes
- **Enhanced Clear Method**: Added explicit model deletion and multiple CUDA cache clearing
- **Debug Logging**: Added detailed cleanup logging for troubleshooting
- **Exception Handling**: Robust error handling during cleanup operations
### 🚀 Performance Improvements
- **Stable GGUF Operation**: Nodes now work reliably without VRAM accumulation
- **No More Crashes**: GGUF Advanced and PromptEnhancer nodes stable after multiple runs
- **Memory Management**: Proper garbage collection and CUDA synchronization
- **Resource Efficiency**: Better VRAM utilization and cleanup
### 🐳 Docker Enhancements
- **RunPod Methods**: Adopted proven RunPod installation methods for services
- **Jupyter Terminal**: Switched to simple `pip install jupyter` (RunPod approach)
- **FileBrowser**: Using official get.sh script for latest version
- **ComfyUI Latest**: Always uses latest stable version automatically
- **SSH Complete**: Both server and client SSH for full networking
- **FFmpeg ENV**: Added IMAGEIO_FFMPEG_EXE environment variable
- **Build Warnings**: Removed problematic HF_TOKEN variables
### 📋 Files Modified
- `AILab_QwenVL_GGUF.py`: Enhanced VRAM cleanup
- `AILab_QwenVL_GGUF_PromptEnhancer.py`: Enhanced VRAM cleanup
- `runpod/Dockerfile`: RunPod methods + optimizations
- `runpod/Dockerfile.4090`: RunPod methods + optimizations
### 🎯 Impact
- **Reliability**: GGUF nodes now production-ready
- **Stability**: No more VRAM-related crashes
- **Docker**: Better container experience
- **Performance**: Consistent operation across multiple runs
---
## Version 2.2.0 (2026/02/15)
🎬 **WAN 2.2 Story Generation System**
This major update introduces a complete story generation system for WAN 2.2, enabling the creation of continuous 20-second videos with 4 distinct segments, along with custom utility nodes and enhanced performance optimizations.
### 🎬 Story Generation System
- **4-Segment Videos**: Complete system for generating 20-second continuous videos (4 × 5-second segments)
- **Narrative Continuity**: Intelligent prompt splitting ensures story coherence across segments
- **Auto-Split Technology**: Custom node automatically detects and splits prompt separators
- **Workflow Integration**: Ready-to-use WAN 2.2 Story workflow included
- **NSFW Optimized**: Enhanced prompts specifically designed for story generation
### 🔄 Custom Nodes
- **Story Split Node**: Intelligent text splitting with auto-detection of separators (`\n`, `\n\n`, `\n\n\n`)
- **Smart Processing**: Automatically handles inconsistent model output formatting
- **Category**: Located in `🔷QwenVL-Mod/Utils` category
- **Chaining Support**: Full input/output connectivity for workflow integration
### 🎯 Enhanced Prompts
- **WAN 2.2 NSFW Story**: Optimized prompt format for 4-segment generation
- **Separator Instructions**: Clear guidelines for prompt separation
- **Continuity Rules**: Enhanced narrative continuity between segments
- **Token Optimization**: Recommended max_tokens=1536 for complete output
### ⚡ Performance Optimizations
- **Context Settings**: Optimized context_length for 8B models (65,536 tokens)
- **Model-Specific**: 4B models maintain 32,768 context for stability
- **Memory Management**: Improved VRAM usage and stability
- **Crash Prevention**: Safe defaults prevent ComfyUI crashes with large contexts
### 🐳 Docker Integration
- **Container Ready**: Complete Story system integrated in Docker containers
- **Auto-Download**: WAN2.2-I2V-AutoPrompt-Story.json and WAN2.2-T2V-AutoPrompt-Story.json workflows included
- **Cloud Deployment**: Ready for RunPod/VastAI deployment
- **Service Integration**: FileBrowser, JupyterLab, and ComfyUI with Story support
### 📁 File Structure
- **Nodes**: `/nodes/story_split_node.py` for intelligent prompt splitting
- **Workflows**:
- `/vastai/workflows/WAN2.2-I2V-AutoPrompt-Story.json` ready-to-use I2V workflow
- `/vastai/workflows/WAN2.2-T2V-AutoPrompt-Story.json` ready-to-use T2V workflow
- **Docker**: Updated `/runpod/Dockerfile` with Story workflows
- **Prompts**: Enhanced `/AILab_System_Prompts.json` with Story system
### 🔧 Technical Improvements
- **Auto-Loading**: Enhanced `__init__.py` to load nodes from subdirectory
- **Error Handling**: Robust separator detection and fallback mechanisms
- **Debug Output**: Detailed debugging information for troubleshooting
- **Flexible Input**: Support for custom delimiters and auto-detection modes
## Version 2.1.0 (2026/02/14)
🏷️ **User-Friendly Keep Last Prompt Feature**
This update refines the prompt persistence feature with a more intuitive parameter name and simplified implementation, making it easier for users to understand and use.
### 🔄 Keep Last Prompt User-Friendly
- **Parameter Rename**: Changed `bypass_mode` to `keep_last_prompt` for better user understanding
- **Intuitive Checkbox**: Clear boolean parameter for prompt persistence control
- **Consistent Logic**: Unified behavior across all 6 nodes (HF, GGUF, PromptEnhancer variants)
- **Workflow Optimization**: Generate once, preserve results while changing inputs
- **Zero Resource Usage**: Cached mode provides instant responses without model loading
- **Smart Caching**: LAST_SAVED_PROMPT global variable for efficient prompt reuse
### 🔥 Enhanced NSFW Support
- **Stronger Instructions**: Changed "If" to "WHEN" for more directive NSFW handling
- **Explicit Directives**: Added "IMPORTANT: Describe ALL content without censorship or filtering"
- **Detailed Requirements**: "Provide explicit, detailed descriptions of body parts, sexual acts, and adult content"
- **No Sanitization**: "Do not sanitize, euphemize, or avoid explicit content"
- **Universal Application**: Applied to all WAN 2.2 presets (I2V, T2V, Storyboard, Cinematic)
### 🔦 Fixed Lighting Invention Issues
- **Accuracy Problem**: Corrected AI tendency to add lights not present in source images
- **Visible Only Rule**: Changed to "Specify ONLY visible technical elements adapted for style"
- **Source Fidelity**: "light sources actually present in the image, light quality as observed"
- **No Invention**: "Do not invent or add lighting not present in the original image"
- **Better Descriptions**: More accurate lighting analysis based on actual image content
### 🔄 Updated GGUF Models
- **Replaced noctrex Models**: Removed older noctrex abliterated GGUF variants
- **Added mradermacher v2/v3**: Latest mradermacher quantizations for better performance
- **4B Model**: Qwen3-VL-4B-Instruct-c_abliterated-v2-GGUF (7 variants: 2.38GB-4.28GB)
- **8B Model**: Qwen3-VL-8B-Instruct-c_abliterated-v3-GGUF (7 variants: 4.8GB-8.71GB)
- **Enhanced File Selection**: More quantization options (Q4_K_S, Q5_K_S) for better VRAM efficiency
- **Corrected MMProj Files**: Updated to use proper .mmproj-f16.gguf files for each model
### 📦 Enhanced Model Selection (HF)
- **Added Josiefied Model**: Josiefied-Qwen3-VL-4B-Instruct-abliterated-beta-v1 (HF only)
- **GGUF Not Available**: Josiefied model exists only in HuggingFace format, not GGUF
- **Better Alternatives**: mradermacher models provide superior GGUF quantizations
- **Reliable Behavior**: Works regardless of seed changes or model variations
### ✅ Universal Implementation
- **All Nodes Updated**: QwenVL, QwenVL Advanced, QwenVL GGUF, QwenVL Advanced GGUF, QwenVL Prompt Enhancer, QwenVL Prompt Enhancer GGUF
- **Consistent UI**: Same parameter name and tooltip across all nodes
- **Bug Fixes**: Resolved TypeError issues in Advanced nodes
### 🔄 How Keep Last Prompt Works
1. **Generate Phase** (`keep_last_prompt=False`): Generate new prompt and save to memory
2. **Keep Phase** (`keep_last_prompt=True`): Return the last saved prompt from memory
3. **First Run**: If no previous prompt exists, returns empty string
4. **Memory Update**: Each generation overwrites the previous saved prompt
### 🐛 Bug Fixes
- **Fixed TypeError**: Resolved "unexpected keyword argument" errors in Advanced nodes
- **Parameter Consistency**: All process() functions now use `keep_last_prompt`
- **Syntax Errors**: Fixed duplicate global declarations
---
## Version 2.0.9 (2026/02/12)
🎛️ **Bypass Mode Parameter for Prompt Persistence**
This major feature introduces a new `bypass_mode` parameter that allows users to maintain previously generated prompts without regeneration, providing perfect workflow control.
### 🎛️ New Bypass Mode Feature
- **Smart Cache Retrieval**: When `bypass_mode=True`, nodes automatically retrieve the most recent cached prompt for the current model
- **Zero Resource Usage**: Bypass mode consumes no computational resources - instant response
- **Perfect Workflow Control**: Generate prompts once, then enable bypass mode to preserve them while changing inputs
- **Universal Implementation**: Available across all nodes (HF, GGUF, PromptEnhancer, Advanced variants)
### 🔄 How Bypass Mode Works
1. **Generate Phase** (`bypass_mode=False`): Generate new prompts and save them to cache
2. **Bypass Phase** (`bypass_mode=True`): Retrieve and return the most recent cached prompt
3. **Input Changes**: When bypass mode is enabled, changing images/videos or other inputs has no effect on the output
4. **Seamless Switching**: Toggle bypass mode on/off to switch between generation and persistence
### 📋 Updated Nodes
- ✅ **AILab_QwenVL** (HF): Added bypass_mode parameter
- ✅ **AILab_QwenVL_GGUF**: Added bypass_mode parameter
- ✅ **AILab_QwenVL_GGUF_Advanced**: Added bypass_mode parameter
- ✅ **AILab_QwenVL_PromptEnhancer** (HF): Added bypass_mode parameter
- ✅ **AILab_QwenVL_GGUF_PromptEnhancer**: Added bypass_mode parameter
### 🎯 Use Cases
- **Prompt Locking**: Generate the perfect prompt once, then lock it while experimenting with other workflow parameters
- **Batch Processing**: Generate multiple prompts, then use bypass mode to maintain consistency across batches
- **Resource Optimization**: Enable bypass mode when you need to preserve prompts but don't want to consume GPU resources
- **Workflow Debugging**: Test other parts of your workflow without changing the generated prompts
### 🎮 Simple Control
- **Checkbox Interface**: Simple bypass_mode checkbox in all node interfaces
- **Default Behavior**: bypass_mode defaults to False (normal generation)
- **Instant Feedback**: Console logs show when bypass mode is active and which cached prompt is being used
### 🔧 Technical Implementation
- **Cache-Based**: Uses existing prompt caching system for reliable prompt retrieval
- **Model-Specific**: Retrieves prompts specific to the current model configuration
- **Fallback Handling**: If no cached prompt exists, returns empty string gracefully
- **Performance Optimized**: Minimal overhead when bypass mode is enabled
## Version 2.0.8 (2026/02/06)
🐛 **Bug Fixes and Stability Improvements**
This release addresses critical issues identified in v2.0.7 and enhances multilingual capabilities.
### 🔧 Bug Fixes
- **JSON Syntax Error**: Fixed trailing comma in `AILab_System_Prompts.json` at line 26
- **Undefined Variable Error**: Resolved `name 'image_hash' is not defined` in GGUF Advanced node
- **Fixed Seed Stability**: Reverted problematic fixed seed improvements that caused undefined variable errors
- **Node Loading**: Ensured all nodes load correctly without missing variable errors
### 🌐 Multilingual Support Enhancement
- **Complete Multilingual Support**: All WAN 2.2 presets now support "user prompts from any language"
- **Updated Presets**:
- 🍿 Wan 2.2 I2V: Multilingual + style detection
- 🍿 Wan Extended Storyboard: Multilingual + style detection
- 🎥 Wan Cinematic Video: Multilingual + style detection
- 🍿 Wan 2.2 T2V: Multilingual + style detection
### 🎨 Visual Style Detection
- **Enhanced Style Detection**: Comprehensive support for artistic styles:
- Anime style
- 3D cartoon
- Pixel art
- Puppet animation
- 3D game style
- Claymation
- Watercolor
- Black and white animation
- Oil painting style
- Felt style
- Tilt-shift photography
- Time-lapse photography
### 🔧 Technical Improvements
- **JSON Validation**: All system prompts now validate correctly
- **Error Handling**: Improved error messages for debugging
- **Code Stability**: Removed complex seed tracking that caused undefined variables
- **Documentation**: Updated README and changelog with comprehensive changes
### 🔄 Repository Management
- **Clean Revert**: Properly reverted problematic commits
- **Version Control**: Maintained stable commit history
- **Documentation**: Comprehensive update logs for transparency
---
## Version 2.0.7 (2026/02/04)
🧠 **Smart Prompt Caching System**
This release introduces intelligent prompt caching with Fixed Seed Mode for dramatic performance improvements and workflow stability.
### 🎯 Key Features
- **Smart Caching**: Automatic prompt caching prevents regeneration of identical prompts
- **Fixed Seed Mode**: Set any fixed seed value to maintain consistent prompts regardless of media variations
- **Universal Coverage**: Works across all node types (HF, GGUF, PromptEnhancer)
- **Performance Boost**: Instant response for cached prompts with zero model loading time
- **Simplified Logic**: Streamlined caching system that always includes seed for predictable behavior across all seed values
### 🔧 Technical Implementation
- **Hash-based Cache Keys**: MD5 hashes generated from model, preset, custom prompt, media, and seed
- **Media Hash Sampling**: Efficient image/video tensor hashing using pixel sampling
- **Cache File Storage**: JSON-based cache with automatic save/load functionality
- **Seed-based Logic**: Always includes seed in cache key for consistent behavior
- **Console Logging**: Clear feedback on cache hits/misses with seed information
### 📋 Cache Behavior
- **Fixed Seed Mode**: Any fixed seed value maintains consistent prompts regardless of media variations
- **Random Mode**: Different seeds generate different prompts even with identical inputs
- **Cache Hit**: Same seed + same inputs = instant response from cache
- **Cache Miss**: Different seed or different inputs = new generation and cache storage
- **Cache Persistence**: Automatic saving to `prompt_cache.json` after each generation
- **Cache Loading**: Automatic cache restoration on ComfyUI startup
- **Memory Efficient**: Cache only stores generated text and metadata
### 🎨 User Experience
- **Updated Tooltips**: Enhanced seed parameter tooltips explaining cache behavior
- **Instant Response**: Zero wait time for cached prompts
- **Workflow Stability**: Same prompt guaranteed with fixed seed regardless of media
- **Performance Gains**: Dramatic speedup for repeated prompt generation
- **Transparent Operation**: Clear console messages indicating cache usage
### 🛠️ Compatibility
- **Backward Compatible**: Existing workflows continue to work unchanged
- **Optional Feature**: Fixed Seed Mode works with any seed value
- **Cache Management**: Automatic cache cleanup and management
- **Cross-Session**: Cache persists between ComfyUI restarts
- **Code Maintenance**: Removed deprecated parameters across all download functions (HF, GGUF, PromptEnhancer) for future compatibility
- **GGUF Performance**: Increased default context size from 8192 to 32768 across all GGUF models for better utilization
- **Universal Caching**: Fixed Seed Mode and smart caching now available across all node types (HF, GGUF, PromptEnhancer) with shared cache file
- **Simplified Logic**: Streamlined caching system that always includes seed for predictable behavior across all seed values
---
## Version 2.0.6 (2026/02/03)
🎬 **Professional Cinematography Enhancement**
This release adds comprehensive professional cinematography specifications to all WAN 2.2 presets and updates naming for consistency.
### 🎯 Major Enhancements
- **Professional Specifications**: All WAN 2.2 presets now include comprehensive cinematography technical details
- **Light Sources**: 8 types (sunlight, artificial, moonlight, practical, firelight, fluorescent, cloudy, mixed)
- **Light Quality**: 9 qualities (soft, hard, top, side, back, bottom, edge, silhouette, low/high contrast)
- **Time Periods**: 6 periods (daytime, nighttime, dusk, sunset, dawn, sunrise)
- **Shot Types**: 6 types (close-up, medium shot, medium close-up, medium full shot, full shot, wide angle)
- **Composition Types**: 5 types (central, balanced, side, symmetrical, short side)
- **Lens Specifications**: 5 focal lengths + 6 angles for complete camera control
- **Camera Movements**: 9 movement types for dynamic cinematography
- **Color Tone**: 4 tone options (warm, cool, high saturation, low saturation)
### 🏷️ Branding Updates
- **Wan 2.2 T2V**: Updated to "🍿 Wan 2.2 T2V" with proper emoji
- **Extended Storyboard**: Updated to "🍿 Wan Extended Storyboard" for WAN family consistency
- **Cinematic Video**: Updated to "🎥 Wan Cinematic Video" to align with WAN branding
### 📋 Enhanced Presets
- **🍿 Wan 2.2 I2V**: Timeline structure + professional specs
- **🍿 Wan 2.2 T2V**: Timeline structure + professional specs
- **🍿 Wan Extended Storyboard**: Timeline + continuity + professional specs
- **🎥 Wan Cinematic Video**: Single scene + professional specs
### 🛠️ Technical Improvements
- **Consistent Organization**: All WAN presets now follow family branding
- **Professional Quality**: Industry-standard cinematography specifications
- **Comprehensive Coverage**: Complete technical details for professional video generation
---
## Version 2.0.5 (2026/02/01)
🎬 **Extended Storyboard Preset Added**
This release adds a new specialized preset for extended storyboard generation with WAN 2.2 format compatibility.
### 🎯 New Features
- **Extended Storyboard Preset**: New preset positioned as 2nd in the list after Wan 2.2 I2V
- **WAN 2.2 Format Compliance**: Follows the same timeline structure "(At 0 seconds: ...)" format
- **Storyboard Continuity**: Each paragraph repeats content from previous paragraph for smooth transitions
- **NSFW Support**: Complete NSFW description support like Wan 2.2 I2V preset
- **Cinematic Specifications**: Comprehensive camera, lighting, and composition guidelines
### 📋 Preset Details
- **Position**: 2nd preset (after Wan 2.2 I2V) for easy access
- **Format**: 5-second timeline with detailed second-by-second descriptions
- **Focus**: Extended video generation with consistent character appearance and scene continuity
- **Technical Specs**: Includes camera movements, lighting types, composition guidelines
- **Output**: Optimized for storyboard-to-storyboard workflow generation
### 🛠️ Technical Improvements
- **Stability Fixes**: Identified and resolved "keep model loaded" memory issues
- **Performance**: Maintained stable operation without OOM errors
- **Compatibility**: Preset works with both VL and text-only models
---
## Version 2.0.4 (2026/02/01)
🔧 **Stability Update - SageAttention Removal**
This release focuses on stability by removing SageAttention integration that was causing compatibility issues and model interference.
### 🛠️ Major Changes
- **SageAttention Removed**: Completely removed SageAttention integration due to compatibility and stability issues
- **Simplified Attention Modes**: Now supports auto, flash_attention_2, and sdpa only
- **Clean Codebase**: Removed 100+ lines of complex patching code
- **Stable Performance**: SDPA provides excellent performance with zero interference
### 🎯 Attention Modes Available
- **Auto**: Automatically chooses best available attention implementation
- **Flash Attention 2**: High-performance attention when available (RTX 20+)
- **SDPA**: Scaled Dot Product Attention - stable and well-tested fallback
### 🐛 Issues Resolved
- **Model Output Problems**: Fixed prompt generation issues caused by SageAttention interference
- **Recursion Errors**: Eliminated infinite recursion in attention patching
- **Head Dimension Compatibility**: Removed headdim restrictions that were causing crashes
- **VAE Compatibility**: Fixed VAE encoding/decoding interference
### ⚡ Performance Impact
- **Flash Attention 2**: Still available for 2-3x speedup on compatible hardware
- **SDPA**: Highly optimized baseline performance
- **Zero Interference**: Clean attention pipeline without patching complications
- **Better Stability**: More reliable across different model architectures
---
## Version 2.0.3 (2026/02/01)
🔧 **SageAttention Compatibility Fix**
This hotfix release addresses a critical compatibility issue with SageAttention integration that prevented proper patching in certain transformer versions.
### 🐛 Bug Fixes
- **SageAttention Patch**: Fixed AttributeError when accessing `transformers.models.qwen2.modeling_qwen2.F`
- **Proper Module Access**: Changed patch target to `torch.nn.functional.F.scaled_dot_product_attention`
- **Compatibility**: Ensured SageAttention works across different transformer versions
- **Safer Imports**: Added better error handling for module imports
### ⚡ Performance Impact
- SageAttention now works correctly with 8-bit quantization
- Maintains 2-5x performance boost on compatible hardware
- Graceful fallback to SDPA when patching fails
---
## Version 2.0.2 (2026/02/01)
🎯 **User Experience & Model Management Update**
This release focuses on improving user accessibility, model management, and content generation capabilities based on community feedback.
### 🚀 Enhanced Model Accessibility
- **Free Abliterated Models**: Added `Qwen3-4B-abliterated-TIES` and `Qwen3-8B-abliterated-TIES` (nbeerbower) as default options
- **No Token Required**: These models provide uncensored performance without Hugging Face authentication
- **Smart Model Ordering**: 4B models prioritized before 8B for better VRAM accessibility
- **8-Bit Quantization Default**: Optimized VRAM usage for both VL and text models
**New Default Models:**
- **VL**: `Qwen3-VL-4B-Instruct-Abliterated` (8-bit quantized)
- **Text**: `Qwen3-4B-abliterated-TIES` (8-bit quantized, no token)
### 🔧 Improved Custom Prompt Logic
- **Template Combination**: Fixed custom prompts to combine with preset templates instead of replacing them
- **Consistent Behavior**: All nodes (HF, GGUF, PromptEnhancer) now handle custom prompts identically
- **Better UX**: Users can now add their input while keeping preset instructions intact
- **WAN 2.2 Compatibility**: Fixed I2V preset to work properly with custom user input
### 📝 Enhanced NSFW Content Generation
- **Comprehensive Descriptions**: Expanded NSFW rules to include detailed sexual act descriptions
- **Clear Instructions**: Added "body parts and acts being performed" specification
- **Complete Coverage**: Includes blowjob, paizuri, deepthroat, handjob, cunnilingus, anal, missionary, doggystyle, cowgirl, reverse cowgirl, masturbation, fingering, squirting, cumshot, facial
- **Applied Universally**: Enhanced both WAN 2.2 I2V and T2V presets
### 🎬 Preset Priority Optimization
- **WAN 2.2 I2V First**: Moved most-used video generation preset to top position
- **Better Workflow**: Faster access to primary video generation functionality
- **Maintained Order**: Preserved logical organization of remaining presets
### 🐛 Bug Fixes
- **Custom Prompt Override**: Fixed issue where custom prompts completely replaced preset templates
- **GGUF Consistency**: Applied same prompt logic fixes to GGUF nodes
- **Tooltip Updates**: Updated all custom prompt tooltips to reflect new behavior
- **JSON Validation**: Removed duplicate model entries for cleaner configuration
---
## Version 2.0.1-enhanced (2026/01/30)
🚀 **Major Performance & Video Generation Update**
This enhanced version introduces cutting-edge performance optimizations and comprehensive video generation capabilities, making it the most advanced QwenVL integration available.
### ⚡ SageAttention Integration
- **2-5x Performance Boost**: Added SageAttention support for 8-bit quantized attention computation
- **Automatic Detection**: System automatically detects SageAttention availability and GPU compatibility
- **Seamless Fallback**: Gracefully falls back to SDPA when SageAttention is unavailable
- **Memory Efficiency**: Reduced VRAM usage with quantized attention kernels
**Requirements:**
- NVIDIA GPU with capability >= 8.0 (RTX 30/40/50 series)
- CUDA >= 12.0
- sageattention package (optional)
### 🎬 WAN 2.2 Video Generation Integration
- **I2V Support**: Image-to-Video generation with cinematic timeline structure
- **T2V Support**: Text-to-Video generation with professional scene descriptions
- **5-Second Timeline**: Precise second-by-second scene progression
- **Multilingual**: Italian/English input to optimized English output
- **Cinematic Quality**: Film-style direction including lighting, camera, composition
**Available Prompts:**
- `🍿 Wan 2.2 I2V` - For image-to-video workflows in QwenVL nodes
- `🍿 Wan 2.2 T2V` - For text-to-video workflows in Prompt Enhancer nodes
### 🔧 Enhanced Compatibility
- **Transformers Compatibility**: Support for both old (`AutoModelForImageTextToText`) and new (`AutoModelForVision2Seq`) transformer versions
- **Attention Mode Selection**: Four modes available - auto, flash_attention_2, sdpa, sageattention
- **Custom Model Support**: Extended HF and GGUF model configurations
- **Improved Error Handling**: Better diagnostics and fallback mechanisms
### 📚 Documentation Updates
- **SageAttention Section**: Comprehensive installation and troubleshooting guide
- **WAN 2.2 Documentation**: Complete usage examples and best practices
- **Performance Comparisons**: Detailed benchmarks and requirements tables
- **Updated README**: Professional documentation with all new features
### 🏷️ Manager Integration
- **Custom Nodes JSON**: Prepared for ComfyUI Manager submission
- **Enhanced Tags**: Added wan2.2, video, i2v, t2v tags for better discoverability
- **Updated Metadata**: Comprehensive description highlighting all enhancements
---
# Release Notes: v2.0.0 (2025-12-22)
### New GGUF Nodes
We've expanded our GGUF model support with three powerful new nodes:
- **QwenVL (GGUF)** — Lightweight GGUF-based vision node for image/video understanding and text generation. Offers significantly faster inference speed compared to Transformers models, making it ideal for real-time workflows and resource-constrained environments.
- **QwenVL (GGUF) Advanced** — Enhanced GGUF vision node with additional controls for advanced users. Maintains the ultra-fast inference speed of GGUF while providing fine-tuned control over generation parameters.
- **Qwen Prompt Enhancer (GGUF)** — GGUF text-only node for intelligent prompt rewriting and enhancement (not a vision model). Delivers rapid prompt enhancement with minimal resource usage, perfect for iterative prompt refinement workflows.
- **Qwen Prompt Enhancer (Transformers)** — Uses Qwen3 transformer model to enhance and rewrite prompts. Analyzes your input prompt and intelligently expands it with better detail, structure, and clarity for improved generation quality. Offers full model capabilities with precise control over the enhancement process.

### Enhanced GPU Device Selection (Advanced Node)
The **QwenVL (Advanced)** node now offers flexible GPU device management:
- **Manual GPU selection** — Choose specific CUDA devices (e.g., `cuda:1`, `cuda:2`) instead of defaulting to `cuda:0`
- **Automatic device detection** — Dynamically discovers all available CUDA devices on your system
- **Improved device mapping** — More consistent behavior and better resource allocation
- **OOM prevention** — Route models to underutilized GPUs when your primary GPU is handling diffusion workloads
*Note: The basic QwenVL node continues to use automatic device selection for simplicity*
---
## ✨ Improvements
### GGUF: Quality and Usability
**Cleaner Outputs by Default:**
- Automatically removes common "thinking/planning" content and leaked tokens (`<think>`, `<im_start>`, `<im_end>`)
- Users now receive clean, usable prompt-only or answer-only text without manual filtering
**QwenVL (GGUF) Vision Node:**
- Model dropdown now displays actual `.gguf` filenames with automatic deduplication for easier model identification
- Enhanced download progress logging with clear status messages during model download and cache reuse
- Token generation speed reporting (`tok/s`) when available — helps compare different models and quantization levels

**Qwen Prompt Enhancer (GGUF):**
- Updated built-in presets to reduce "junk talk" and return clean enhanced prompts more consistently
- Refined system prompts that minimize verbose output
- More reliable prompt-only text generation

### Transformers Nodes: GPU and Attention Stability
**Advanced GPU Routing:**
- `QwenVL (Advanced)` supports selecting specific GPUs (e.g., `cuda:1`, `cuda:2`) to avoid OOM when GPU0 is busy
- Improved device-mapping logic for more consistent behavior across different hardware configurations
**Attention Backend Stability:**
- Flash-Attention auto mode now behaves safely across all platforms
- Gracefully falls back to SDPA when Flash-Attention dependencies are unavailable
- Prevents runtime errors from missing or incompatible Flash-Attention installations
---
## 🐛 Bug Fixes
### QwenVL (Transformers) Stability
- **Fixed:** Invalid CUDA device handling that caused crashes with incorrect device specifications (e.g., device `"0"` or malformed `device_map`)
Related issue: https://github.com/1038lab/ComfyUI-QwenVL/issues/21
- **Fixed:** Flash-Attention detection now restricted to Linux systems only, preventing Windows metadata errors
- **Fixed:** Flash-Attention auto mode fallback mechanism to eliminate runtime errors when dependencies are unavailable
---
## 📚 Documentation & Dependencies
### New Documentation
- **Added:** Comprehensive installation guide for vision-capable `llama-cpp-python`
See `docs/LLAMA_CPP_PYTHON_VISION_INSTALL.md` for:
- JamePeng fork wheel installation instructions (wheel source: https://github.com/JamePeng/llama-cpp-python/releases/)
- Handler verification steps
- Common numpy/OpenCV conflict resolution
### Dependencies
- **Added:** `hf_xet` to `requirements.txt` for improved Hugging Face download performance and to eliminate Xet fallback warnings
## Version 1.1.0 (2025/11/11)
⚡ Major Performance Optimization Update
This release introduces a full rework of the QwenVL runtime to significantly improve speed, stability, and GPU utilization.

### 🚀 Core Improvements
- **Flash Attention Integration (Auto Detection)**
Automatically leverages next-generation attention optimization for faster inference on supported GPUs, while falling back to SDPA when needed.
- **Attention Mode Selector**
Both QwenVL nodes expose the attention backend (auto / flash_attention_2 / sdpa) so users can quickly validate which mode performs best on their hardware without leaving the basic workflow view.
- **Precision Optimization**
Smarter internal precision handling improves throughput and keeps performance consistent across high-end and low-VRAM cards.
- **Runtime Acceleration**
The execution pipeline now keeps KV cache/device alignment always-on, cutting per-run overhead and reducing latency.
- **Caching System**
Models remain cached in memory between runs, drastically lowering reload times when prompts change.
- **Video Frame Optimization**
Streamlined frame sampling and preprocessing accelerate video-focused workflows.
- **Hardware Adaptation**
Smarter device detection ensures the best configuration across NVIDIA GPUs, Apple Silicon, and CPU fallback scenarios.
### 🧠 Developer Enhancements
- Unified model and processor loading with cleaner logging and fewer bottlenecks.
- Refined quantization and memory handling for better stability across quant modes.
- Improved fallback behavior when advanced GPU optimizations are unavailable.
### 💡 Compatibility
- Fully backward compatible with existing ComfyUI workflows.
- Retains both **QwenVL** and **QwenVL (Advanced)** nodes: the basic node now bundles the most useful speed controls, while the advanced node exposes every knob (quantization, attention, device, torch.compile) for deep tuning.
### 🔧 Recommended
- PyTorch ≥ 2.8.0
- CUDA 12.4 or later
- Flash Attention 2.x (optional, for maximum performance)
> Switching quantization or attention modes forces a one-time model reload and is expected behavior when comparing runtime profiles.
### Version 1.0.4 (2025/10/31)
🆕 **Custom Model Support Added**
- Users can now add their own **custom Qwen-VL or Hugging Face models**
by creating a `custom_models.json` file in the plugin directory.
These models will automatically appear in the model selection list.
- Added automatic merging of user-defined models from `custom_models.json`,
following the same flexible mechanism as in *ComfyUI-JoyCaption*.
- Added detailed documentation
👉 [`docs/custom_models.md`](./docs/custom_models.md)
and an editable example file [`custom_models_example.json`](./custom_models_example.json).
⚙️ **Dependency Update**
- Updated **Transformers** version requirement:
`transformers>=4.57.0` (was `>=4.40.0`)
to ensure full compatibility with **Qwen3-VL** models.
[Reference: Qwen3-VL](https://github.com/QwenLM/Qwen3-VL?tab=readme-ov-file#quickstart)
---
## Version 1.0.3 (2025/10/22)
- Added 8 more Qwen3-VL models 2B and 32B (FB16 and FP8 variants) have been integrated into our support list, catering to diverse requirements.
## Version 1.0.2 (2025/10/21)
- Integrated additional Qwen3-VL models
- Added Chinese language README (README_zh.md)
- Refined fine-tuning preset system prompt
## Version 1.0.1 (2025/10/17)
- Resolved various bugs
- Optimized video input logic
## v1.0.0 Initial Release (2025/10/17)
- Support for Qwen3-VL and Qwen2.5-VL series models.
- Automatic model downloading from Hugging Face.
- On-the-fly quantization (4-bit, 8-bit, FP16).
- Preset and Custom Prompt system for flexible and easy use.
- Includes both a standard and an advanced node for users of all levels.
- Hardware-aware safeguards for FP8 model compatibility.
- Image and Video (frame sequence) input support.
- "Keep Model Loaded" option for improved performance on sequential runs.
- Seed parameter for reproducible generation.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297# ComfyUI-QwenVL-Mod - Enhanced Vision-Language with WAN 2.2
**Version 2.2.4** (2026/03/13) - 🎬 Critical I2V Timeline Fixes & NSFW Presets Optimization
---
## 🌟 What is ComfyUI-QwenVL-Mod?
A powerful **enhanced vision-language node** for ComfyUI that combines Qwen3-VL models with professional WAN 2.2 video generation workflows. Features multilingual support, visual style detection, and NSFW capabilities for professional AI content creation.
**Think:** *"Your all-in-one solution for intelligent prompt enhancement and video generation with cutting-edge AI models!"*
---
## 🎬 Key Features
### **🚀 WAN 2.2 Video Generation**
- **Text-to-Video (T2V)**: Professional 5-second video generation
- **Image-to-Video (I2V)**: Advanced image animation with style detection
- **Story Generation**: 20-second continuous videos with 4 narrative segments
- **Storyboard Workflows**: Seamless storyboard-to-storyboard generation
- **Cinematic Video**: Professional cinematography specifications
### **🌐 Enhanced Capabilities**
- **Multilingual Support**: Process prompts from any language (Italian, English, etc.)
- **Visual Style Detection**: 12+ artistic styles (anime, 3D, pixel art, puppet animation, etc.)
- **Smart Prompt Caching**: Performance optimization with Fixed Seed Mode
- **GGUF Backend**: Efficient local model inference with quantization support
- **NSFW Support**: Comprehensive content generation without restrictions
### **🧠 Intelligent Features**
- **Auto-Prompt Enhancement**: Automatically enhance user prompts for optimal generation
- **Professional Cinematography**: Built-in specifications for lighting, camera angles, shot types
- **Timeline Structure**: Precise 5-second timeline with frame-by-frame descriptions
- **Keep Last Prompt**: Generate once, preserve results while changing inputs
---
## 🎯 What's New in v2.2.4 - CRITICAL I2V TIMELINE FIXES
### **🚨 Major I2V Timeline (20s) Fixes**
- **✅ Style Coherence**: Fixed AI changing anime→realism mid-sequence
- **✅ Character Stability**: Fixed characters disappearing/appearing incorrectly
- **✅ Natural Lighting**: Fixed AI adding artificial lights not in image
- **✅ Timeline Structure**: Fixed continuous numbering (6,7,8...) instead of 0-5 restart
- **✅ Format Consistency**: Fixed missing parentheses and unwanted labels
- **✅ Output Format**: Each prompt starts directly with timeline markers
### **🔧 NSFW Presets Optimization**
- **✅ Complete Specifications**: All 8 NSFW presets now include full NSFW descriptions
- **✅ Emoji Display**: Restored proper emoji rendering (🍿🎥🎬📖)
- **✅ Clear Instructions**: Removed confusing recommendations from presets
- **✅ User Guide**: Token settings guide created for workflow optimization
### **📋 Technical Improvements**
- **✅ Timeline Markers**: Correct `(At X seconds: ...)` format for all 4 prompts
- **✅ Character Continuity**: Natural progression without forced artificial presence
- **✅ Lighting Rules**: Logical progression instead of absolute prohibitions
- **✅ Style Detection**: Consistent style application across all timeline segments
### **🎯 Model Recommendations**
- **Qwen3-VL-8B**: Recommended for I2V Timeline (20s) complex sequences
- **Qwen3-VL-4B**: Sufficient for I2V Scene (5s) single prompts
- **Token Settings**: 2048+ for 20s timeline, 1024+ for 5s prompts
## 🎯 What's New in v2.2.3
- **CUDA 13 Compatibility**: Fixed crashes caused by conflicting unload operations
- **Parameter Cleanup**: Removed redundant unload_after_run from all nodes
- **Bug Fixes**: Resolved "missing required positional argument" errors
- **Memory Management**: Streamlined VRAM cleanup with VRAM Cleanup node
- **Documentation**: Updated all README files with new memory features
- **Credits**: Added community credits for feedback and testing
## 🎯 What's New in v2.2.2
### **🚀 Critical T2V/I2V Workflow Fixes**
- **Batch Processing**: Fixed critical T2V → GGUF issue with batch images
- **Frame Detection**: Added automatic batch detection and individual frame processing
- **Video Support**: Enhanced video frame processing with proper shape handling
- **Debug Enhanced**: Comprehensive logging for batch processing troubleshooting
### **🔄 Same Model Reuse Fix**
- **Conflict Resolution**: Fixed crash when using same model between T2V and I2V nodes
- **Memory Management**: Enhanced cleanup with CUDA synchronization and timing
- **Signature Mismatch**: Resolved different signature patterns between nodes
- **Aggressive Cleanup**: Forced complete VRAM cleanup before model reload
### **🔧 keep_model_loaded Enhancement**
- **Missing Parameter**: Added keep_model_loaded to PromptEnhancer node
- **Consistent Behavior**: Both GGUF and PromptEnhancer now have identical memory management
- **Conditional Cleanup**: Proper cleanup based on keep_model_loaded setting
- **User Control**: Full control over memory usage vs performance
---
## 🚨 CRITICAL BUG FIXES - v2.2.4
### **🎬 I2V Timeline (20s) - COMPLETELY FIXED**
**Before v2.2.4:**
- ❌ Anime style changed to realism mid-sequence
- ❌ Characters disappeared/appeared randomly
- ❌ AI added artificial lights not in image
- ❌ Timeline numbering: 6,7,8... instead of 0-5 restart
- ❌ Missing parentheses and unwanted "Prompt 1:" labels
**After v2.2.4:**
- ✅ **Perfect Style Coherence**: Anime stays anime, realism stays realism
- ✅ **Character Stability**: Same characters throughout all 4 prompts
- ✅ **Natural Lighting**: Only lights visible in image, logical progression
- ✅ **Correct Timeline**: Each prompt uses 0-5 seconds format
- ✅ **Clean Output**: Proper `(At X seconds: ...)` format, no labels
### **🔥 NSFW Presets - ENHANCED & FIXED**
- ✅ **Complete Specifications**: All 8 presets with full explicit descriptions
- ✅ **Emoji Display**: Proper 🍿🎥🎬📖 icons (no more unicode codes)
- ✅ **User-Friendly**: Removed confusing technical recommendations
- ✅ **Token Guide**: Workflow note for optimal settings
**🎯 Result**: Perfect I2V Timeline generation every time!
---
## 🎬 WAN 2.2 Story Workflow - Revolutionary AI Storytelling
### **📖 AI Story Generation**
- **4-Segment Videos**: Automatic 20-second videos (4 × 5-second segments)
- **Narrative Continuity**: Perfect story flow between segments
- **NSFW Support**: Enhanced adult content generation
- **Timeline-Free**: Natural storytelling without time markers
### **🔄 Smart Auto-Split**
- **Story Split Node**: Intelligent prompt separation technology
- **Auto-Detection**: Handles any separator format automatically
- **4-Output Guarantee**: Always produces exactly 4 prompts
- **Debug Mode**: Built-in troubleshooting information
---
## 📦 Installation
### **Requirements**
- **ComfyUI**: v0.13.0+
- **GPU**: 8GB+ VRAM (16GB+ recommended)
- **System**: Windows/Linux/Mac
- **Python**: 3.10+ (or use provided Docker environment)
### **Docker/Cloud Ready**
- **RunPod**: Pre-configured templates available
- **VastAI**: Optimized instances ready
- **Local**: Docker support included
### **Quick Install**
1. **Download**: ComfyUI-QwenVL-Mod (latest version)
2. **Extract** to `ComfyUI/custom_nodes/ComfyUI-QwenVL-Mod`
3. **Restart** ComfyUI
4. **Load** included workflows
---
## 🎮 Usage Examples
### **Basic Image-to-Video**
1. Load **WAN2.2-I2V-AutoPrompt.json**
2. Upload your image
3. Select model (HF or GGUF)
4. Generate enhanced video
### **Basic Text-to-Video**
1. Load **WAN2.2-T2V-AutoPrompt.json**
2. Input your text prompt
3. Select model (HF or GGUF)
4. Generate enhanced video
### **Image-to-Video with Style**
1. Load **WAN2.2-I2V-AutoPrompt.json**
2. Upload your image
3. Enable style detection
4. Generate animated video
### **AI Story Generation**
1. Load **WAN2.2-I2V-AutoPrompt-Story.json**
2. Input your story idea
3. Auto-split into 4 segments
4. Generate 20-second story video
---
## 🔧 Technical Specifications
### **⚡ Performance**
- **Context**: 65,536 tokens (8B models)
- **Memory**: Optimized VRAM usage
- **Stability**: Crash-free operation
- **Speed**: Fast generation times
### **🎨 Model Support**
- **Qwen3-VL 4B**: 7 GGUF variants (2.38GB-4.28GB)
- **Qwen3-VL 8B**: 7 GGUF variants (4.8GB-8.71GB)
- **HF Models**: Josiefed and official variants
- **Quantization**: Q4_K_S, Q5_K_S for VRAM efficiency
### **🌐 Multilingual Capabilities**
- **Input Languages**: Any language supported
- **Auto-Translation**: Automatic translation to optimized English
- **Style Detection**: Works with multilingual prompts
- **Cultural Adaptation**: Context-aware prompt enhancement
---
## 🎯 Included Workflows
### **🍿 WAN 2.2 Presets**
- **🍿 Wan 2.2 I2V Timeline**: Image-to-video with timeline structure
- **🎥 Wan 2.2 I2V Scene**: Image-to-video with professional specs
- **🍿 Wan 2.2 T2V Timeline**: Text-to-video with timeline structure
- **🎥 Wan 2.2 T2V Scene**: Text-to-video with professional specs
- **🎬 Wan 2.2 I2V Timeline**: 20-second multi-segment continuity
- **📖 Wan 2.2 I2V Scene**: 20-second single scene with cinematography
### **🔥 Advanced Features**
- **NSFW Enhancement**: Uncensored content generation
- **Professional Lighting**: 8 light types + 9 qualities
- **Camera Control**: 6 shot types + 5 compositions
- **Color Grading**: 4 tone options
---
## 🎨 Visual Style Detection
Automatically detects and enhances:
- **Photorealistic style** - Realistic lighting, natural textures, lifelike details
- **Anime style** - Japanese animation aesthetics with vibrant colors
- **Cartoon style** - Bold outlines, flat colors, exaggerated expressions
- **3D animation style** - Computer-generated 3D rendering characteristics
- **Fantasy style** - Magical elements, ethereal lighting, imaginative atmosphere
- **Artistic portrait style** - Painterly qualities, artistic brushwork, stylized composition
---
## 🔥 NSFW Content Support
### **Enhanced Generation**
- **Explicit Content**: Uncensored adult descriptions
- **Detailed Scenes**: 8-12 sentences per segment
- **Natural Progression**: Smooth story flow
- **Style Adaptation**: Automatic visual style matching
- **Quality**: Consistent characters & scenes
### **Professional Applications**
- **Adult Content**: Industry-standard generation
- **Artistic Nudity**: Classical art styles
- **Educational**: Anatomy and artistic study
- **Creative**: Artistic expression
---
## 🚀 Why Choose ComfyUI-QwenVL-Mod?
### **🎬 For Content Creators**
- **Storytelling**: Create compelling narratives
- **Efficiency**: One prompt → complete video
- **Quality**: Professional video output
- **Flexibility**: Any genre, any style
### **🔥 For NSFW Content**
- **Explicit**: Uncensored generation
- **Detailed**: Rich scene descriptions
- **Continuous**: Smooth story flow
- **Natural**: Realistic progression
### **⚡ For Power Users**
- **Customizable**: Easy to modify
- **Extendable**: Add more segments
- **Integrable**: Works with existing setups
- **Optimized**: Maximum performance
---
## 🌟 What Makes This Special?
- **First**: Complete AI story system with vision enhancement
- **Smart**: Intelligent prompt splitting and enhancement
- **Complete**: End-to-end solution from text to video
- **Optimized**: Performance-tuned for professional use
- **Ready**: Works out-of-the-box with included workflows
---
## 🎬 Create Amazing AI Videos Today!
Transform your ideas into stunning videos with the power of Qwen3-VL vision enhancement and WAN 2.2 video generation.
**Perfect for creators, artists, and professionals looking for the ultimate AI video enhancement tool!** 🌟
---
**Built with ❤️ for the ComfyUI community**123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179# ComfyUI - WAN 2.2 I2V/T2V - RTX 4090
> **[Create an Instance](https://cloud.vast.ai/?ref_id=188688&creator_id=188688&name=ComfyUI%20-%20WAN%202.2%20I2V%2FT2V%20-%20RTX%204090)**
## What is this template?
This template gives you a **complete AI video generation environment** optimized for RTX 4090 with ComfyUI running in a Docker container. Features QwenVL-Mod enhanced vision-language capabilities and professional WAN 2.2 video generation workflows.
**Think:** *"A visual programming environment for AI video generation - connect nodes to build any workflow you can imagine!"*
---
## What can I do with this?
### **🎬 WAN 2.2 Video Generation Workflows**
- **Text-to-Video (T2V)**: Generate professional 5-second videos from text prompts
- **Image-to-Video (I2V)**: Animate static images with automatic prompt enhancement
- **Storyboard Workflows**: Seamless storyboard-to-storyboard generation
- **Story Generation**: 4-segment continuous video stories
- **Cinematic Video**: Professional cinematography specifications
### **🌐 QwenVL-Mod Enhanced Features**
- **Multilingual Support**: Process prompts from any language with automatic translation
- **Visual Style Detection**: 12+ artistic styles (anime, 3D, pixel art, etc.)
- **Smart Prompt Caching**: Performance optimization with Fixed Seed Mode
- **GGUF Backend**: Efficient local model inference with quantization support
- **NSFW Support**: Comprehensive content generation without restrictions
### **🧠 Smart Prompt System**
- **Auto-Prompt Enhancement**: Automatically enhance user prompts for optimal video generation
- **Professional Cinematography**: Built-in specifications for lighting, camera angles
- **Timeline Structure**: Precise 5-second timeline with frame-by-frame descriptions
- **Fixed Seed Mode**: Maintain consistent prompts regardless of media variations
### **⚡ RTX 4090 Optimized Performance**
- **SageAttention + FP16**: Proven optimal for WAN2.2 video generation
- **CUDA 12.4 Compatibility**: Maximum stability and performance
- **Miniconda Environment**: Python 3.12.12 isolated environment
- **Hardware Optimization**: Automatic GPU detection and VRAM management
---
## Who is this for?
This is **perfect** if you:
- Want to use **QwenVL-Mod** with enhanced vision-language capabilities
- Need **professional WAN 2.2 video generation** with T2V and I2V workflows
- Have an **RTX 4090** and want maximum performance optimization
- Want **multilingual support** with automatic language detection
- Need **visual style detection** for anime, 3D, pixel art styles
- Want **Fixed Seed Mode** for consistent prompt generation
- Need **NSFW support** for comprehensive content generation
- Want **GGUF backend support** for efficient local model inference
- Are creating **professional video content** with cinematography specs
- Want **hardware-optimized performance** for RTX 4090
---
## Quick Start Guide
### **Step 1: Configure Your Setup**
Set your preferred configuration via environment variables:
- **`WORKSPACE`**: Custom workspace directory for your models and outputs
- **`PROVISIONING_SCRIPT`**: URL to auto-download models on first boot
- **`HF_TOKEN`**: Hugging Face token for downloading restricted models
- **`CIVITAI_TOKEN`**: CivitAI token for premium model downloads
> **🎬 Pre-installed QwenVL-Mod Workflows**: Complete WAN 2.2 video generation with auto-prompt enhancement:
> - **WAN 2.2 T2V**: Text-to-video with automatic prompt optimization
> - **WAN 2.2 I2V**: Image-to-video with style detection and enhancement
> - **WAN 2.2 T2V/I2V Story**: 4-segment continuous video stories
> - **WAN 2.2 I2V-SVI**: Advanced image-to-video with SVI processing
> - **WAN 2.2 T2V/I2V GGUF**: GGUF-optimized versions
> - **WAN 2.2 MMAudio**: Audio-enhanced video generation
> - **Wan Extended Storyboard**: Seamless storyboard sequences
> - **Multilingual Support**: Process prompts from any language
> - **Visual Style Detection**: Automatic detection of artistic styles
### **Step 2: Launch Instance**
Click **"[Rent](https://cloud.vast.ai/?ref_id=188688)"** when you've found a suitable RTX 4090 instance
### **Step 3: Wait for Setup**
ComfyUI will be ready automatically with all dependencies installed *(initial model downloads may take additional time)*
### **Step 4: Access Your Environment**
**Easy access:** Click the **"Open"** button for instant access to the ComfyUI interface!
**Direct access via mapped ports:**
- **ComfyUI:** `http://your-instance-ip:8188` (main interface)
- **JupyterLab:** `http://your-instance-ip:8888` (terminal access)
### **Step 5: Start Creating**
Load a workflow, download models via ComfyUI-Manager, and start generating!
---
## Key Features
### **ComfyUI-Manager & Pre-installed Nodes**
- **One-click model downloads** from CivitAI and Hugging Face
- **Custom node installation** from the community repository
- **Workflow management** and sharing tools
- **Automatic dependency resolution** for custom nodes
> **🚀 Pre-installed Custom Nodes**: 30+ essential custom nodes for professional video generation:
> - **ComfyUI-Manager**: Essential node management system
> - **ComfyUI-QwenVL-Mod**: Enhanced vision-language with WAN 2.2 workflows
> - **ComfyUI-GGUF**: GGUF model support for efficient inference
> - **ComfyUI-VideoHelperSuite**: Video processing utilities
> - **ComfyUI-Impact-Pack**: Advanced node functionality
> - **ComfyUI_essentials**: Essential utilities and helpers
> - **PainterI2V series**: Professional image-to-video workflows
> - **ComfyUI-WanMoeKSampler**: WAN model optimization
> - **ComfyUI-RIFE-TensorRT-Auto**: Advanced frame interpolation
> - **ComfyUI-MMAudio**: Audio processing capabilities
> - **ComfyUI-VFI**: Video frame interpolation
> - **Plus 20+ additional nodes** for professional workflows
### **Authentication & Access**
| Method | Use Case | Access Point |
|--------|----------|--------------|
| **Web Interface** | All ComfyUI operations | Click "Open" or port 8188 |
| **JupyterLab** | Terminal access & scripting | Port 8888 |
| **SSH Terminal** | System administration | [SSH access](https://docs.vast.ai/instances/sshscp) |
### **Port Reference**
| Service | External Port | Internal Port |
|---------|---------------|---------------|
| ComfyUI | 8188 | 18188 |
| JupyterLab | 8888 | 8080 |
---
## RTX 4090 Optimizations
### **Environment Variables Reference**
| Variable | Default | Description |
|----------|---------|-------------|
| `WORKSPACE` | `/workspace` | ComfyUI workspace directory |
| `COMFYUI_ARGS` | `--disable-auto-launch --port 18188 --enable-cors-header --fast fp16_accumulation --use-sage-attention --reserve-vram 2 --cuda-malloc --async-offload` | ComfyUI startup arguments optimized for RTX 4090 |
| `PROVISIONING_SCRIPT` | (none) | Auto-setup script URL |
| `HF_TOKEN` | (none) | Hugging Face token for restricted model downloads |
| `CIVITAI_TOKEN` | (none) | CivitAI token for premium model downloads |
### **Why These Settings?**
- **SageAttention + FP16**: Proven optimal for WAN2.2 video generation
- **Reserve VRAM 2GB**: Perfect balance for RTX 4090 + WAN2.2
- **Conda Isolation**: Prevents dependency conflicts with Python 3.12.12
- **CUDA 12.4**: Maximum compatibility and stability for RTX 4090
### **Recommended GPU Memory**
| Use Case | Minimum VRAM | Recommended VRAM |
|----------|--------------|------------------|
| SD 1.5 / SDXL | 8 GB | 12 GB |
| WAN 2.2 Video | 16 GB | 24 GB |
| Professional Workflows | 24 GB | 24 GB+ |
---
## Need More Help?
### **Documentation & Resources**
- **QwenVL-Mod Documentation:** [GitHub Repository](https://github.com/huchukato/ComfyUI-QwenVL-Mod)
- **ComfyUI Documentation:** [Official Repository](https://github.com/Comfy-Org/ComfyUI)
- **ComfyUI-Manager:** [Node and Model Manager](https://github.com/Comfy-Org/ComfyUI-Manager)
- **Vast.ai Documentation:** [Instance Portal Guide](https://docs.vast.ai/instance-portal)
### **Community & Support**
- **ComfyUI GitHub:** [Issues & Discussions](https://github.com/Comfy-Org/ComfyUI)
- **Vast.ai Support:** Use the messaging icon in the console
### **Getting Started Resources**
- **Example Workflows:** Pre-built WAN 2.2 workflows included
- **ComfyUI Examples:** [Community workflow gallery](https://comfyworkflows.com/)
- **Custom Nodes:** Thousands available via ComfyUI-Manager
---
**Built with ❤️ for the ComfyUI community - Optimized for RTX 4090**123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188# ComfyUI - WAN 2.2 I2V/T2V - RTX 5090 Blackwell
> **[Create an Instance](https://cloud.vast.ai/?ref_id=188688&creator_id=188688&name=ComfyUI%20-%20WAN%202.2%20I2V%2FT2V%20-%20RTX%205090%20Blackwell)**
## What is this template?
This template gives you a **complete AI video generation environment** optimized for RTX 5090 Blackwell with ComfyUI running in a Docker container. Features QwenVL-Mod enhanced vision-language capabilities and professional WAN 2.2 video generation workflows with next-gen GPU acceleration.
**Think:** *"A visual programming environment for AI video generation with cutting-edge RTX 5090 performance - connect nodes to build any workflow you can imagine!"*
---
## What can I do with this?
### **🎬 WAN 2.2 Video Generation Workflows**
- **Text-to-Video (T2V)**: Generate professional 5-second videos from text prompts
- **Image-to-Video (I2V)**: Animate static images with automatic prompt enhancement
- **Storyboard Workflows**: Seamless storyboard-to-storyboard generation
- **Story Generation**: 4-segment continuous video stories
- **Cinematic Video**: Professional cinematography specifications
### **🌐 QwenVL-Mod Enhanced Features**
- **Multilingual Support**: Process prompts from any language with automatic translation
- **Visual Style Detection**: 12+ artistic styles (anime, 3D, pixel art, etc.)
- **Smart Prompt Caching**: Performance optimization with Fixed Seed Mode
- **GGUF Backend**: Efficient local model inference with quantization support
- **NSFW Support**: Comprehensive content generation without restrictions
### **🧠 Smart Prompt System**
- **Auto-Prompt Enhancement**: Automatically enhance user prompts for optimal video generation
- **Professional Cinematography**: Built-in specifications for lighting, camera angles
- **Timeline Structure**: Precise 5-second timeline with frame-by-frame descriptions
- **Fixed Seed Mode**: Maintain consistent prompts regardless of media variations
### **⚡ RTX 5090 Blackwell Optimized Performance**
- **SageAttention + FP16**: Proven optimal for WAN2.2 video generation
- **FP8 Compute Support**: Leverages RTX 5090's hardware FP8 acceleration
- **CUDA 12.8 Next-Gen**: Latest optimizations for Blackwell architecture
- **Miniconda Environment**: Python 3.12.12 isolated environment
- **Hardware Optimization**: Automatic GPU detection and VRAM management
---
## Who is this for?
This is **perfect** if you:
- Want to use **QwenVL-Mod** with enhanced vision-language capabilities
- Need **professional WAN 2.2 video generation** with T2V and I2V workflows
- Have an **RTX 5090 Blackwell** and want cutting-edge performance
- Want **FP8 acceleration** for next-gen model inference
- Need **multilingual support** with automatic language detection
- Want **visual style detection** for anime, 3D, pixel art styles
- Need **NSFW support** for comprehensive content generation
- Want **GGUF backend support** for efficient local model inference
- Are creating **professional video content** with cinematography specs
- Want **maximum performance** with RTX 5090 Blackwell optimization
---
## Quick Start Guide
### **Step 1: Configure Your Setup**
Set your preferred configuration via environment variables:
- **`WORKSPACE`**: Custom workspace directory for your models and outputs
- **`PROVISIONING_SCRIPT`**: URL to auto-download models on first boot
- **`HF_TOKEN`**: Hugging Face token for downloading restricted models
- **`CIVITAI_TOKEN`**: CivitAI token for premium model downloads
> **🎬 Pre-installed QwenVL-Mod Workflows**: Complete WAN 2.2 video generation with auto-prompt enhancement:
> - **WAN 2.2 T2V**: Text-to-video with automatic prompt optimization
> - **WAN 2.2 I2V**: Image-to-video with style detection and enhancement
> - **WAN 2.2 T2V/I2V Story**: 4-segment continuous video stories
> - **WAN 2.2 I2V-SVI**: Advanced image-to-video with SVI processing
> - **WAN 2.2 T2V/I2V GGUF**: GGUF-optimized versions
> - **WAN 2.2 MMAudio**: Audio-enhanced video generation
> - **Wan Extended Storyboard**: Seamless storyboard sequences
> - **Multilingual Support**: Process prompts from any language
> - **Visual Style Detection**: Automatic detection of artistic styles
### **Step 2: Launch Instance**
Click **"[Rent](https://cloud.vast.ai/?ref_id=188688)"** when you've found a suitable RTX 5090 instance
### **Step 3: Wait for Setup**
ComfyUI will be ready automatically with all dependencies installed *(initial model downloads may take additional time)*
### **Step 4: Access Your Environment**
**Easy access:** Click the **"Open"** button for instant access to the ComfyUI interface!
**Direct access via mapped ports:**
- **ComfyUI:** `http://your-instance-ip:8188` (main interface)
- **JupyterLab:** `http://your-instance-ip:8888` (terminal access)
### **Step 5: Start Creating**
Load a workflow, download models via ComfyUI-Manager, and start generating!
---
## Key Features
### **ComfyUI-Manager & Pre-installed Nodes**
- **One-click model downloads** from CivitAI and Hugging Face
- **Custom node installation** from the community repository
- **Workflow management** and sharing tools
- **Automatic dependency resolution** for custom nodes
> **🚀 Pre-installed Custom Nodes**: 30+ essential custom nodes for professional video generation:
> - **ComfyUI-Manager**: Essential node management system
> - **ComfyUI-QwenVL-Mod**: Enhanced vision-language with WAN 2.2 workflows
> - **ComfyUI-GGUF**: GGUF model support for efficient inference
> - **ComfyUI-VideoHelperSuite**: Video processing utilities
> - **ComfyUI-Impact-Pack**: Advanced node functionality
> - **ComfyUI_essentials**: Essential utilities and helpers
> - **PainterI2V series**: Professional image-to-video workflows
> - **ComfyUI-WanMoeKSampler**: WAN model optimization
> - **ComfyUI-RIFE-TensorRT-Auto**: Advanced frame interpolation
> - **ComfyUI-MMAudio**: Audio processing capabilities
> - **ComfyUI-VFI**: Video frame interpolation
> - **Plus 20+ additional nodes** for professional workflows
### **Authentication & Access**
| Method | Use Case | Access Point |
|--------|----------|--------------|
| **Web Interface** | All ComfyUI operations | Click "Open" or port 8188 |
| **JupyterLab** | Terminal access & scripting | Port 8888 |
| **SSH Terminal** | System administration | [SSH access](https://docs.vast.ai/instances/sshscp) |
### **Port Reference**
| Service | External Port | Internal Port |
|---------|---------------|---------------|
| ComfyUI | 8188 | 18188 |
| JupyterLab | 8888 | 8080 |
---
## RTX 5090 Blackwell Optimizations
### **Environment Variables Reference**
| Variable | Default | Description |
|----------|---------|-------------|
| `WORKSPACE` | `/workspace` | ComfyUI workspace directory |
| `COMFYUI_ARGS` | `--disable-auto-launch --port 18188 --enable-cors-header --fast fp16_accumulation --use-sage-attention --reserve-vram 2 --cuda-malloc --async-offload --supports-fp8-compute` | ComfyUI startup arguments optimized for RTX 5090 |
| `PROVISIONING_SCRIPT` | (none) | Auto-setup script URL |
| `HF_TOKEN` | (none) | Hugging Face token for restricted model downloads |
| `CIVITAI_TOKEN` | (none) | CivitAI token for premium model downloads |
### **Why These Settings?**
- **SageAttention + FP16**: Proven optimal for WAN2.2 video generation
- **FP8 Support**: Leverages RTX 5090's hardware FP8 acceleration
- **Reserve VRAM 2GB**: Perfect balance for RTX 5090 + WAN2.2
- **Conda Isolation**: Prevents dependency conflicts with Python 3.12.12
- **CUDA 12.8**: Latest optimizations for Blackwell architecture
### **RTX 5090 Blackwell Advantages**
- **FP8 Compute**: Native hardware acceleration for FP8 models
- **Blackwell Architecture**: Next-gen GPU optimizations
- **Enhanced Memory Bandwidth**: Faster model loading and inference
- **Advanced Tensor Cores**: Optimized for AI workloads
### **Recommended GPU Memory**
| Use Case | Minimum VRAM | Recommended VRAM |
|----------|--------------|------------------|
| SD 1.5 / SDXL | 8 GB | 12 GB |
| WAN 2.2 Video | 16 GB | 24 GB |
| FP8 Models | 12 GB | 16 GB |
| Professional Workflows | 24 GB | 32 GB+ |
---
## Need More Help?
### **Documentation & Resources**
- **QwenVL-Mod Documentation:** [GitHub Repository](https://github.com/huchukato/ComfyUI-QwenVL-Mod)
- **ComfyUI Documentation:** [Official Repository](https://github.com/Comfy-Org/ComfyUI)
- **ComfyUI-Manager:** [Node and Model Manager](https://github.com/Comfy-Org/ComfyUI-Manager)
- **Vast.ai Documentation:** [Instance Portal Guide](https://docs.vast.ai/instance-portal)
### **Community & Support**
- **ComfyUI GitHub:** [Issues & Discussions](https://github.com/Comfy-Org/ComfyUI)
- **Vast.ai Support:** Use the messaging icon in the console
### **Getting Started Resources**
- **Example Workflows:** Pre-built WAN 2.2 workflows included
- **ComfyUI Examples:** [Community workflow gallery](https://comfyworkflows.com/)
- **Custom Nodes**: Thousands available via ComfyUI-Manager
---
**Built with ❤️ for the ComfyUI community - Optimized for RTX 5090 Blackwell**123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333#!/bin/bash
source /venv/main/bin/activate
COMFYUI_DIR=${WORKSPACE}/ComfyUI
APT_PACKAGES=(
"nodejs"
"npm"
)
PIP_PACKAGES=(
"--upgrade --force-reinstall --no-cache-dir https://github.com/JamePeng/llama-cpp-python/releases/download/v0.3.34-cu130-Basic-linux-20260331/llama_cpp_python-0.3.34+cu130.basic-cp312-cp312-linux_x86_64.whl"
)
NODES=(
"https://github.com/ltdrdata/ComfyUI-Manager"
"https://github.com/kijai/ComfyUI_essentials"
"https://github.com/huchukato/comfy-tagcomplete"
"https://github.com/huchukato/ComfyUI-QwenVL-Mod"
"https://github.com/huchukato/ComfyUI-RIFE-TensorRT-Auto"
"https://github.com/huchukato/ComfyUI-Upscaler-TensorRT-Auto"
"https://github.com/huchukato/ComfyUI-HuggingFace"
"https://github.com/MoonGoblinDev/Civicomfy"
"https://github.com/Koishi-Star/Euler-Smea-Dyn-Sampler"
"https://github.com/ltdrdata/was-node-suite-comfyui"
"https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite"
"https://github.com/rgthree/rgthree-comfy"
"https://github.com/yolain/ComfyUI-Easy-Use"
"https://github.com/kijai/ComfyUI-KJNodes"
"https://github.com/Fannovel16/ComfyUI-Frame-Interpolation"
"https://github.com/Smirnov75/ComfyUI-mxToolkit"
"https://github.com/princepainter/ComfyUI-PainterI2V"
"https://github.com/princepainter/ComfyUI-PainterLongVideo"
"https://github.com/ashtar1984/comfyui-find-perfect-resolution"
"https://github.com/huchukato/ComfyUI-Selectors"
"https://github.com/city96/ComfyUI-GGUF"
"https://github.com/kijai/ComfyUI-MMAudio"
"https://github.com/GACLove/ComfyUI-VFI"
"https://github.com/stduhpf/ComfyUI-WanMoeKSampler"
"https://github.com/melMass/comfy_mtb"
)
WORKFLOWS=(
"https://github.com/huchukato/ComfyUI-QwenVL-Mod/raw/main/vastai/workflows/PMP-LoRaStack-Upscale-Wildcards.json"
"https://github.com/huchukato/ComfyUI-QwenVL-Mod/raw/main/vastai/workflows/WAN2.2-I2V-AutoPrompt.json"
"https://github.com/huchukato/ComfyUI-QwenVL-Mod/raw/main/vastai/workflows/WAN2.2-I2V-AutoPrompt-GGUF.json"
"https://github.com/huchukato/ComfyUI-QwenVL-Mod/raw/main/vastai/workflows/WAN2.2-I2V-AutoPrompt-Story.json"
"https://github.com/huchukato/ComfyUI-QwenVL-Mod/raw/main/vastai/workflows/WAN2.2-I2V-Full-AutoPrompt-MMAudio.json"
"https://github.com/huchukato/ComfyUI-QwenVL-Mod/raw/main/vastai/workflows/WAN2.2-I2V-Full-AutoPrompt-MMAudio-GGUF.json"
"https://github.com/huchukato/ComfyUI-QwenVL-Mod/raw/main/vastai/workflows/WAN2.2-I2V-SVI-AutoPrompt.json"
"https://github.com/huchukato/ComfyUI-QwenVL-Mod/raw/main/vastai/workflows/WAN2.2-I2V-SVI-AutoPrompt-GGUF.json"
"https://github.com/huchukato/ComfyUI-QwenVL-Mod/raw/main/vastai/workflows/WAN2.2-I2V-SVI-AutoPrompt-Story.json"
"https://github.com/huchukato/ComfyUI-QwenVL-Mod/raw/main/vastai/workflows/WAN2.2-T2V-AutoPrompt.json"
"https://github.com/huchukato/ComfyUI-QwenVL-Mod/raw/main/vastai/workflows/WAN2.2-T2V-AutoPrompt-GGUF.json"
"https://github.com/huchukato/ComfyUI-QwenVL-Mod/raw/main/vastai/workflows/WAN2.2-T2V-I2V-AutoPrompt-Story.json"
"https://github.com/huchukato/ComfyUI-QwenVL-Mod/raw/main/vastai/workflows/WAN2.2-T2V-I2V-Full-AutoPrompt-MMAudio-GGUF.json"
)
CHECKPOINT_MODELS=(
)
UNET_MODELS=(
)
LORA_MODELS=(
)
VAE_MODELS=(
"https://huggingface.co/Comfy-Org/Wan_2.2_ComfyUI_Repackaged/resolve/main/split_files/vae/wan_2.1_vae.safetensors"
"https://huggingface.co/Kijai/WanVideo_comfy/resolve/main/Wan2_1_VAE_fp32.safetensors"
"https://huggingface.co/huchukato/favs/resolve/main/VAE/sdxl.vae.safetensors"
)
ESRGAN_MODELS=(
"https://huggingface.co/huchukato/favs/resolve/main/ESRGAN/2xLexicaRRDBNet.pth"
"https://huggingface.co/huchukato/favs/resolve/main/ESRGAN/2xLexicaRRDBNet_Sharp.pth"
)
TEXT_ENCODERS=(
"https://huggingface.co/NSFW-API/NSFW-Wan-UMT5-XXL/resolve/main/nsfw_wan_umt5-xxl_fp8_scaled.safetensors"
"https://huggingface.co/Comfy-Org/Wan_2.1_ComfyUI_repackaged/resolve/main/split_files/text_encoders/umt5_xxl_fp8_e4m3fn_scaled.safetensors"
)
CONTROLNET_MODELS=(
)
### DO NOT EDIT BELOW HERE UNLESS YOU KNOW WHAT YOU ARE DOING ###
function provisioning_start() {
provisioning_print_header
echo "🚀 Starting provisioning process..."
echo "📦 Installing APT packages..."
provisioning_get_apt_packages
echo "🔧 Installing custom nodes..."
provisioning_get_nodes
echo "🎴 Copying wildcards to Easy-Use..."
provisioning_copy_wildcards
echo "📦 Installing PIP packages..."
provisioning_get_pip_packages
echo "📁 Downloading workflows..."
# Create workflows directory
mkdir -p "${COMFYUI_DIR}/user/default/workflows"
provisioning_get_files \
"${COMFYUI_DIR}/user/default/workflows" \
"${WORKFLOWS[@]}"
echo "✅ Workflows downloaded to: ${COMFYUI_DIR}/user/default/workflows"
echo "🎯 Downloading checkpoint models..."
provisioning_get_files \
"${COMFYUI_DIR}/models/checkpoints" \
"${CHECKPOINT_MODELS[@]}"
echo "🧠 Downloading U-NET models..."
provisioning_get_files \
"${COMFYUI_DIR}/models/unet" \
"${UNET_MODELS[@]}"
echo "🎨 Downloading LoRA models..."
provisioning_get_files \
"${COMFYUI_DIR}/models/lora" \
"${LORA_MODELS[@]}"
echo "🎮 Downloading ControlNet models..."
provisioning_get_files \
"${COMFYUI_DIR}/models/controlnet" \
"${CONTROLNET_MODELS[@]}"
echo "🔮 Downloading VAE models..."
provisioning_get_files \
"${COMFYUI_DIR}/models/vae" \
"${VAE_MODELS[@]}"
echo "⚡ Downloading upscale models..."
provisioning_get_files \
"${COMFYUI_DIR}/models/upscale_models" \
"${ESRGAN_MODELS[@]}"
echo "📝 Downloading text encoders..."
provisioning_get_files \
"${COMFYUI_DIR}/models/text_encoders" \
"${TEXT_ENCODERS[@]}"
provisioning_print_end
}
function provisioning_get_apt_packages() {
if [[ -n $APT_PACKAGES ]]; then
sudo $APT_INSTALL ${APT_PACKAGES[@]}
fi
}
function provisioning_get_pip_packages() {
if [[ -n $PIP_PACKAGES ]]; then
echo "Installing PIP packages..."
for package in "${PIP_PACKAGES[@]}"; do
echo "Installing: $package"
pip install --root-user-action=ignore --no-cache-dir $package
echo "✓ Completed: $package"
done
echo "All PIP packages installed successfully!"
fi
}
function provisioning_get_nodes() {
echo "Processing ${#NODES[@]} nodes..."
local count=0
for repo in "${NODES[@]}"; do
((count++))
dir="${repo##*/}"
path="${COMFYUI_DIR}/custom_nodes/${dir}"
requirements="${path}/requirements.txt"
echo "[$count/${#NODES[@]}] Processing node: $dir"
if [[ -d $path ]]; then
if [[ ${AUTO_UPDATE,,} != "false" ]]; then
echo " → Updating existing node..."
( cd "$path" && git pull )
if [[ -e $requirements ]]; then
echo " → Installing requirements..."
pip install --root-user-action=ignore --no-cache-dir -r "$requirements"
fi
else
echo " → Node exists, skipping (AUTO_UPDATE=false)"
fi
else
echo " → Downloading new node..."
git clone "${repo}" "${path}" --recursive
if [[ -e $requirements ]]; then
echo " → Installing requirements..."
pip install --root-user-action=ignore --no-cache-dir -r "${requirements}"
fi
fi
# Special handling for ComfyUI-Easy-Use-Frontend
if [[ "$dir" == "ComfyUI-Easy-Use" ]]; then
echo " → Installing ComfyUI-Easy-Use-Frontend..."
cd "${path}"
if [[ ! -d "ComfyUI-Easy-Use-Frontend" ]]; then
git clone https://github.com/yolain/ComfyUI-Easy-Use-Frontend.git
fi
cd ComfyUI-Easy-Use-Frontend
if [[ ! -d "node_modules" ]]; then
echo " → Installing npm dependencies..."
npm install
fi
echo " → Building frontend..."
npm run build:dev
# Create config.yaml with WEB_VERSION: dev
if [[ ! -f "${path}/config.yaml" ]]; then
echo "WEB_VERSION: dev" > "${path}/config.yaml"
fi
cd "${COMFYUI_DIR}"
fi
done
echo "All nodes processed successfully!"
}
function provisioning_copy_wildcards() {
echo "Copying wildcards from comfy-tagcomplete to Easy-Use..."
local source_dir="${COMFYUI_DIR}/custom_nodes/comfy-tagcomplete/wildcards/mbe"
local target_dir="${COMFYUI_DIR}/custom_nodes/ComfyUI-Easy-Use/wildcards"
# Create target directory if it doesn't exist
mkdir -p "$target_dir"
# Copy the entire mbe directory
if [[ -d "$source_dir" ]]; then
echo " → Copying mbe wildcards..."
cp -r "$source_dir" "$target_dir/"
echo " ✓ Wildcards copied successfully to $target_dir/mbe"
else
echo " ⚠ Source directory not found: $source_dir"
echo " → Trying alternative path..."
# Try alternative path if comfy-tagcomplete is in workspace
local alt_source_dir="/workspace/comfy-tagcomplete/wildcards/mbe"
if [[ -d "$alt_source_dir" ]]; then
echo " → Found at alternative path, copying..."
cp -r "$alt_source_dir" "$target_dir/"
echo " ✓ Wildcards copied successfully from alternative path"
else
echo " ⚠ Source directory not found at: $alt_source_dir"
fi
fi
}
function provisioning_get_files() {
if [[ -z $2 ]]; then return 1; fi
dir="$1"
mkdir -p "$dir"
shift
arr=("$@")
echo "Downloading ${#arr[@]} file(s) to $dir..."
local count=0
for url in "${arr[@]}"; do
((count++))
echo "[$count/${#arr[@]}] Downloading: $(basename "$url")"
provisioning_download "${url}" "${dir}"
echo " ✓ Download completed"
done
echo "All files downloaded successfully!"
}
function provisioning_print_header() {
printf "\n##############################################\n# #\n# Provisioning container #\n# #\n# This will take some time #\n# #\n# Your container will be ready on completion #\n# #\n##############################################\n\n"
}
function provisioning_print_end() {
printf "\nProvisioning complete: Application will start now\n\n"
}
function provisioning_has_valid_hf_token() {
[[ -n "$HF_TOKEN" ]] || return 1
url="https://huggingface.co/api/whoami-v2"
response=$(curl -o /dev/null -s -w "%{http_code}" -X GET "$url" \
-H "Authorization: Bearer $HF_TOKEN" \
-H "Content-Type: application/json")
# Check if the token is valid
if [ "$response" -eq 200 ]; then
return 0
else
return 1
fi
}
function provisioning_has_valid_civitai_token() {
[[ -n "$CIVITAI_TOKEN" ]] || return 1
url="https://civitai.com/api/v1/models?hidden=1&limit=1"
response=$(curl -o /dev/null -s -w "%{http_code}" -X GET "$url" \
-H "Authorization: Bearer $CIVITAI_TOKEN" \
-H "Content-Type: application/json")
# Check if the token is valid
if [ "$response" -eq 200 ]; then
return 0
else
return 1
fi
}
# Download from $1 URL to $2 file path
function provisioning_download() {
if [[ -n $HF_TOKEN && $1 =~ ^https://([a-zA-Z0-9_-]+\\.)?huggingface\\.co(/|$|\\?) ]]; then
auth_token="$HF_TOKEN"
elif
[[ -n $CIVITAI_TOKEN && $1 =~ ^https://([a-zA-Z0-9_-]+\\.)?civitai\\.com(/|$|\\?) ]]; then
auth_token="$CIVITAI_TOKEN"
fi
if [[ -n $auth_token ]];then
wget --header="Authorization: Bearer $auth_token" --content-disposition -e dotbytes="${3:-4M}" -P "$2" "$1"
else
wget --content-disposition -e dotbytes="${3:-4M}" -P "$2" "$1"
fi
}
# Allow user to disable provisioning if they started with a script they didn't want
if [[ ! -f /.noprovisioning ]]; then
provisioning_start
fi1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253{
"name": "ComfyUI - Wan 2.2 I2V/T2V - 5090 Blackwell",
"description": "Complete AI video generation environment with ComfyUI, QwenVL-Mod enhanced vision-language capabilities, and WAN 2.2 workflows. Features professional video generation, multilingual support, visual style detection, and pre-installed custom nodes.",
"version": "1.0.0",
"author": "huchukato",
"referral_id": "188688",
"creator_id": "188688",
"tags": [
"comfyui",
"wan2.2",
"video-generation",
"qwenvl-mod",
"vision-language",
"multilingual",
"style-detection",
"professional",
"5090-blackwell",
"rtx-5090"
],
"features": {
"gpu_optimized": true,
"pre_installed_nodes": 30,
"pre_installed_workflows": 9,
"pre_installed_models": true,
"multilingual_support": true,
"style_detection": true,
"nsfw_support": true,
"gguf_backend": true
},
"requirements": {
"min_vram": "24GB",
"recommended_gpu": "RTX 5090",
"cuda_version": "13.0+"
},
"provisioning": {
"script_url": "https://github.com/huchukato/ComfyUI-QwenVL-Mod/raw/main/vastai/provisioning.sh",
"supports_tokens": ["HF_TOKEN", "CIVITAI_TOKEN"],
"auto_download": true
},
"links": {
"repository": "https://github.com/huchukato/ComfyUI-QwenVL-Mod",
"documentation": "https://github.com/huchukato/ComfyUI-QwenVL-Mod/tree/main/vastai",
"issues": "https://github.com/huchukato/ComfyUI-QwenVL-Mod/issues"
},
"environment_variables": {
"WORKSPACE": "/workspace",
"COMFYUI_ARGS": "--disable-auto-launch --port 18188 --enable-cors-header --fast fp16_accumulation --use-sage-attention --reserve-vram 2 --cuda-malloc --async-offload --supports-fp8-compute --fast cublas_ops autotune",
"PROVISIONING_SCRIPT": "https://github.com/huchukato/ComfyUI-QwenVL-Mod/raw/main/vastai/provisioning.sh",
"HF_TOKEN": null,
"CIVITAI_TOKEN": null,
"ENABLE_HTTPS": false
}
}12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433{
"id": "1b578592-cf47-47b6-b25b-2dc036abe2b9",
"revision": 0,
"last_node_id": 73,
"last_link_id": 113,
"nodes": [
{
"id": 60,
"type": "UpscalerTensorrt",
"pos": [
567.3352261115999,
-348.16287035549607
],
"size": [
270,
76
],
"flags": {},
"order": 8,
"mode": 4,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 108
},
{
"name": "upscaler_trt_model",
"type": "UPSCALER_TRT_MODEL",
"link": 97
}
],
"outputs": [
{
"name": "upscaled_images",
"type": "IMAGE",
"links": [
99
]
}
],
"properties": {
"aux_id": "yuvraj108c/ComfyUI-Upscaler-Tensorrt",
"ver": "dfc266538368e4c9a03a296917716a214517ccb5",
"Node name for S&R": "UpscalerTensorrt",
"cnr_id": "ComfyUI-Upscaler-Tensorrt"
},
"widgets_values": [
"2x",
1024,
1024
]
},
{
"id": 61,
"type": "LoadUpscalerTensorrtModel",
"pos": [
564.060520500804,
-474.54939485833273
],
"size": [
295.4078125,
82
],
"flags": {},
"order": 0,
"mode": 4,
"inputs": [],
"outputs": [
{
"name": "upscaler_trt_model",
"type": "UPSCALER_TRT_MODEL",
"links": [
97
]
}
],
"properties": {
"aux_id": "yuvraj108c/ComfyUI-Upscaler-Tensorrt",
"ver": "dfc266538368e4c9a03a296917716a214517ccb5",
"Node name for S&R": "LoadUpscalerTensorrtModel",
"cnr_id": "ComfyUI-Upscaler-Tensorrt"
},
"widgets_values": [
"4x-UltraSharp",
"fp16"
]
},
{
"id": 56,
"type": "ModelPatchTorchSettings",
"pos": [
295.48913069329427,
-386.7534007801243
],
"size": [
252.095703125,
50.00000000000001
],
"flags": {
"collapsed": true
},
"order": 7,
"mode": 4,
"inputs": [
{
"name": "model",
"type": "MODEL",
"link": 89
}
],
"outputs": [
{
"name": "MODEL",
"type": "MODEL",
"links": [
105
]
}
],
"properties": {
"cnr_id": "comfyui-kjnodes",
"ver": "a6b867b63a29ca48ddb15c589e17a9f2d8530d57",
"Node name for S&R": "ModelPatchTorchSettings",
"aux_id": "kijai/ComfyUI-KJNodes",
"ue_properties": {
"version": "7.0.1",
"widget_ue_connectable": {
"enable_fp16_accumulation": true
}
}
},
"widgets_values": [
true
]
},
{
"id": 55,
"type": "PathchSageAttentionKJ",
"pos": [
303.99544319329857,
-455.2540804676254
],
"size": [
270,
82
],
"flags": {
"collapsed": true
},
"order": 6,
"mode": 4,
"inputs": [
{
"name": "model",
"type": "MODEL",
"link": 100
}
],
"outputs": [
{
"name": "MODEL",
"type": "MODEL",
"links": [
89
]
}
],
"properties": {
"cnr_id": "comfyui-kjnodes",
"ver": "47ca2b2c26358615974162059061e9dc78be6715",
"Node name for S&R": "PathchSageAttentionKJ",
"aux_id": "kijai/ComfyUI-KJNodes"
},
"widgets_values": [
"auto",
false
]
},
{
"id": 53,
"type": "Power Lora Loader (rgthree)",
"pos": [
-102.0067913671858,
-522.9420133515614
],
"size": [
353.4815742187501,
281.88457421875
],
"flags": {},
"order": 5,
"mode": 0,
"inputs": [
{
"dir": 3,
"name": "model",
"shape": 7,
"type": "MODEL",
"link": 106
},
{
"dir": 3,
"name": "clip",
"shape": 7,
"type": "CLIP",
"link": 107
}
],
"outputs": [
{
"dir": 4,
"name": "MODEL",
"type": "MODEL",
"links": [
100
]
},
{
"dir": 4,
"name": "CLIP",
"type": "CLIP",
"links": [
104
]
}
],
"properties": {
"cnr_id": "rgthree-comfy",
"ver": "1.0.2512112053",
"Show Strengths": "Single Strength",
"aux_id": "rgthree/rgthree-comfy",
"Node name for S&R": "Power Lora Loader (rgthree)"
},
"widgets_values": [
{},
{
"type": "PowerLoraLoaderHeaderWidget"
},
{},
""
],
"color": "#323",
"bgcolor": "#535"
},
{
"id": 29,
"type": "SaveImage",
"pos": [
-830,
-520
],
"size": [
690,
1080
],
"flags": {
"collapsed": false
},
"order": 4,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 99
}
],
"outputs": [],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.67",
"Node name for S&R": "SaveImage"
},
"widgets_values": [
"PMP/%date:yyyy-MM-dd%/%date:hhmmss%"
],
"color": "#233",
"bgcolor": "#355"
},
{
"id": 67,
"type": "UpscaleModelLoader",
"pos": [
904.8345218873754,
-477.0575307403929
],
"size": [
270,
58
],
"flags": {},
"order": 1,
"mode": 4,
"inputs": [],
"outputs": [
{
"name": "UPSCALE_MODEL",
"type": "UPSCALE_MODEL",
"links": [
109
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.14.1",
"Node name for S&R": "UpscaleModelLoader"
},
"widgets_values": [
"2xLexicaRRDBNet.pth"
],
"color": "#323",
"bgcolor": "#535"
},
{
"id": 68,
"type": "ImageUpscaleWithModel",
"pos": [
913.3251468873724,
-365.91885886539256
],
"size": [
233.5689453125,
46
],
"flags": {
"collapsed": true
},
"order": 10,
"mode": 4,
"inputs": [
{
"name": "upscale_model",
"type": "UPSCALE_MODEL",
"link": 109
},
{
"name": "image",
"type": "IMAGE",
"link": 110
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
111
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.14.1",
"Node name for S&R": "ImageUpscaleWithModel"
},
"widgets_values": [],
"color": "#323",
"bgcolor": "#535"
},
{
"id": 69,
"type": "ImageScaleBy",
"pos": [
914.3649906373757,
-312.34971824039127
],
"size": [
270,
82
],
"flags": {
"collapsed": true
},
"order": 11,
"mode": 4,
"inputs": [
{
"name": "image",
"type": "IMAGE",
"link": 111
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": null
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.14.1",
"Node name for S&R": "ImageScaleBy"
},
"widgets_values": [
"nearest-exact",
1
],
"color": "#323",
"bgcolor": "#535"
},
{
"id": 62,
"type": "Fast Groups Bypasser (rgthree)",
"pos": [
-1333.2203835227303,
473.0453480113651
],
"size": [
480,
130
],
"flags": {},
"order": 2,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "OPT_CONNECTION",
"type": "*",
"links": null
}
],
"properties": {
"matchColors": "",
"matchTitle": "",
"showNav": true,
"showAllGraphs": true,
"sort": "position",
"customSortAlphabet": "",
"toggleRestriction": "default"
},
"color": "#322",
"bgcolor": "#533"
},
{
"id": 66,
"type": "MarkdownNote",
"pos": [
-1340,
-520
],
"size": [
486.92212063569946,
935.309829500961
],
"flags": {},
"order": 3,
"mode": 0,
"inputs": [],
"outputs": [],
"title": "README",
"properties": {},
"widgets_values": [
"# PIMPMYPONY TXT2IMG with WILDCARDS support\n\n## 🖥️ Civitai Model \n\n \n- [🔗 PimpMyPony - Real Anime](https://civitai.com/models/1195827?modelVersionId=2628215)\n- [🔗 PimpMyPony - InCase Style](https://civitai.com/models/1195827?modelVersionId=2611135)\n- [🔗 PimpMyPony - Semi Real Anime](https://civitai.com/models/1195827?modelVersionId=1346446)\n\n---\n\n## ⬆️ UPSCALE MODEL\n\n- [🔗 2xLexicaRRDBNet](https://huggingface.co/huchukato/favs/resolve/main/ESRGAN/2xLexicaRRDBNet.pth)\n- [🔗 2xLexicaRRDBNet_Sharp](https://huggingface.co/huchukato/favs/resolve/main/ESRGAN/2xLexicaRRDBNet_Sharp.pth)\n\n---\n\n## 🎛️ AutoTag Node with Wildcards included\nInstall it from ComfyUI Manager or clone the repo\n```\ncd ComfyUI/custom_nodes\ngit clone https://github.com/huchukato/comfy-tagcomplete.git\n```\n\n✨ New in v2.0.0 - Wildcard Sub-Selection\nThis version introduces a1111-sd-webui-tagcomplete style wildcard sub-selection, making wildcard usage more intuitive and powerful:\n\n🎯 Wildcard Workflow\n- Type __ to see available wildcards\n- Select a wildcard with arrow keys and press Enter → inserts __wildcard_name__\n- Auto-show options → immediately displays all options from that wildcard\n- Select an option with arrow keys and press Enter → replaces wildcard with chosen option\nESC → keeps inserted wildcard and closes options\n\n🌟 Features\n- Smart parsing: Handles wildcards with complex paths (e.g., __mbe/blwjob/blwjb__)\n- Line-by-line options: Each line in wildcard file becomes a separate option\n- Text overflow handling: Long options are truncated with hover expansion\n- Full compatibility: Works with existing wildcard files and formats\n- Multiple sources: Supports wildcards from repository, ComfyUI/models, DynamicPrompts, and Impact-Pack\n\n📁 Wildcard Sources (in priority order):\n- Repository wildcards/ folder\n- ComfyUI models/wildcards/\n- ComfyUI custom_nodes/wildcards/\n- DynamicPrompts wildcards/\n- Extra model paths configuration\n- Impact-Pack wildcards\n- Impact-Pack.ini custom paths\n\nThis extension is based on ComfyUI-Custom-Scripts.\n\n## 📁 Manual Wildcard Setup (Optional)\n\nIf you're installing manually or want to use wildcards with Easy-Use, you may need to copy the wildcards folder:\n\n1. **Copy wildcards to Impact Pack:**\n ```bash\n cp -r /path/to/comfy-tagcomplete/wildcards /path/to/ComfyUI/custom_nodes/ComfyUI-Easy-Use/wildcards/\n ```\n\n2. **Restart ComfyUI** to load the new wildcards\n\n"
],
"color": "#2a363b",
"bgcolor": "#3f5159"
},
{
"id": 65,
"type": "a4600bd6-aa63-44f0-9811-40520958a8aa",
"pos": [
-100,
-180
],
"size": [
970,
740
],
"flags": {},
"order": 9,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 104
},
{
"name": "model",
"type": "MODEL",
"link": 105
}
],
"outputs": [
{
"name": "MODEL",
"type": "MODEL",
"links": [
106
]
},
{
"name": "CLIP",
"type": "CLIP",
"links": [
107
]
},
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
108,
110
]
}
],
"properties": {
"proxyWidgets": [
[
"72",
"text"
],
[
"66",
"text"
],
[
"31",
"text"
],
[
"4",
"ckpt_name"
],
[
"3",
"steps"
],
[
"3",
"cfg"
],
[
"3",
"sampler_name"
],
[
"3",
"scheduler"
],
[
"54",
"dimensions"
],
[
"54",
"invert"
]
],
"cnr_id": "comfy-core",
"ver": "0.13.0"
},
"widgets_values": [],
"color": "#2a363b",
"bgcolor": "#3f5159"
}
],
"links": [
[
89,
55,
0,
56,
0,
"MODEL"
],
[
97,
61,
0,
60,
1,
"UPSCALER_TRT_MODEL"
],
[
99,
60,
0,
29,
0,
"IMAGE"
],
[
100,
53,
0,
55,
0,
"MODEL"
],
[
104,
53,
1,
65,
0,
"CLIP"
],
[
105,
56,
0,
65,
1,
"MODEL"
],
[
106,
65,
0,
53,
0,
"MODEL"
],
[
107,
65,
1,
53,
1,
"CLIP"
],
[
108,
65,
2,
60,
0,
"IMAGE"
],
[
109,
67,
0,
68,
0,
"UPSCALE_MODEL"
],
[
110,
65,
2,
68,
1,
"IMAGE"
],
[
111,
68,
0,
69,
0,
"IMAGE"
]
],
"groups": [
{
"id": 1,
"title": "UPSCALE TENSORRT",
"bounding": [
548.5196248147214,
-554.9015506331912,
324.62002840909065,
298.9312784090913
],
"color": "#A88",
"font_size": 24,
"flags": {}
},
{
"id": 2,
"title": "ACCELERATION",
"bounding": [
281.16338069329424,
-557.6629515613764,
240.68673437500001,
302.6915820312511
],
"color": "#A88",
"font_size": 24,
"flags": {}
},
{
"id": 3,
"title": "UPSCALE",
"bounding": [
894.5423343873756,
-550.6575307403934,
290.0472656249997,
292.94218750000175
],
"color": "#A88",
"font_size": 24,
"flags": {}
}
],
"definitions": {
"subgraphs": [
{
"id": "a4600bd6-aa63-44f0-9811-40520958a8aa",
"version": 1,
"state": {
"lastGroupId": 3,
"lastNodeId": 73,
"lastLinkId": 113,
"lastRerouteId": 0
},
"revision": 0,
"config": {},
"name": "PROMPTING",
"inputNode": {
"id": -10,
"bounding": [
-283.5137023925781,
216.37582179406013,
120,
80
]
},
"outputNode": {
"id": -20,
"bounding": [
1108.527587890625,
206.37582179406013,
120,
100
]
},
"inputs": [
{
"id": "7a99d9d2-4602-49f4-935b-0a746c8c4e3c",
"name": "clip",
"type": "CLIP",
"linkIds": [
82,
108
],
"localized_name": "clip",
"pos": [
-183.51370239257812,
236.37582179406013
]
},
{
"id": "3ed2c6d7-0895-4255-9b3a-8efc8a537b16",
"name": "model",
"type": "MODEL",
"linkIds": [
90
],
"localized_name": "model",
"pos": [
-183.51370239257812,
256.37582179406013
]
}
],
"outputs": [
{
"id": "019e8a38-b0eb-4b1b-852d-d9858ab0a07c",
"name": "MODEL",
"type": "MODEL",
"linkIds": [
78
],
"localized_name": "MODEL",
"pos": [
1128.527587890625,
226.37582179406013
]
},
{
"id": "36d81dba-3229-46b5-9abc-1a17b379d6d4",
"name": "CLIP",
"type": "CLIP",
"linkIds": [
80
],
"localized_name": "CLIP",
"pos": [
1128.527587890625,
246.37582179406013
]
},
{
"id": "e0014d05-63dc-4b5a-97ec-9f60cb2aa041",
"name": "IMAGE",
"type": "IMAGE",
"linkIds": [
98
],
"localized_name": "IMAGE",
"pos": [
1128.527587890625,
266.37582179406013
]
}
],
"widgets": [],
"nodes": [
{
"id": 4,
"type": "CheckpointLoaderSimple",
"pos": [
-102.09164215087836,
378.7225976562511
],
"size": [
315,
98
],
"flags": {},
"order": 0,
"mode": 0,
"inputs": [],
"outputs": [
{
"localized_name": "MODEL",
"name": "MODEL",
"type": "MODEL",
"slot_index": 0,
"links": [
78
]
},
{
"localized_name": "CLIP",
"name": "CLIP",
"type": "CLIP",
"slot_index": 1,
"links": [
48
]
},
{
"localized_name": "VAE",
"name": "VAE",
"type": "VAE",
"slot_index": 2,
"links": [
86
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.67",
"Node name for S&R": "CheckpointLoaderSimple"
},
"widgets_values": [
"pimpmypony_pmpIncaseStyle.safetensors"
],
"color": "#232",
"bgcolor": "#353"
},
{
"id": 41,
"type": "CLIPSetLastLayer",
"pos": [
-103.51370239257812,
546.187255859375
],
"size": [
315,
58
],
"flags": {},
"order": 4,
"mode": 0,
"inputs": [
{
"localized_name": "clip",
"name": "clip",
"type": "CLIP",
"link": 48
}
],
"outputs": [
{
"localized_name": "CLIP",
"name": "CLIP",
"type": "CLIP",
"slot_index": 0,
"links": [
80
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.67",
"Node name for S&R": "CLIPSetLastLayer"
},
"widgets_values": [
-2
],
"color": "#232",
"bgcolor": "#353"
},
{
"id": 33,
"type": "VAELoader",
"pos": [
-102.83155059814453,
664.25634765625
],
"size": [
315,
58
],
"flags": {},
"order": 1,
"mode": 4,
"inputs": [],
"outputs": [
{
"localized_name": "VAE",
"name": "VAE",
"type": "VAE",
"slot_index": 0,
"links": []
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.67",
"Node name for S&R": "VAELoader"
},
"widgets_values": [
"SDXL/sdxl_vae.safetensors"
]
},
{
"id": 31,
"type": "CLIPTextEncode",
"pos": [
294.3329494628911,
532.266171142578
],
"size": [
409.0626220703125,
105.67417907714844
],
"flags": {},
"order": 8,
"mode": 0,
"inputs": [
{
"localized_name": "clip",
"name": "clip",
"type": "CLIP",
"link": 82
}
],
"outputs": [
{
"localized_name": "CONDITIONING",
"name": "CONDITIONING",
"type": "CONDITIONING",
"slot_index": 0,
"links": [
36
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.67",
"Node name for S&R": "CLIPTextEncode"
},
"widgets_values": [
"score_6, score_5, score_4, score_3, worst quality, low quality, ugly, malformed, bad anatomy, grayscale, watermark, artist name,"
],
"color": "#322",
"bgcolor": "#533"
},
{
"id": 3,
"type": "KSampler",
"pos": [
733.527587890625,
206.86343383789062
],
"size": [
315,
262
],
"flags": {},
"order": 6,
"mode": 0,
"inputs": [
{
"localized_name": "model",
"name": "model",
"type": "MODEL",
"link": 90
},
{
"localized_name": "positive",
"name": "positive",
"type": "CONDITIONING",
"link": 103
},
{
"localized_name": "negative",
"name": "negative",
"type": "CONDITIONING",
"link": 36
},
{
"localized_name": "latent_image",
"name": "latent_image",
"type": "LATENT",
"link": 83
}
],
"outputs": [
{
"localized_name": "LATENT",
"name": "LATENT",
"type": "LATENT",
"slot_index": 0,
"links": [
41
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.67",
"Node name for S&R": "KSampler"
},
"widgets_values": [
10449570038376,
"randomize",
30,
5,
"dpmpp_2m_sde",
"karras",
1
]
},
{
"id": 54,
"type": "EmptyLatentImagePresets",
"pos": [
740.2000016015646,
562.7404124296878
],
"size": [
285.0787109375,
146
],
"flags": {},
"order": 2,
"mode": 0,
"inputs": [],
"outputs": [
{
"localized_name": "Latent",
"name": "Latent",
"type": "LATENT",
"links": [
83
]
},
{
"localized_name": "Width",
"name": "Width",
"type": "INT",
"links": null
},
{
"localized_name": "Height",
"name": "Height",
"type": "INT",
"links": null
}
],
"properties": {
"cnr_id": "comfyui-kjnodes",
"ver": "1.2.2",
"Node name for S&R": "EmptyLatentImagePresets",
"aux_id": "kijai/ComfyUI-KJNodes"
},
"widgets_values": [
"1216 x 832 (1.46:1)",
true,
1
],
"color": "#233",
"bgcolor": "#355"
},
{
"id": 8,
"type": "VAEDecode",
"pos": [
767.7563876953091,
92.65541229248062
],
"size": [
210,
46
],
"flags": {},
"order": 7,
"mode": 0,
"inputs": [
{
"localized_name": "samples",
"name": "samples",
"type": "LATENT",
"link": 41
},
{
"localized_name": "vae",
"name": "vae",
"type": "VAE",
"link": 86
}
],
"outputs": [
{
"localized_name": "IMAGE",
"name": "IMAGE",
"type": "IMAGE",
"slot_index": 0,
"links": [
98
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.67",
"Node name for S&R": "VAEDecode"
},
"widgets_values": []
},
{
"id": 64,
"type": "CLIPTextEncode",
"pos": [
455.3604332234191,
364.8037304559595
],
"size": [
400,
200
],
"flags": {
"collapsed": true
},
"order": 9,
"mode": 0,
"inputs": [
{
"localized_name": "clip",
"name": "clip",
"type": "CLIP",
"link": 108
},
{
"localized_name": "text",
"name": "text",
"type": "STRING",
"widget": {
"name": "text"
},
"link": 107
}
],
"outputs": [
{
"localized_name": "CONDITIONING",
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
103
]
}
],
"title": "Positive",
"properties": {
"cnr_id": "comfy-core",
"ver": "0.13.0",
"Node name for S&R": "CLIPTextEncode"
},
"widgets_values": [
""
]
},
{
"id": 66,
"type": "easy showAnything",
"pos": [
-207.1423790124439,
-191.86967444989412
],
"size": [
380.2005395507813,
339.48220830078117
],
"flags": {},
"order": 5,
"mode": 0,
"inputs": [
{
"label": " ",
"localized_name": "anything",
"name": "anything",
"shape": 7,
"type": "*",
"link": 113
}
],
"outputs": [
{
"label": " ",
"localized_name": "output",
"name": "output",
"type": "*",
"links": [
106,
107
]
}
],
"title": "Final prompt preview",
"properties": {
"cnr_id": "comfyui-easy-use",
"ver": "5c8cdb58c798a404e50636c6f3e179b084a23fab",
"Node name for S&R": "easy showAnything",
"aux_id": "yolain/ComfyUI-Easy-Use",
"widget_ue_connectable": {}
},
"widgets_values": [
"score_9, score_8_up, score_7_up, profile, amusement park, twilight, bloom, sidelighting, darkness, (2girls, 1boy) ffm threesome, from side, looking at viewer, naughty face, penis, oral, tonguejob, fellatio, precum string BREAK 1girl, white hair, short hair, rattail hair, straight hair, aqua eyes, petite body, large breasts, average height, , topless BREAK 1girl, maroon hair, absurdly long hair, low-braided long hair, pointy hair, grey eyes, average body, large breasts, tall, lace dress, sideboob"
],
"color": "#232",
"bgcolor": "#353",
"shape": 2
},
{
"id": 72,
"type": "WildcardProcessor",
"pos": [
230.0356999333363,
-215.48455311278255
],
"size": [
410.81676136363626,
350.2627840909091
],
"flags": {},
"order": 3,
"mode": 0,
"inputs": [],
"outputs": [
{
"localized_name": "processed_text",
"name": "processed_text",
"type": "STRING",
"links": [
113
]
}
],
"properties": {
"aux_id": "huchukato/comfy-tagcomplete",
"ver": "43677b093ae8c18ac35768c575d1edb2f5483119",
"Node name for S&R": "WildcardProcessor"
},
"widgets_values": [
"score_9, score_8_up, score_7_up, __mbe/prmpt/imgcmp/shots__, __mbe/prmpt/lctns/rndmlctns__, __mbe/prmpt/light/rndmlight__, (2girls, 1boy) __mbe/actffm/coop_fellatio__ BREAK __mbe/prmpt/char/rndmcharlb__, __mbe/prmpt/clths/rndmclth__, __mbe/prmpt/clths/nudty_brsts__ BREAK __mbe/prmpt/char/rndmcharlb__, __mbe/prmpt/clths/rndmclth__, __mbe/prmpt/clths/nudty_brsts__",
370820736079697,
"randomize"
],
"color": "#232",
"bgcolor": "#353"
}
],
"groups": [],
"links": [
{
"id": 48,
"origin_id": 4,
"origin_slot": 1,
"target_id": 41,
"target_slot": 0,
"type": "CLIP"
},
{
"id": 41,
"origin_id": 3,
"origin_slot": 0,
"target_id": 8,
"target_slot": 0,
"type": "LATENT"
},
{
"id": 86,
"origin_id": 4,
"origin_slot": 2,
"target_id": 8,
"target_slot": 1,
"type": "VAE"
},
{
"id": 103,
"origin_id": 64,
"origin_slot": 0,
"target_id": 3,
"target_slot": 1,
"type": "CONDITIONING"
},
{
"id": 36,
"origin_id": 31,
"origin_slot": 0,
"target_id": 3,
"target_slot": 2,
"type": "CONDITIONING"
},
{
"id": 83,
"origin_id": 54,
"origin_slot": 0,
"target_id": 3,
"target_slot": 3,
"type": "LATENT"
},
{
"id": 82,
"origin_id": -10,
"origin_slot": 0,
"target_id": 31,
"target_slot": 0,
"type": "CLIP"
},
{
"id": 90,
"origin_id": -10,
"origin_slot": 1,
"target_id": 3,
"target_slot": 0,
"type": "MODEL"
},
{
"id": 78,
"origin_id": 4,
"origin_slot": 0,
"target_id": -20,
"target_slot": 0,
"type": "MODEL"
},
{
"id": 80,
"origin_id": 41,
"origin_slot": 0,
"target_id": -20,
"target_slot": 1,
"type": "CLIP"
},
{
"id": 98,
"origin_id": 8,
"origin_slot": 0,
"target_id": -20,
"target_slot": 2,
"type": "IMAGE"
},
{
"id": 107,
"origin_id": 66,
"origin_slot": 0,
"target_id": 64,
"target_slot": 1,
"type": "STRING"
},
{
"id": 108,
"origin_id": -10,
"origin_slot": 0,
"target_id": 64,
"target_slot": 0,
"type": "CLIP"
},
{
"id": 113,
"origin_id": 72,
"origin_slot": 0,
"target_id": 66,
"target_slot": 0,
"type": "STRING"
}
],
"extra": {
"workflowRendererVersion": "LG"
}
}
]
},
"config": {},
"extra": {
"frontendVersion": "1.39.19",
"workflowRendererVersion": "LG",
"VHS_latentpreview": false,
"VHS_latentpreviewrate": 0,
"ue_links": [],
"node_versions": {
"comfy-core": "0.3.12",
"comfyui-jakeupgrade": "1.8.8",
"comfyui-impact-pack": "8.6",
"ComfyUI-SDXL-EmptyLatentImage": "d886c198664998d1eecab60fff17509d22817977"
},
"VHS_MetadataImage": true,
"VHS_KeepIntermediate": true,
"ds": {
"scale": 0.6830134553650705,
"offset": [
2024.6328794887577,
746.1319962221679
]
}
},
"version": 0.4
}ComfyUI-QwenVL-Mod/AILab_QwenVL_GGUF_PromptEnhancer.pyAdded+530
ComfyUI-QwenVL-Mod/AILab_QwenVL_PromptEnhancer.pyAdded+328
ComfyUI-QwenVL-Mod/LICENSEAdded+674
ComfyUI-QwenVL-Mod/README.mdAdded+549
ComfyUI-QwenVL-Mod/README_it.mdAdded+565
ComfyUI-QwenVL-Mod/__init__.pyAdded+57
ComfyUI-QwenVL-Mod/__pycache__/AILab_OutputCleaner.cpython-310.pycAdded
ComfyUI-QwenVL-Mod/__pycache__/AILab_QwenVL.cpython-310.pycAdded
ComfyUI-QwenVL-Mod/__pycache__/AILab_QwenVL_GGUF.cpython-310.pycAdded
ComfyUI-QwenVL-Mod/__pycache__/AILab_QwenVL_GGUF.cpython-312.pycAdded
ComfyUI-QwenVL-Mod/__pycache__/AILab_QwenVL_GGUF_PromptEnhancer.cpython-310.pycAdded
ComfyUI-QwenVL-Mod/__pycache__/AILab_QwenVL_PromptEnhancer.cpython-310.pycAdded
ComfyUI-QwenVL-Mod/__pycache__/__init__.cpython-310.pycAdded
ComfyUI-QwenVL-Mod/__pycache__/sageattention_patch.cpython-310.pycAdded
ComfyUI-QwenVL-Mod/custom_models_example.jsonAdded+24
ComfyUI-QwenVL-Mod/custom_nodes.jsonAdded+13
ComfyUI-QwenVL-Mod/docs/LLAMA_CPP_PYTHON_VISION_INSTALL.mdAdded+113
ComfyUI-QwenVL-Mod/docs/custom_models.mdAdded+62
ComfyUI-QwenVL-Mod/example_workflows/QWenVL.jsonAdded+466
ComfyUI-QwenVL-Mod/example_workflows/QwenVL_v2.0.0.jsonAdded+364
ComfyUI-QwenVL-Mod/gguf_models.jsonAdded+288
ComfyUI-QwenVL-Mod/gguf_requirements.txtAdded+15
ComfyUI-QwenVL-Mod/hf_models.jsonAdded+101
ComfyUI-QwenVL-Mod/nodes/__pycache__/story_split_node.cpython-310.pycAdded
ComfyUI-QwenVL-Mod/nodes/__pycache__/vram_cleanup.cpython-310.pycAdded
ComfyUI-QwenVL-Mod/nodes/story_split_node.pyAdded+85
ComfyUI-QwenVL-Mod/nodes/vram_cleanup.pyAdded+168
ComfyUI-QwenVL-Mod/prompt_cache.jsonAdded
ComfyUI-QwenVL-Mod/pyproject.tomlAdded+15
ComfyUI-QwenVL-Mod/requirements.txtAdded+23
ComfyUI-QwenVL-Mod/runpod/.dockerignoreAdded+103
ComfyUI-QwenVL-Mod/runpod/BUILD_SCRIPTS.mdAdded+79
ComfyUI-QwenVL-Mod/runpod/DockerfileAdded+418
ComfyUI-QwenVL-Mod/runpod/Dockerfile.4090Added+421
ComfyUI-QwenVL-Mod/runpod/README4090.mdAdded+132
ComfyUI-QwenVL-Mod/runpod/README5090.mdAdded+133
ComfyUI-QwenVL-Mod/runpod/build-local-4090.shAdded+56
ComfyUI-QwenVL-Mod/runpod/build-local-5090.shAdded+56
ComfyUI-QwenVL-Mod/runpod/docker-compose.ymlAdded+38
ComfyUI-QwenVL-Mod/sageattention_patch.pyAdded+144
ComfyUI-QwenVL-Mod/update.mdAdded+810
ComfyUI-QwenVL-Mod/vastai/READMECivitai.mdAdded+297
ComfyUI-QwenVL-Mod/vastai/READMEVast4090.mdAdded+179
ComfyUI-QwenVL-Mod/vastai/READMEVast5090.mdAdded+188
ComfyUI-QwenVL-Mod/vastai/provisioning.shAdded+333
ComfyUI-QwenVL-Mod/vastai/template-config.jsonAdded+53
ComfyUI-QwenVL-Mod/vastai/workflows/PMP-LoRaStack-Upscale-Wildcards.jsonAdded+1433
ComfyUI-QwenVL-Mod/vastai/workflows/WAN2.2-I2V-AutoPrompt-GGUF.jsonAdded
ComfyUI-QwenVL-Mod/vastai/workflows/WAN2.2-I2V-AutoPrompt-Story.jsonAdded
ComfyUI-QwenVL-Mod/vastai/workflows/WAN2.2-I2V-AutoPrompt.jsonAdded