What are LLMs / MLLMs?

An LLM is, very roughly speaking, an AI that reads text and responds with text — like ChatGPT.

An MLLM is an LLM that can also accept images and other inputs. As the name suggests, it's a "Multimodal" LLM.


What do you use it for in ComfyUI?

In ComfyUI, LLMs are used less for conversation and more as a "behind-the-scenes" helper, preparing what gets handed off to image generation models.

  • Prompt expansion & translation
    • Turning a rough human instruction into a detailed English prompt that AI can understand
  • Tag generation & image captioning
    • Show it an image and have it output tags or a description
    • Useful for training captions, or as a prompt for re-generation
  • Object detection & segmentation
    • Some MLLMs can handle more specialized tasks
    • MLLM-based object detection is especially handy because you can specify targets in natural language

4 ways to use LLMs in ComfyUI

ComfyUI is an engine specialized for image generation, so its LLM functionality is limited. They work completely differently, after all.

That means you'll generally use core nodes, custom nodes, or external integrations.

TextGenerate node

This core node was added recently so that the text encoders used for image generation can also be used as LLMs / MLLMs.

Because it's brute-forced with nothing but ComfyUI's own code, it falls well behind dedicated engines such as llama-cpp in both speed and features.

Being able to run it in the core at all is great, of course, but for now it's not something I can recommend yet.

Gemma 3
Gemma 3
textgenerate_gemma3.json

Supported models

  • Gemma 3
  • Qwen3
  • Qwen-3.5

ComfyUI custom nodes

Download a model file and run it on your own PC, just like image generation models.

The main players here are lightweight models specialized for specific tasks, like caption generation or object detection.

Florence2
Florence2

Representative supported models

External LLM server integration

Delegate LLM inference to a dedicated engine like Ollama or LM Studio, and call it from ComfyUI via API.

Running on the same PC still means competing for VRAM, but the key advantage is keeping the inference environment separate from ComfyUI.

  • No pollution of ComfyUI's dependencies, making maintenance easier
  • Run it on a separate PC and connect over the network to eliminate VRAM contention entirely

→ External LLM Server Integration

Official paid API nodes

ComfyUI's official nodes for calling closed services like ChatGPT or Gemini via API.

Google_Gemini
Google_Gemini

Bluntly put, these are far smarter and faster than local models.

  • Zero load on your PC. You can run image generation while prompts are being refined in the background, with no impact on generation speed
  • That said, pay-as-you-go billing applies, and NSFW content will be blocked by guardrails, so keep that in mind

→ API Nodes


Side note: Are you already using one?

Recent image generation models (like Qwen-Image and Z-Image) embed MLLMs such as Qwen or Gemma as their text encoder — the component that understands your prompt.

It's there to understand text prompts and reference images for generation and editing, but put the other way around, that's all it's used for, which is a rather lavish setup. It would be fun if we could use it directly as an MLLM…