Skip to content
,

ComfyUI Generate Text Node: Run a Local LLM Inside Your Workflow (2026 Guide)

6–10 minutes
Woman at a creative desk holding a card reading COMFYUI, hook LLM inside ComfyUI

You do not need Ollama or LM Studio open next to ComfyUI anymore just to improve a prompt or caption an image. ComfyUI has a built-in Generate Text node that runs a local LLM right inside your workflow.

Since ComfyUI 0.45 it is also a lot faster: up to about twice the tokens per second on recent NVIDIA cards.

This guide explains what the node does, which model files to download and where to put them, every input and setting, four ready-to-use recipes (prompt enhancer, image captioner, reverse prompt and video Q&A), speed numbers and fixes.

TL;DR

  • Node: Generate Text (internal name TextGenerate, category text). Built into ComfyUI, no custom nodes.
  • Model: a Qwen3.5 file from Comfy-Org/Qwen3.5 in ComfyUI/models/text_encoders/, loaded with Load CLIP. The 9B W4A8 file (7.34 GB) is the best all-rounder.
  • Inputs: a text prompt plus optional image, video or audio. Output is plain text you can wire into any text box.
  • Template: “Qwen3.5: Text Generation” in the Templates menu.
  • Speed (0.45): Qwen3.5 9B went from 91 to 129 tok/s on an RTX 5080 and from 106 to 219 tok/s on an RTX 5090.

New to ComfyUI? My ComfyUI beginner guide covers install, models, nodes and fixes in one place.

What the Generate Text Node Does

Newer image models such as Qwen-Image and MOSS-Image use full language models (Qwen3-VL and Qwen3.5) as their text encoders. Since ComfyUI already loads these models, it added a node that lets them write text instead of only encoding your prompt.

The Generate Text node takes:

  • a model (from Load CLIP),
  • a prompt (your instruction),
  • and optionally an image, a video or audio,

and returns generated_text. You can show that text with a Preview as Text node, or feed it straight into a CLIP Text Encode or any node that accepts a string.

That opens up useful jobs, all inside one workflow:

  • Prompt enhancement: turn “a cat in a cafe” into a detailed, well-structured prompt.
  • Captioning: describe images for LoRA training datasets.
  • Reverse prompting: write a prompt that would recreate a reference image.
  • Visual Q&A: ask questions about an image or a short video.
  • Story and script writing: generate scene descriptions for video workflows.

Which Model to Download

The node works with the Qwen3.5 files that Comfy-Org publishes. Regular SD 1.5, SDXL or Flux text encoders (CLIP-L, T5) cannot generate text, so they will not work here.

File Size Best for
qwen3.5_2b_bf16.safetensors about 4.5 GB Fast prompt expansion on 6-8 GB cards
qwen3.5_4b_bf16.safetensors about 9 GB Better captions, still light
qwen3.5_9b_w4a8_gptq.safetensors 7.34 GB Recommended: 9B quality at a small size, fastest in 0.45
qwen3.5_9b_bf16.safetensors about 19 GB Full-precision 9B for 24 GB+ cards

All go in ComfyUI/models/text_encoders/. Download from the command line:

cd ComfyUI/models/text_encoders
hf download Comfy-Org/Qwen3.5 text_encoders/qwen3.5_9b_w4a8_gptq.safetensors --local-dir .

Move the file out of the extra text_encoders/ sub-folder if one is created. If you already run MOSS-Image, you may already have the same 9B W4A8 file, since it is that model’s text encoder. Reuse it instead of downloading again.

Not sure what fits your card? A rough rule: the model file size plus 1-3 GB for working memory. Our quantization guide explains why lower-bit files are smaller and what you give up.

Setup in 5 Steps

  1. Update ComfyUI to 0.45 or newer for the speed gains. See how to update ComfyUI.
  2. Download a Qwen3.5 file into models/text_encoders/.
  3. Open Templates and load Qwen3.5: Text Generation. Or build it yourself: add Load CLIP, Generate Text and Preview as Text.
  4. In Load CLIP, pick your Qwen3.5 file and set type to stable_diffusion, as in the official template.
  5. Type a prompt in Generate Text and click Run. The answer appears in Preview as Text.

Every Input and Setting

Input What it does Tip
clip The model from Load CLIP A supported Qwen LLM file, such as Qwen3.5
prompt Your instruction Be specific about format and length
max_length Most tokens to write (default 512; the template uses 768) 200-300 is plenty for a prompt
sampling_mode On: random sampling with the settings below. Off: greedy, same answer every time On for creative text, off for captions
temperature Default 0.7. Higher is more creative 0.3-0.5 for factual captions
top_p / top_k / min_p Defaults 0.95 / 64 / 0.05. Limit which words can be picked Leave as is
repetition_penalty Default 1.05. Discourages repeating Raise to 1.1 if it loops
presence_penalty Default 0. Pushes toward new topics Rarely needed
seed Controls the random choices Fix it to repeat a result
image / video / audio Optional media for the model to look at or listen to Video at 24 fps is sampled down to 1 fps
thinking Lets the model reason before answering Off for prompts and captions (faster)
use_default_template Wraps your prompt in the model’s chat format Leave on
mtp Multi-token prediction: auto, 2-5, or tree modes auto. It is the main 0.45 speed boost

