OpenRouter Text
The half of the Jev pack that writes the options
- text
- response_json
What it is
OpenRouter Text is the plain one in the Jev pack, and probably the first node you'll wire up. It's a chat completion from inside the graph: type a prompt, pick a model, get text back as a STRING you can connect to anything. No schema to write, no local model to load.
Two things make it more than "another API node". The model list is pulled from OpenRouter's catalog when ComfyUI starts, so you're browsing real model IDs instead of guessing. And it has a candidates mode that generates complete alternative prompts as a clean array - exactly the input Jev Interpret's candidates_json wants.
The two modes
output_mode = text is a straight generation. Your prompt goes in as the user message (with system ahead of it if you filled it in), the model answers, you get text.
output_mode = candidates sets a count (2–100, default 4) and gets back a JSON array of complete, standalone candidates. Under the hood the node appends its own system instruction demanding exactly N distinct candidates, each usable on its own, with no numbering or commentary - and it requests a strict JSON schema response with provider: {"require_parameters": true}, so OpenRouter only routes to providers that genuinely support Structured Outputs. Then it checks the work: the finish reason has to be stop, the array has to be exactly the length you asked for, and duplicates or empties are rejected. Truncated generations fail loudly instead of quietly handing you half a prompt.
A chat model asked for "five prompt ideas" gives you 1. , **Option A:** and a preamble paragraph - all of which bleeds straight into your conditioning. Candidate mode doesn't have that failure mode, and line breaks survive inside each candidate, so a structured multi-line prompt isn't flattened.
Inputs worth setting
prompt- the generation request. Accepts connections from Text or Format Text nodes, which is how you chain it after Jev Skill Choice.system- optional instructions for the model. Wire Jev Skill Choice'stextoutput here and the selected guidance frames the generation whilepromptcarries the ask.output_mode-textorcandidates; in candidates mode you also setcount.model- a text-in/text-out entry from the OpenRouter catalog, orcustomto type an ID by hand. The catalog is fetched at startup with a ten-second timeout; if that fails, the node falls back to the last list it saved. Restarting ComfyUI refreshes it.api_key- empty usesOPENROUTER_API_KEY, and that's the one you want. The environment variable is shared with Jev Interpret when it's set to the OpenRouter provider.temperature(0.7) andmax_tokens(2048, up to 131072) are the advanced knobs. Temperature is how much variety you get between candidates;max_tokensis your truncation budget.
Outputs
text is the payload - a STRING for any text input, or the candidates array into Jev Interpret's candidates_json. response_json is the raw API response with model name and token usage: the honest way to see what happened, and what it cost.
Installing it
It comes with the pack. Search ComfyUI-Jev in ComfyUI Manager and restart, or:
cd /path/to/ComfyUI/custom_nodes
git clone https://github.com/hndrr/ComfyUI-Jev.git
ComfyUI 0.36.0+ and Python 3.10+. The pack's dependencies (aiohttp>=3.11.8, PyYAML) are already present in a normal ComfyUI install; if the node fails to import, install them into the environment ComfyUI runs in:
python -m pip install "aiohttp>=3.11.8" PyYAML
Then the key, set before you launch ComfyUI:
export OPENROUTER_API_KEY="your-openrouter-key"
$env:OPENROUTER_API_KEY="your-openrouter-key"
Common issues
- The model dropdown is empty. The startup fetch didn't happen - no network, an OpenRouter hiccup, or a fresh install with no cache. Enter the ID with
customand restart ComfyUI to retry. - "Generation did not finish normally." The model hit
max_tokensand got cut off, and candidates are complete prompts - four of them is a lot of tokens. Raisemax_tokensor lowercount. - Candidates mode errors on your model. It requires Structured Outputs support, including for
customIDs. Plaintextmode doesn't ask for the schema and works on far more models. - Your prompt came back with a preamble. That's
textmode behaving like a chat model, because it is one. If boilerplate is getting into a conditioning path, use candidates mode and pick a clean one. - Re-running gives identical output. ComfyUI cached the node. Change
refreshto regenerate; the sampler's seed or resolution won't do it. - The key is in the workflow. Anything typed into
api_keyis saved in the workflow JSON and the execution history - use the environment variable, or scrub the field before sharing. And this node's whole job is sending your prompt to someone else's server, so don't put anything private in it.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | Suggest distinct photographic concepts for a perfume advertisement as English image generation prompts. | — |
| system | STRING | Optional instructions for the text model. | |
| output_mode | COMBO | 2 options: [object Object], [object Object] | |
| model | COMBO | Text models from the OpenRouter catalog, loaded when ComfyUI starts. Select custom to enter a model ID. | |
| api_key | STRING | Empty uses OPENROUTER_API_KEY, shared with Jev Interpret using OpenRouter. Entered keys are saved in workflows. | |
| refresh | INT | 0 | — |
| temperatureopt | FLOAT | 0.700–2 | — |
| max_tokensopt | INT | 20481–131072 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |
| response_json | STRING | — |