Nodes/ComfyUI-ThinkingLLM/ThinkingLLM Advanced
ComfyUI Node

ThinkingLLM Advanced

The same Qwen node, minus the training wheels

By goodguy1963·Created 4 months ago·Updated 6 days ago· 21
ThinkingLLM Advanced
  • image
  • video
  • mask
  • RESPONSE
  • RAW_TRACE
  • MASK_PREVIEW
model_nameQwen3-VL-4B-Instruct-Abliterated [DL: 7.5GB, VRAM: 6.0GB]
attention_modeauto
use_torch_compilefalse
deviceauto
preset_prompt🖼️ Detailed Description
custom_prompt
max_tokens8192
temperature0.60
top_p0.90
num_beams1
repetition_penalty1.00
frame_count16
keep_model_loadedfalse
seed1
keep_last_promptfalse
stream_tokens_to_terminalfalse
enable_thinkingtrue
hf_token
duration_seconds5.0

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 - auto tries 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.

CategoryThinkingLLM

Inputs (22)

NameTypeDefaultDescription
model_nameCOMBOQwen3-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_modeCOMBOautoauto tries SageAttention → FlashAttention 2 → SDPA in order. SDPA is stable and recommended. Only override when debugging attention backends.
use_torch_compileBOOLEANfalseEnable torch.compile('reduce-overhead') on supported CUDA/Torch 2.1+ builds for extra throughput after the first compile.
deviceCOMBOautoChoose where to run the model: auto, cpu, mps, or cuda:x for multi-GPU systems.
preset_promptCOMBO🖼️ Detailed DescriptionBuilt-in instruction describing how Qwen-VL should analyze the media input. Select 'No preset' to use only the custom prompt or image input.
custom_promptSTRINGAdditional user input that gets combined with the preset template. Leave empty to use only the template.
max_tokensINT819264–8192Maximum number of new tokens to decode. Larger values yield longer answers but consume more time and memory.
temperatureFLOAT0.600.1–1Sampling randomness when num_beams == 1. 0.2–0.4 is focused, 0.7+ is creative.
top_pFLOAT0.900–1Nucleus sampling cutoff when num_beams == 1. Lower values keep only top tokens; 0.9–0.95 allows more variety.
num_beamsINT11–8Beam-search width. Values >1 disable temperature/top_p and trade speed for more stable answers.
repetition_penaltyFLOAT1.000.5–2Values >1 (e.g., 1.1–1.3) penalize repeated phrases; 1.0 leaves logits untouched.
frame_countINT161–64Number of frames extracted from video inputs before prompting Qwen-VL. More frames provide context but cost time.
keep_model_loadedBOOLEANfalseKeeps the model resident in VRAM/RAM after the run so the next prompt skips loading.
seedINT11–4294967295Seed 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_promptBOOLEANfalseKeep last generated prompt instead of creating a new one
stream_tokens_to_terminalBOOLEANfalsePrint every generated token live to the ComfyUI terminal/console
enable_thinkingBOOLEANtrueEnable 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_tokenSTRINGOptional 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.
imageoptIMAGE
videooptIMAGE
maskoptMASK
duration_secondsoptFLOAT5.00.2–150Target 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)

NameTypeDescription
RESPONSESTRING
RAW_TRACESTRING
MASK_PREVIEWIMAGE