LLM (fal)
Call Gemini, Claude, or GPT from inside ComfyUI
- output
- reasoning
Sometimes the missing piece in a workflow isn't another image model - it's a language model to write the prompt. LLM is a text node: it calls a hosted large language model through fal and outputs a string you can wire into any prompt input downstream. Turn a lazy "cat" into a richly detailed image prompt, summarize something, rewrite captions, generate variations - the text glue that makes the rest of your graph smarter.
It's part of gokayfem's ComfyUI-fal-API pack (the same author made the popular VLM Nodes, so language-model-in-ComfyUI is well-trodden ground for them). Nothing runs locally; you're calling a hosted model and paying per token via fal.
How it works
You pick a model, give it a prompt (and optionally a system prompt), and it returns generated text. There's no local model weight, no GPU load - just an API round-trip. The output is a plain STRING, so it drops straight into the text input of a CLIP encoder, another fal node, or a text-template utility.
The inputs and outputs that matter
prompt- your request or the text to transform.model- the menu that matters:google/gemini-2.5-flash(the fast, cheap default),anthropic/claude-sonnet-4.5,openai/gpt-4.1,openai/gpt-oss-120b,meta-llama/llama-4-maverick, orCustom. Pick Gemini Flash for quick prompt expansion; reach for a heavier model when the task actually needs it.system_prompt- set the behavior once, e.g. "You are a prompt engineer. Expand the user's idea into a vivid, detailed image prompt. Output only the prompt." This is where you get consistent, usable output instead of chatty filler.temperature(0–2, default 1) - creativity dial. Lower for predictable rewrites, higher for variety.
Two more: reasoning (a toggle that routes to reasoning-capable behavior and populates the second output), and, for model = Custom, custom_model_name to name any fal-hosted LLM, plus max_tokens to cap length (0 = model default). Outputs are output (STRING, the answer) and reasoning (STRING, the thinking trace when reasoning is on).
How to install it
Via ComfyUI Manager: search ComfyUI-fal-API, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/gokayfem/ComfyUI-fal-API.git
pip install -r ComfyUI-fal-API/requirements.txt
No models download. Add a fal API key to config.ini under [API] (from config.ini.example) or export FAL_KEY=your_key, restart, and find it under FAL/LLM.
Common issues & troubleshooting
- Auth error.
FAL_KEYnot set. Fix and restart. - The output is chatty or wrapped in filler. Use the
system_promptto demand a clean result ("output only the prompt, no preamble"), and lowertemperaturefor consistency. Custommodel does nothing. WhenmodelisCustom, you must fillcustom_model_namewith a valid fal-hosted LLM id, or there's nothing to call.- The
reasoningoutput is empty. It only fills whenreasoningis toggled on and the chosen model supports it. - Cost. It's a paid per-token call. Long outputs on a big model add up; cap
max_tokensand prefer Gemini Flash for routine prompt work. The pack's result cache serves identical calls free (force_rerunbypasses). - Windows Portable. Missing
fal-client?python_embeded\python.exe -m pip install fal-client.
The best use is quiet and upstream: a small node that turns your one-line idea into a proper prompt before it ever reaches the image model. Set a good system prompt once and it pays off on every run.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | — | |
| model | COMBO | google/gemini-2.5-flash | 6 options: google/gemini-2.5-flash, anthropic/claude-sonnet-4.5, openai/gpt-4.1, openai/gpt-oss-120b, meta-llama/llama-4-maverick, Custom |
| system_prompt | STRING | — | |
| temperature | FLOAT | 1.00–2 | — |
| reasoning | BOOLEAN | false | — |
| max_tokensopt | INT | 00–100000 | — |
| custom_model_nameopt | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| output | STRING | — |
| reasoning | STRING | — |