Nodes/ComfyUI-ThinkingLLM/ThinkingLLM Prompt Enhancer (GGUF)
ComfyUI Node

ThinkingLLM Prompt Enhancer (GGUF)

Cheap, fast prompt enhancement on a text-only GGUF

By goodguy1963·Created 4 months ago·Updated 6 days ago· 21
ThinkingLLM Prompt Enhancer (GGUF)
    • ENHANCED_OUTPUT
    • RAW_TRACE
    model_nameQwen3-4B-abliterated.Q4_K_M.gguf [~2.4GB]
    prompt_text
    preset_system_prompt📝 Enhance
    custom_system_prompt
    max_tokens1024
    temperature0.70
    top_p0.90
    repetition_penalty1.10
    english_outputfalse
    deviceauto
    keep_model_loadedfalse
    seed1
    keep_last_promptfalse
    stream_tokens_to_terminalfalse
    enable_thinkingtrue
    auto_finalization_retryfalse
    hf_token
    duration_seconds5.0

    The HF Prompt Enhancer is convenient but it drags a vision model in to do a text job. This GGUF version is the lean alternative: a text-only Qwen3 quant that exists to expand and refine prompts, nothing else. The default is a Q4_K_M Josiefied Qwen3-4B at ~2.4 GB - about a third of the download of the base node's default VL model - so this is the one to drop into a video-prompt loop where you're enhancing a dozen prompts in a row and don't want to load a 7 GB vision model for any of them.

    No image input, no audio input, no vision handlers needed. It's text in, ENHANCED_OUTPUT out, with RAW_TRACE alongside. This is also the node where the pack's uncensored-model catalog shows its hand: the defaults are abliterated and "gabliterated" Qwen3 quants, and the style presets include the LTX 2.3 and Wan 2.2 NSFW scene/timeline templates. If that's not your lane, pick a base Qwen3 quant and a Refine style and it behaves like a polite copy editor.

    What to set

    • preset_system_prompt - the style list: 📝 Enhance (default), Refine, Creative Rewrite, Detailed Visual, the LTX/Wan video templates, and ✍️ Custom Only for full control via custom_system_prompt.
    • prompt_text - the rough prompt to enhance; blank means the selected preset instruction becomes the base.
    • custom_system_prompt - required with Custom Only, otherwise prepended to the style.
    • english_output - a small but handy toggle: ask the model to return the final prompt in English even if the source prompt isn't.
    • temperature / top_p / repetition_penalty - 0.7 / 0.9 / 1.1 defaults; the repetition penalty above 1.0 matters more here than on a single-shot answer, because long generated prompts love to loop.
    • max_tokens - 1024 default; bump it when good detail gets cut off.

    Rounding out the list: model_name, device (auto/cuda/cpu/mps - auto prefers GPU), keep_model_loaded, seed, keep_last_prompt, stream_tokens_to_terminal, enable_thinking, auto_finalization_retry, and hf_token. The GGUF list marks [local] files it auto-discovers in models/LLM/GGUF/, skipping anything named mmproj.

    Installing

    Manager (search ThinkingLLM) or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/goodguy1963/ComfyUI-ThinkingLLM.git
    cd ComfyUI-ThinkingLLM
    pip install -r requirements.txt
    

    Because this is a GGUF node it still needs a working llama-cpp-python, though not the vision-flavored build - the backend check here runs without requiring the multimodal handlers. Linux auto-installs a matching wheel; Windows users should still verify their llama.cpp build isn't silently CPU-only, since a text-only model on CPU is workable but slow.

    Gotchas

    The fixed-seed cache returns a saved prompt for identical inputs, and enabling terminal streaming forces a fresh run - that's by design, so you can tell whether you're seeing a cached result or a new one. The catalog defaults are abliterated quants, which is fine and worth knowing, but don't assume every model in the list behaves identically on the thinking toggle - it's advisory on non-Qwen GGUFs. And for the love of clean workflows: the hf_token field is real, and it does not get written to RAW_TRACE or cache keys, but it can be serialized into your saved workflow file - clear it before you share.

    CategoryThinkingLLM

    Inputs (18)

    NameTypeDefaultDescription
    model_nameCOMBOQwen3-4B-abliterated.Q4_K_M.gguf [~2.4GB]GGUF text model from config or auto-detected local files. [installed] means the catalog model was found in a configured GGUF/LLM location; [local] means an uncatalogued local model. Missing GGUF files download on first use.
    prompt_textSTRINGPrompt text to enhance. Leave blank to emit the selected preset instruction as the base prompt.
    preset_system_promptCOMBO📝 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.
    english_outputBOOLEANfalseAsk the model to return the final enhanced prompt in English. MiniMax H3 presets already require English and bypass the generic paragraph translation pass so their official field structure remains intact.
    deviceCOMBOautoauto prefers GPU when available. If generation is unexpectedly slow, run tools/check_llama_backend.py to verify llama.cpp GPU offload.
    keep_model_loadedBOOLEANfalseKeep the GGUF 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_promptBOOLEANfalseReturn the saved per-node prompt instead of generating a new one when available.
    stream_tokens_to_terminalBOOLEANfalseShow clean wrapped generated tokens in the ComfyUI terminal. Streaming bypasses fixed-seed reuse for a fresh run.
    enable_thinkingBOOLEANtrueEnable model reasoning/thinking when supported. The node still returns the cleaned final prompt, so reasoning may be hidden or empty.
    auto_finalization_retryBOOLEANfalseIf enabled, runs an extra LLM completion when the first output is empty or reasoning-only. Disabled by default so one node execution performs one generation pass.
    hf_tokenSTRINGOptional Hugging Face access token for private or gated GGUF 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.
    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 (2)

    NameTypeDescription
    ENHANCED_OUTPUTSTRING
    RAW_TRACESTRING