Kimi API Assistant (PixNodes)
Call Kimi (Moonshot AI) from inside your workflow — no GPU needed
- images
- text_response
- history
The name is a lie in the best way: despite "API Assistant" sounding like a setup chore, this node is just a chat client. You give it a prompt, it calls Moonshot AI's Kimi models over the network, and returns the text as a STRING you can wire straight into your graph. No local model, no VRAM, no GGUF files - it's the "the model isn't on my machine" pattern, and for many jobs that's a feature.
Kimi is Moonshot AI's family of Chinese-market frontier models, and it's an OpenAI-compatible API, which is why the pack's dependency story for this node is just openai (plus Requests from requirements.txt). Under the hood it builds a chat.completions request against base_url (default https://api.moonshot.cn/v1), sends your prompt, and returns response.choices[0].message.content.
The model dropdown
model defaults to kimi-k2-turbo-preview, and the list is honest about what's there: the K2 line (kimi-k2-0905-preview, kimi-k2-turbo-preview, kimi-k2-thinking) plus the older moonshot-v1 text models and their -vision-preview variants. The practical rule: vision models for images, K2 for text. Feed an images tensor into a plain text model and it'll fail - the vision variants are the ones that accept image content.
The inputs that matter
api_key- required, but only the first time. The node saves whatever you enter toComfyUI/user/PixNodes/api_key.jsonand reuses it when you leave the field blank. That's convenient and also a plaintext key on disk, so keep the folder safe.promptandsystem_instruction- your message and the system framing (default "You are a helpful assistant.").max_tokens/temperature/top_p- all default to the string"auto", which means the node simply skips sending them. Type an actual number to send it.- Optional:
history(feed thehistoryoutput back in for multi-turn),input_file_text(appended as[File Context]), andimages(IMAGE - base64-encoded to JPEG for the vision models).
Outputs: text_response (STRING) and history (STRING - the full message list as JSON, ready to feed back in).
Install
Part of Comfyui-PixNodes. ComfyUI Manager → search "PixNodes" → install → restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/pixixai/Comfyui-PixNodes
then restart. (The README's manual-install block points at the wrong repo, ComfyUI-AlignLayout - use the URL above.) If Manager didn't pull deps, pip install openai from the pack folder.
Where people get burned
Three things. First, errors come back as strings in text_response - "Error: API Key invalid.", "Rate limit exceeded or balance low." - not red-node failures, so a silent text output can look like a real answer. Check for the Error: prefix. Second, the key file is plaintext; treat user/PixNodes/api_key.json as a secret. Third, this is a network call that costs money per request and requires the endpoint to be reachable - it's an API-wrapper node, and the whole category deserves a skeptical glance at what it sends where. For prompt enhancement, structured rewriting, or captioning a frame with a vision model, it does the job without touching your GPU - but it's a cloud dependency in a graph that otherwise runs offline, and you should decide whether that's a trade you want per call.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| api_key | STRING | — | |
| base_url | STRING | https://api.moonshot.cn/v1 | — |
| model | COMBO | kimi-k2-turbo-preview | 9 options: kimi-k2-0905-preview, kimi-k2-turbo-preview, kimi-k2-thinking, moonshot-v1-8k-vision-preview, moonshot-v1-32k-vision-preview, moonshot-v1-128k-vision-preview, +3 |
| prompt | STRING | — | |
| system_instruction | STRING | You are a helpful assistant. | — |
| seed | INT | 00–2147483647 | — |
| max_tokens | STRING | auto | — |
| temperature | STRING | auto | — |
| top_popt | STRING | auto | — |
| historyopt | STRING | — | |
| input_file_textopt | STRING | — | |
| imagesopt | IMAGE | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| text_response | STRING | — |
| history | STRING | — |