Nodes/ComfyUI-ThinkingLLM/ThinkingLLM Prompt Enhancer
ComfyUI Node

ThinkingLLM Prompt Enhancer

A ComfyUI node in ThinkingLLM with 18 inputs and 2 outputs.

By goodguy1963·Created 3 months ago·Updated 25 days ago· 13
ThinkingLLM Prompt Enhancer
    • ENHANCED_OUTPUT
    • RAW_TRACE
    model_nameQwen3-VL-4B-Instruct-Abliterated [DL: 7.5GB, VRAM: 6.0GB]
    quantizationNone (FP16)
    attention_modeauto
    use_torch_compilefalse
    deviceauto
    prompt_text
    enhancement_style📝 Enhance
    custom_system_prompt
    max_tokens1024
    temperature0.70
    top_p0.90
    repetition_penalty1.10
    keep_model_loadedfalse
    seed1
    keep_last_promptfalse
    stream_tokens_to_terminalfalse
    enable_thinkingtrue
    hf_token
    CategoryThinkingLLM

    Inputs (18)

    NameTypeDefaultDescription
    model_nameCOMBOQwen3-VL-4B-Instruct-Abliterated [DL: 7.5GB, VRAM: 6.0GB]Pick the Qwen-VL checkpoint. First run downloads weights into models/LLM/Qwen-VL, so leave disk space.
    quantizationCOMBONone (FP16)Precision vs VRAM. FP16 gives the best quality if memory allows; 8-bit suits 8–16 GB GPUs; 4-bit fits 6 GB or lower but is slower.
    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.
    prompt_textSTRINGPrompt text to enhance. Leave blank to emit the selected preset instruction as the base prompt.
    enhancement_styleCOMBO📝 EnhancePreset enhancement style. Use Custom Only when you want custom_system_prompt to fully control the instruction.
    custom_system_promptSTRINGOptional extra instruction. Required when using Custom Only; otherwise it is prepended to the selected style.
    max_tokensINT102432–16384Maximum new tokens for the enhanced prompt. Increase only when the model truncates useful detail.
    temperatureFLOAT0.700.1–1Sampling randomness. Lower is more stable; higher is more varied.
    top_pFLOAT0.900–1Nucleus sampling cutoff. Lower values restrict token choice; 0.9 is a balanced default.
    repetition_penaltyFLOAT1.100.5–2Values above 1.0 reduce repeated phrases in the enhanced prompt.
    keep_model_loadedBOOLEANfalseKeep the HF model in memory after generation so repeated prompt enhancement skips model loading.
    seedINT11–4294967295Sampling seed. Reusing it with identical inputs can reuse the saved prompt result.
    keep_last_promptBOOLEANfalseKeep the last generated prompt instead of creating a new one
    stream_tokens_to_terminalBOOLEANfalseShow clean wrapped generated tokens in the ComfyUI terminal. When enabled, fixed-seed prompt reuse is bypassed so a fresh streamed run can occur.
    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. Prompt enhancers still return a cleaned final prompt, so terminal reasoning may be hidden or empty.
    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.

    Outputs (2)

    NameTypeDescription
    ENHANCED_OUTPUTSTRING
    RAW_TRACESTRING