4 Ready Recipes

1. Prompt enhancer

Wire generated_text into the text input of your image model’s CLIP Text Encode node (right-click the encode node and convert the text widget to an input if needed).

Rewrite this idea as one detailed image prompt of 60-90 words.
Describe subject, clothing, setting, lighting, camera angle and style.
Output only the prompt, no notes.
Idea: a woman reading in a rainy Tokyo cafe at night

Settings: sampling on, temperature 0.7, max_length 256, thinking off.

2. Image captioner (for LoRA datasets)

Connect a Load Image to the image input.

Describe this image in one paragraph for a training caption.
Mention subject, pose, clothing, background, lighting and style.
Do not start with "This image shows". No opinions.

Settings: sampling off (same caption every run), max_length 200. For a folder of images, use a batch image loader and a text save node.

3. Reverse prompt

Write a text-to-image prompt that would recreate this picture as closely as possible.
Include the art style, colours, composition and camera details. Output only the prompt.

Feed the result into your image model to make variations of a reference.

4. Video Q&A

Connect a Load Video to the video input. Ask questions such as “List the main actions in order, one line each.” Keep clips short; at 1 fps sampling, a 20-second clip is 20 frames for the model to read.

Speed: What Changed in 0.45

ComfyUI 0.45 (released 10 November) made the LLM path much faster. Comfy’s own numbers:

Model and job GPU Before 0.45
Qwen3.5 9B, text RTX 5090 106 tok/s 219 tok/s
Qwen3.5 9B, text RTX 5080 91 tok/s 129 tok/s
Qwen3.8 27B, describing an image RTX 5090 55 tok/s 122 tok/s

Where the speed comes from:

  • W4A8 / W6A8 kernels for the quantized files (why the W4A8 9B file is the one to pick).
  • Adaptive tree MTP: the model guesses several tokens at once and keeps the ones that check out. Output for the same seed can differ from older versions, but it stays statistically correct.
  • Comfy-Kitchen INT8 attention: start ComfyUI with --use-ck-attention to turn it on.

The 27B result shows the node is not limited to the small Qwen3.5 files. It works on NVIDIA and AMD. The full list of changes is in our ComfyUI 0.45 what’s new post.

Generate Text vs Ollama Nodes

Built-in Generate Text Ollama custom nodes
Install Nothing extra Ollama app + a custom node pack
Models Comfy-Org Qwen3.5 files Any model in Ollama’s library
VRAM Shares ComfyUI’s memory manager Separate process; can fight ComfyUI for VRAM
Image / video / audio input Yes Image with vision models
Best for Prompts and captions inside workflows When you want a specific Ollama model

For chatting, coding or agents outside ComfyUI, Ollama or LM Studio are still better tools. See our complete Ollama guide and Ollama vs LM Studio vs llama.cpp.

Troubleshooting

Problem Fix
Generate Text node not found Update ComfyUI. The node is built in on recent versions.
Error when you run with a Flux or SDXL encoder Those encoders cannot write text. Load a Qwen3.5 file.
Qwen3.5 file not in the Load CLIP list It must be in models/text_encoders/ (not a sub-folder). Refresh the page.
Output cuts off mid-sentence Raise max_length.
It repeats itself Turn sampling on and raise repetition_penalty to 1.1.
Long “thinking” text in the output Switch thinking off.
Extra notes around the prompt End your instruction with “Output only the prompt.”
Slow, no speed-up after updating Use the W4A8 9B file, keep mtp on auto, and try --use-ck-attention.
Out of memory with image model loaded too Use the 2B or W4A8 file; ComfyUI will unload models between steps when needed.

FAQ

Does the Generate Text node need internet?

No. It runs fully on your GPU once the model file is downloaded.

Can I use Llama, Gemma or Mistral?

The official template and Comfy-Org files are Qwen models. For Llama, Gemma or Mistral, the simplest route today is an Ollama or llama.cpp custom node pack.

Is the output the same every time?

With sampling off, yes. With sampling on, fix the seed. Since 0.45, MTP may give a different answer for the same seed than older versions did.

Can I batch caption a folder?

Yes, with a batch image loader and a node that saves text files. Turn sampling off so captions are consistent.

Does it work on AMD?

Yes. Comfy says the 0.45 speed-ups work on NVIDIA and AMD.

Sources

Free weekly email

Get new AI guides every week

One short weekly email with our newest local AI, ComfyUI and AI tool guides. No spam, no pop-ups, just the good stuff.

Free. Unsubscribe anytime in one click. We only use your email to send this newsletter. See our privacy policy.

Woman at a creative desk holding a card reading COMFYUI, hook LLM inside ComfyUI