🤖 V2 Text Generation
A local LLM that's actually inside your graph — with a thinking-mode output
- model
- context
- thinking
Text generation is the sleeper node in this pack. Everyone shows up for the vision stuff - captioning, OCR, image understanding - but once you have a text LLM loaded locally, you'll find a dozen little jobs for it: rewrite a prompt, expand a tag list, summarize a batch of captions, brainstorm negative prompts. V2 Text Generation is the runner end of the text pipeline: take the TEXT_MODEL from V2 Local Text Model Loader, give it a prompt, and get a generation back as a STRING.
It's the local, in-process alternative to the remote text path, and it has one feature that's genuinely ahead of most ComfyUI LLM nodes: a separate thinking output. Models like DeepSeek-R1 and Qwen3 in thinking mode emit a reasoning trace before their answer, and this node splits that out into its own string instead of dumping it into your result.
The inputs that matter
- model - required
TEXT_MODELfrom the loader. - prompt - your instruction, multiline. Default "Hello, how are you?"
- max_tokens - default 512, up to 8192.
- temperature / top_p / top_k / repetition_penalty - the full sampler. Defaults are 0.7 / 0.9 / 40 / 1.1. The repetition penalty at 1.1 is the one to know: it's what stops an 8B from looping, and for deterministic utility work you'll often want temperature down around 0.3.
- enable_thinking - the switch for reasoning models. Off by default; flip it on for Qwen3-Thinking or DeepSeek-R1 style models. When on, the reasoning appears in the
thinkingoutput and the answer incontext.
Outputs
- context - the model's answer.
- thinking - the reasoning trace, when enabled (empty otherwise).
Both are STRINGs. Wire context into a prompt builder, a text save node, or downstream logic; keep thinking for your own debugging. The node is an output node, so results render in the UI too.
How it works
Same llama-cpp-python path as the vision analysis, minus the images. If enable_thinking is on, the node runs the model with the thinking/reasoning mode and then separates the trace from the final answer using the model's markers - which is why it specifically calls out DeepSeek-R1 and Qwen3 in the tooltip: those are the models that actually emit distinguishable reasoning sections.
Where you'd actually use it
The honest use case inside a ComfyUI graph: as a text utility that stays on-machine. If you're already running a Qwen3-8B for captions, this node lets the same model rewrite those captions, deduplicate tags, or turn a caption into a training prompt without round-tripping through a second service. It's also the cheapest way to experiment with a reasoning model's thinking output - a lot of people first realize how much "thinking" changes prompt quality by watching it here.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/walke2019/ComfyUI-GGUF-VLM.git
cd ComfyUI-GGUF-VLM
pip install -r requirements.txt
Restart ComfyUI; it's under GGUF-VLM → v2 → Text.
Troubleshooting
If context comes back empty but thinking is full, the model output the whole thing as reasoning - either the model doesn't support the markers the node expects, or enable_thinking misclassified it; try toggling it. Loop-y output means raise repetition_penalty. Slow generation on a GPU machine points at a CPU-only llama-cpp-python build. And if you loaded a ✗ model, the first run includes a download, so don't panic at the pause.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| model | TEXT_MODEL | 文本模型配置 | |
| max_tokens | INT | 5121–8192 | 最大生成 token 数 |
| temperature | FLOAT | 0.70–2 | 温度参数(越高越随机) |
| top_p | FLOAT | 0.900–1 | Top-p 采样 |
| top_k | INT | 400–100 | Top-k 采样 |
| repetition_penalty | FLOAT | 1.11–2 | 重复惩罚 |
| enable_thinking | BOOLEAN | false | 启用思考模式(支持 DeepSeek-R1, Qwen3-Thinking 等模型) |
| prompt | STRING | Hello, how are you? | 输入提示词 |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| context | STRING | — |
| thinking | STRING | — |