Text Loader
A ComfyUI node in Zuellni/Text with 9 inputs and 1 output.
- PARAMS
The pack's text nodes let you generate prompts with an LLM instead of typing them - and Text Loader is the settings hub for that whole setup. It doesn't generate anything itself. It collects the API endpoint, the character, the instruction template, and every sampling parameter into one PARAMS dictionary that the pack's Text Prompt node (the one that actually calls the LLM) consumes. Loader without Prompt is a config you can't spend; Prompt without Loader is a node with no settings.
What it is
One output - a DICT of PARAMS - built from ten inputs. The values are packed into a request that gets POSTed to a running text-generation-webui instance, which must be started with --api and a preloaded model (the API can't swap models, so the model has to be loaded before ComfyUI starts asking).
The inputs that matter
api- the endpoint. Defaulthttp://localhost:5000/api/v1/chat, which is text-generation-webui's chat API. Change it if your webui is elsewhere or on another machine.character- the character name used in the chat prompt. The author's README example uses WizardLM; the default is "Example." This is where you shape how the LLM talks - a character definition that biases it toward prompt-writing.template- the instruction template, default"WizardLM". This must match the model's format in text-generation-webui ("might not be necessary" per the README, but wrong templates produce garbled output).
Then the sampling knobs, which you'll mostly leave alone unless you're tuning generation quality:
min_tokens/max_tokens(32 / 64) - the length envelope for generated prompts.temperature(2.0) - high by modern standards. This is aggressive sampling; text-generation-webui's chat mode with these defaults is tuned for the WizardLM-7B-uncensored style of creative, loose generation the author built this for.top_k(30),top_p(0.18),penalty(1.15) - the repetition penalty and nucleus/top-k sampling. Thepenaltyof 1.15 above 1.0 actively discourages repeating words, which matters when an LLM is generating prompts (LLMs love to loop).
The setup you actually need
Two machines running at once, effectively: ComfyUI, and a text-generation-webui with a model preloaded and --api on. The README's example startup for a WizardLM GPTQ model:
python server.py --api --model llama-7b-4bit-128g-wizard
Then wire PARAMS into the pack's Text Prompt node, give it a seed and a prompt, and it returns a string you can feed straight into a CLIP Text Encode. Round out the loop with Text Format to assemble and Text Condition to guard.
The gotchas
- The webui must be running and listening. If ComfyUI can't reach the endpoint you'll get connection errors, not a helpful message. Check that
--apiis on and the URL matches. - Model must be preloaded. The API can't load models, so whatever you want to chat with has to be loaded before you queue.
- The defaults are tuned for a specific setup (WizardLM-era models). With a modern model,
temperature=2will give you nonsense; drop it toward 1.0 and re-tunetop_p.
Install
Part of Zuellni/ComfyUI-Custom-Nodes, via ComfyUI Manager (search "Zuellni") or:
cd ComfyUI/custom_nodes
git clone https://github.com/Zuellni/ComfyUI-Custom-Nodes
Requires requests (usually already present) - no LLM runs inside ComfyUI, no model downloads. The pack is archived, and this node is the most environment-dependent of the text family: it works, but it's built around a specific 2023-era webui API that has evolved since. If the API shape has drifted on your webui version, this is where you'll feel it.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| character | STRING | Example | — |
| template | STRING | WizardLM | — |
| api | STRING | http://localhost:5000/api/v1/chat | — |
| min_tokens | INT | 321–2048 | — |
| max_tokens | INT | 641–2048 | — |
| penalty | FLOAT | 1.151–2 | — |
| temperature | FLOAT | 2.000–10 | — |
| top_k | INT | 300–1000 | — |
| top_p | FLOAT | 0.180–1 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| PARAMS | DICT | — |