LLM API Request
LLM API Request – ComfyUI Node Guide
- output
This node's job is narrow and useful: it talks to a language model over HTTP and hands you back text. It ships inside the ComfyUI_sloppy-comic pack as the writer's-room half of the operation - the companion node, Generate Comic, expects a script in a specific text {prompt} text {prompt} format, and rather than typing that out by hand every time, you can have an LLM write it for you and feed the output straight into story.
What it is and how it works
It's a generic OpenAI-style chat-completions caller, not tied to any one model or vendor. You give it a system prompt and a user prompt, it packages them into a request and posts it to whatever url you point it at, then unpacks the response into a single string. The default URL - http://127.0.0.1:5000/v1/chat/completions - tells you the intended use case: a locally hosted model, not a cloud subscription. Point it at anything that speaks the OpenAI-compatible chat-completions shape - a local inference server, llama.cpp's own server mode, or a hosted endpoint if you've got one and don't mind supplying a key - and it should work. The pack's README frames it exactly this way: "hosted locally or on a remote server," your choice.
Note this node doesn't run a model itself - it's just the HTTP client. You need something actually listening on the other end of url before this does anything useful.
Inputs and outputs that matter
system_prompt/prompt- the two message fields sent to the model; system sets the behavior, prompt is the actual ask (e.g. "write a 4-panel comic script about…").url- the chat-completions endpoint, defaulting to localhost. If your server binds to a different port, you have to change this or every request just fails to connect.api_key- defaults to"none", fine for a local server with no auth. Fill it in for anything gated.model- the model name/id to request. Some local servers ignore this if they're only serving one model; others require the exact id.instruction_template- defaults toChatML, the chat-formatting template applied to your messages before they're sent. This matters more than it looks: local models are trained against a specific prompt template, and feeding them the wrong one produces confused or ignored instructions - a well-known local-LLM footgun, not unique to this node.max_tokens- response length cap, default 500. A full multi-panel comic script can bump into this; raise it if output is getting cut off mid-sentence.temperature,top_p,min_p,repetition_penalty- the standard decoding knobs controlling how random vs. repetitive the output is. Leave them at defaults unless you're specifically fighting repetition or blandness.seed- present on the node, and per the author's own README: it doesn't do anything. Don't rely on it for reproducible output.
Output is a single output string - wire it directly into Generate Comic's story input, or into any text-consuming/text-preview node if you just want to read what the model wrote.
Installing it
Same pack, same install as its sibling node: search ComfyUI_sloppy-comic in ComfyUI Manager, or cd ComfyUI/custom_nodes && git clone https://github.com/blob8/ComfyUI_sloppy-comic and restart. The README's pip install playwright opencv-python line covers the whole repo - this node itself doesn't lean on either, but it ships in the same install.
What the README doesn't hand you is the other half of the equation: a running local LLM server with its OpenAI-compatible API enabled. That's on you - spin one up, confirm which port it's actually serving on (the default 5000 in this node is just a guess, not a guarantee), and set url to match.
Troubleshooting
Connection refused or a hung request almost always means one of three things: nothing's listening on that port, the server's OpenAI-compatible endpoint isn't enabled, or the port in url doesn't match what the server actually bound to - curl the URL yourself outside ComfyUI first to rule the node out. Garbled or off-topic responses usually trace back to instruction_template not matching what the model was actually trained on - check the model card for the template it expects rather than assuming ChatML is universal. Output cutting off mid-script is max_tokens being too small for the job. And if you'd rather skip the LLM entirely, that's a legitimate option the author calls out directly - hand-write the story yourself, just keep it in the text {prompt} text {prompt} format Generate Comic expects.
This is a small, low-traffic node from a hobby pack with essentially no community footprint to lean on, so treat the README as the primary - and largely only - documentation available.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| system_prompt | STRING | — | |
| prompt | STRING | — | |
| url | STRING | http://127.0.0.1:5000/v1/chat/completions | — |
| api_key | STRING | none | — |
| model | STRING | none | — |
| instruction_template | STRING | ChatML | — |
| max_tokens | INT | 5000–999999 | — |
| temperature | FLOAT | 1.00-5–5 | — |
| top_p | FLOAT | 0.700–1 | — |
| min_p | FLOAT | 0.100–1 | — |
| repetition_penalty | FLOAT | 1.000–5 | — |
| seed | INT | 00–18446744073709550000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| output | STRING | — |