ThinkingLLM Advanced
The same Qwen node, minus the training wheels
- image
- video
- mask
- RESPONSE
- RAW_TRACE
- MASK_PREVIEW
If the plain ThinkingLLM node is the one you start with, Advanced is the one you graduate to. Same engine, same model catalog, same thinking toggle and RAW_TRACE output - but every sampling dial is exposed, and you get a few knobs the base node doesn't have at all. Reach for it when the default answer isn't quite what you want and you need to push the model in a direction.
It's the Transformers/HF path of the pack, so it's the easiest cross-platform option on Windows and Linux. No llama.cpp backend to babysit - just a model, a prompt, and a pile of sampling settings.
The dials that actually matter
temperature/top_p- the classic randomness pair. The tooltip's framing is right: 0.2–0.4 is focused, 0.7+ is creative. Defaults are a sane 0.6 / 0.9.num_beams- beam search, 1–8. Here's the catch: values above 1 disable temperature/top_p entirely and trade speed for a more stable answer. If you've set a lovely creative temperature and the model feels stiff, check that beam count.repetition_penalty- nudge it to 1.1–1.3 when Qwen starts echo-chambering on long video descriptions.frame_count- how many frames get pulled from a video input before prompting. More frames = better context, slower run, and a bigger token bill. 16 is the default for a reason.attention_mode-autotries SageAttention → FlashAttention 2 → SDPA in order. SDPA is the stable fallback and is honestly fine; only touch this when debugging attention backends.use_torch_compile- torch.compile('reduce-overhead') for extra throughput. The first run pays a compile cost; after that it can be meaningfully faster on supported CUDA/Torch 2.1+ builds. It's off by default, and leaving it off is a perfectly reasonable choice on a 20-series card.device- auto/cpu/mps, plus per-GPU targets (cuda:0, etc.) for multi-GPU rigs.
Everything else carries over from the base node: model_name, the preset/custom prompt pair, max_tokens (capped at 8192 on this path), enable_thinking, keep_model_loaded, seed, keep_last_prompt, stream_tokens_to_terminal, and hf_token for gated downloads.
Installing
Same as the rest of the pack - ComfyUI Manager, search ThinkingLLM, install. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/goodguy1963/ComfyUI-ThinkingLLM.git
cd ComfyUI-ThinkingLLM
pip install -r requirements.txt
Restart, and the node appears under the ThinkingLLM category. The HF path needs transformers>=5.2.0; the pack auto-installs missing tokenizer backends (sentencepiece, tiktoken) on first load.
Gotchas
First run downloads weights into models/LLM/Qwen-VL - the default 4B VL model is a ~7.5 GB pull, so it looks frozen while it downloads. The fixed-seed prompt cache is still active here: seed 1 ignores media changes, and identical inputs reuse the saved prompt, so change the seed or inputs deliberately when you want a fresh answer. And remember the beam-search/temperature conflict from above - it's the one knob pairing that silently overrides your other settings.
Inputs (22)
| Name | Type | Default | Description |
|---|---|---|---|
| model_name | COMBO | Qwen3-VL-4B-Instruct-Abliterated [DL: 7.5GB, VRAM: 6.0GB] | Pick the checkpoint. [installed] means a catalog model is available in a configured LLM location; [local] means an uncatalogued local model, including compatible ComfyUI text_encoders. Missing catalog models download on first use. |
| attention_mode | COMBO | auto | auto tries SageAttention → FlashAttention 2 → SDPA in order. SDPA is stable and recommended. Only override when debugging attention backends. |
| use_torch_compile | BOOLEAN | false | Enable torch.compile('reduce-overhead') on supported CUDA/Torch 2.1+ builds for extra throughput after the first compile. |
| device | COMBO | auto | Choose where to run the model: auto, cpu, mps, or cuda:x for multi-GPU systems. |
| preset_prompt | COMBO | 🖼️ Detailed Description | Built-in instruction describing how Qwen-VL should analyze the media input. Select 'No preset' to use only the custom prompt or image input. |
| custom_prompt | STRING | Additional user input that gets combined with the preset template. Leave empty to use only the template. | |
| max_tokens | INT | 819264–8192 | Maximum number of new tokens to decode. Larger values yield longer answers but consume more time and memory. |
| temperature | FLOAT | 0.600.1–1 | Sampling randomness when num_beams == 1. 0.2–0.4 is focused, 0.7+ is creative. |
| top_p | FLOAT | 0.900–1 | Nucleus sampling cutoff when num_beams == 1. Lower values keep only top tokens; 0.9–0.95 allows more variety. |
| num_beams | INT | 11–8 | Beam-search width. Values >1 disable temperature/top_p and trade speed for more stable answers. |
| repetition_penalty | FLOAT | 1.000.5–2 | Values >1 (e.g., 1.1–1.3) penalize repeated phrases; 1.0 leaves logits untouched. |
| frame_count | INT | 161–64 | Number of frames extracted from video inputs before prompting Qwen-VL. More frames provide context but cost time. |
| keep_model_loaded | BOOLEAN | false | Keeps the model resident in VRAM/RAM after the run so the next prompt skips loading. |
| seed | INT | 11–4294967295 | Seed controlling sampling and frame picking; reuse it to reproduce results. 💡 Cache Info: Prompts are cached automatically. Use same inputs (model, preset, custom prompt, image/video) to reuse cached prompts and avoid regeneration. 🔒 Fixed Seed Mode: Set seed = 1 to ignore image/video changes and only use text-based caching. Perfect for keeping the same prompt regardless of media input variations. |
| keep_last_prompt | BOOLEAN | false | Keep last generated prompt instead of creating a new one |
| stream_tokens_to_terminal | BOOLEAN | false | Print every generated token live to the ComfyUI terminal/console |
| enable_thinking | BOOLEAN | true | Enable model reasoning/thinking when the backend supports it: True=allow thinking, False=force direct answer. Even when enabled, easy prompts may still get a direct answer, and this node automatically disables thinking when there is not enough output budget left for useful reasoning. For non-Qwen models (Gemma, LLaMA) this is advisory. |
| hf_token | STRING | Optional Hugging Face access token for private or gated model downloads. It is passed only to the download call, never logged or cached, and the in-memory copy is dropped after the download attempt. Clear this field before saving or sharing workflows. | |
| imageopt | IMAGE | — | |
| videoopt | IMAGE | — | |
| maskopt | MASK | — | |
| duration_secondsopt | FLOAT | 5.00.2–150 | Target video duration in seconds. It is used only by registered LTX 2.3 and MiniMax H3 video presets. Connect the same requested duration to the video generator; MiniMax values are normalized to its 17k+5 frame grid at 24 fps. For longer MiniMax scripts, ThinkingLLM selects a coherent moment that fits while keeping any selected dialogue verbatim. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| RESPONSE | STRING | — |
| RAW_TRACE | STRING | — |
| MASK_PREVIEW | IMAGE | — |