Civitai Chat Completion
OpenAI-style chat completions with JSON, tools, and even image output — wired into your graph
- api_config
- id
- object
- created
- model
- choices
- usage
- system_fingerprint
- parsed
- workflow_id
- raw_json
The simple chat node in this pack is a wrapper; Civitai Chat Completion is the actual engine. It's an OpenAI-compatible chat-completion call with the whole parameter surface exposed - temperature, penalties, tools, structured JSON output - and it's the node you reach for when a single prompt-in/prompt-out wrapper isn't enough.
What it is
A chat completion step on Civitai's orchestration API. You hand it a model name and a messages_json array (the standard [{role, content}, ...] shape), and it returns the response plus every OpenAI field you'd expect. No local model, no VRAM - every call is billed in Buzz, same as the rest of the pack.
Inputs that matter
Required: model (e.g. "gpt-4o", "gpt-4-turbo", "gpt-4o-mini") and messages_json - a JSON array of messages, as text. This is one of the pack's "freeform structures stay JSON text" inputs, so you paste or compute the JSON string; the node validates it before submitting and errors locally if it doesn't parse.
The optional list is long but only a few earn your attention:
max_tokens(default 1 - remember to raise it),temperature(0–2),top_p- the usual sampling controls.tools_jsonandtool_choice_json- define tools the model can call;tool_choicecan be"auto","none","required", or an object naming a specific function.response_format_json- when set tojson_objectorjson_schema, the emitted content is parsed server-side and surfaced on theparsedoutput, which downstream steps can reference field-by-field (e.g.output.parsed.<field>via$ref). This is the structured-output path for building agents that produce data, not prose.modalities_json- default text-only; include"image"and the request routes to the image generation pipeline, returning generated images on the assistant message. That's the wildcard: one node that can hand back pictures.n- how many completions to generate.
Outputs
Ten of them, and the useful ones are: choices (the completions), usage (token counts - watch this on your Buzz bill), parsed (the structured-JSON result), and model/id/created for bookkeeping. Plus the pack-standard workflow_id and raw_json.
Install & gotchas
Same pack install as everything here - ComfyUI Manager (search Civitai Comfy Nodes), comfy node registry-install civitai-comfy-nodes, or git clone + pip install -r requirements.txt. Auth via CIVITAI_API_TOKEN, stored OAuth, or a wired Civitai Auth node.
Where beginners trip:
- The default
max_tokensis 1. The schema default really is1, so a fresh node returns a single token until you raise it. Bump to a few hundred. messages_jsonmust be valid JSON or the node fails fast with "Input 'messages_json' is not valid JSON". Single quotes will bite you - it needs proper JSON quoting.- Cost visibility. Every call is metered.
raw_jsonincludes usage/cost info; get in the habit of reading it on expensive runs. A402means out of Buzz. - It's a hosted frontier model, so filtering follows the provider. Unlike a local abliterated LLM, there are no weights to patch - whatever the service refuses, the node refuses.
Honest take: for a one-off text job, Civitai Chat (Simple) is friendlier. This node earns its complexity when you need tools, JSON output, or multimodal results inside a real workflow - that's where having an OpenAI-grade chat API as a graph node actually shines.
Inputs (17)
| Name | Type | Default | Description |
|---|---|---|---|
| model | STRING | The model to use for chat completion. Examples: "gpt-4o", "gpt-4-turbo", "gpt-4o-mini" | |
| messages_json | STRING | The messages to generate a completion for. | |
| temperatureopt | FLOAT | 1.000–2 | Temperature for sampling (0-2). Higher values make output more random. |
| top_popt | FLOAT | 1.000–1 | Nucleus sampling parameter. Consider tokens with top_p probability mass. |
| max_tokensopt | INT | 11–128000 | Maximum number of tokens to generate. |
| nopt | INT | 11–128 | Number of completions to generate. |
| stop_jsonopt | STRING | Up to 4 sequences where the API will stop generating tokens. | |
| presence_penaltyopt | FLOAT | 0.00-2–2 | Presence penalty (-2.0 to 2.0). Positive values penalize new tokens based on whether they appear in the text so far. |
| frequency_penaltyopt | FLOAT | 0.00-2–2 | Frequency penalty (-2.0 to 2.0). Positive values penalize new tokens based on their existing frequency in the text. |
| seedopt | INT | 00–4294967295 | Seed for deterministic sampling (beta feature). |
| useropt | STRING | A unique identifier for the end-user. | |
| tools_jsonopt | STRING | Tool definitions available for the model to call. | |
| tool_choice_jsonopt | STRING | Controls which (if any) tool is called by the model. Can be "auto", "none", "required", or an object specifying a particular function. | |
| modalities_jsonopt | STRING | Output modalities the model should produce. Defaults to text-only when omitted. Supported values: "text", "image". When "image" is included, the request is routed to the image generation pipeline and returns generated images on the assistant message. | |
| image_config_jsonopt | STRING | Image generation parameters used when Civitai.Orchestration.Grains.Workflows.Steps.ChatCompletion.ChatCompletionInput.Modalities contains "image". Mirrors OpenRouter's `image_config` shape on chat-completion requests. | |
| response_format_jsonopt | STRING | OpenAI-compatible response_format. When Civitai.Orchestration.Grains.Workflows.Steps.ChatCompletion.ChatCompletionResponseFormat.Type is `json_object` or `json_schema`, the LLM-emitted content is parsed as JSON server-side and exposed on Civitai.Orchestration.Grains.Workflows.Steps.ChatCompletion.ChatCompletionOutput.Parsed, allowing downstream workflow steps to reference individual fields via `$ref` paths like `output.parsed.<field>`. | |
| api_configopt | CIVITAI_CONFIG | Optional Civitai Auth connection; defaults to CIVITAI_API_TOKEN or stored OAuth login. |
Outputs (10)
| Name | Type | Description |
|---|---|---|
| id | STRING | — |
| object | STRING | — |
| created | STRING | — |
| model | STRING | — |
| choices | STRING | — |
| usage | STRING | — |
| system_fingerprint | STRING | — |
| parsed | STRING | — |
| workflow_id | STRING | — |
| raw_json | STRING | — |