Dify Text Generator
Drop a hosted LLM into your graph and wire its answer into your prompt
- STRING
LLM-assisted prompting went from a browser tab to a node, and this is the "call the hosted service" flavor: Dify Text Generator (DifyTextGenerator-Browser) talks to a Dify app's chat API and hands you back the answer as a plain STRING. Wire that straight into a CLIP Text Encode and your prompt is now being written by whatever LLM workflow you've built in Dify - no model running on your machine.
What it's for
Dify is an open-source LLM app platform - you build prompts, agents, and LLM workflows in a drag-and-drop UI, deploy them, and hit them over HTTP. It's genuinely popular with people who want a proper LLM pipeline (tool calls, branching, RAG) without building it inside ComfyUI. People post on r/comfyui asking how to get "a Dify-like thing" into their graphs; the common answer is a node like this one. It's a thin client: your Dify app does the thinking, this node just relays.
The practical use is prompt engineering as a service. You keep the actual prompting logic in Dify - where you can iterate on it without touching the workflow - and ComfyUI just consumes the result. For tag-based models, Dify's LLM can be told to emit comma-separated booru tags; the output feeds directly into your prompt box.
How it works
On run, the node POSTs to your endpoint with:
Authorization: Bearer <api_key>response_mode: blocking(it waits for the full answer rather than streaming)inputscontaining yourquery(or your custom JSON)
It returns the answer field from the response as the node's STRING output. That's the whole mechanism - one HTTP call, no local model, no heavy dependencies. The source even clears HTTP(S) proxy settings before the call, a nod to people running ComfyUI on AutoDL-style cloud boxes where a proxy breaks local endpoints.
The inputs that matter
- dify_api_endpoint (required) - the full chat-messages URL of your Dify app.
- api_key (required) - the app's API key from the Dify dashboard.
- query (optional) - your input, sent as the app's
queryvariable. - inputs_json_str (optional) - JSON that overwrites the
queryfield if you need to pass multiple variables to the Dify app.
One quirk straight from the code: inputs_json_str gets brace-wrapped by the node itself ("{" + inputs_json_str + "}"), so paste the inside of the JSON object without the outer { }. Paste full braces and the JSON will be malformed. It's weird, but it's the documented behavior.
Install
Same pack, same story:
cd ComfyUI/custom_nodes && git clone https://github.com/talesofai/comfyui-browser
or ComfyUI Manager → search comfyui-browser. Restart after. The node needs nothing beyond the pack's light requirements - but note it does not install Dify. Dify itself is a separate deployment (their Docker Compose stack, or their hosted cloud), and you need a working app with a chat endpoint before this node is useful.
Troubleshooting
Most failures are auth or plumbing. A 401/403 means the API key is wrong or the app isn't deployed for API access. A non-2xx response raises Request Dify Error: <body> - check that the endpoint is the exact chat URL and reachable from your ComfyUI machine (it's a server-side call, not from your browser). And remember the node expects Dify's {"answer": ...} response shape; if you point it at a random endpoint, it'll parse garbage.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| dify_api_endpoint | STRING | — | |
| api_key | STRING | — | |
| queryopt | STRING | — | |
| inputs_json_stropt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |