Nodes/Comfyui-PixNodes/Kimi API Assistant (PixNodes)
ComfyUI Node

Kimi API Assistant (PixNodes)

Call Kimi (Moonshot AI) from inside your workflow — no GPU needed

By pixixai·Created 8 months ago·Updated 6 months ago· 24
Kimi API Assistant (PixNodes)
  • images
  • text_response
  • history
api_key
base_urlhttps://api.moonshot.cn/v1
modelkimi-k2-turbo-preview
prompt
system_instructionYou are a helpful assistant.
seed0
max_tokensauto
temperatureauto
top_pauto
history
input_file_text

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 to ComfyUI/user/PixNodes/api_key.json and reuses it when you leave the field blank. That's convenient and also a plaintext key on disk, so keep the folder safe.
  • prompt and system_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 the history output back in for multi-turn), input_file_text (appended as [File Context]), and images (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.

CategoryPixNodes/LLM

Inputs (12)

NameTypeDefaultDescription
api_keySTRING
base_urlSTRINGhttps://api.moonshot.cn/v1
modelCOMBOkimi-k2-turbo-preview9 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
promptSTRING
system_instructionSTRINGYou are a helpful assistant.
seedINT00–2147483647
max_tokensSTRINGauto
temperatureSTRINGauto
top_poptSTRINGauto
historyoptSTRING
input_file_textoptSTRING
imagesoptIMAGE

Outputs (2)

NameTypeDescription
text_responseSTRING
historySTRING