Nodes/ComfyUI_DW_Chat/Moonshot Single Chat
ComfyUI Node

Moonshot Single Chat

One-and-done LLM chat via Kimi, no conversation state to fight

By yiwangsimple·Created 2 years ago·Updated about a year ago· 89
Moonshot Single Chat
    • response
    prompt
    model
    temperature0.3
    max_tokens1000
    system_message

    If Groq Chat is the pack's speed demon, Moonshot Single Chat is its "just answer me once and forget it" node. It talks to Kimi, Moonshot AI's chat model, through a single stateless call - every run sends your prompt fresh with no conversation history attached. That's the whole selling point: no hidden state, no surprise context bleed between runs, nothing to reset. You hit queue, you get one answer, the node is clean again.

    Mechanically it's the openai SDK pointed at Moonshot's compatible endpoint (https://api.moonshot.cn/v1) with your MOONSHOT_API_KEY from api_key.ini. You pick a context window, not a quality tier - moonshot-v1-8k, 32k, or 128k. They're the same model, so the choice is purely "how much text can I stuff in." If you're feeding it a long document or error log, grab the 128k variant; for one-line prompt expansion, 8k is plenty and cheaper.

    Inputs worth knowing:

    • prompt - your message, multiline.
    • model - the three moonshot-v1-* context sizes above.
    • temperature - defaults to a cool 0.3, which is sensible for structured output like prompt generation. Crank it for creative prose.
    • max_tokens - up to 128,000, so it's generous.
    • system_message - optional; set it to "you are a prompt engineer for Stable Diffusion" and this becomes a prompt-expander rather than a chatbot.

    Output is a single STRING named response. Same wiring as the rest of the pack: straight into a text preview, or into the Prompt Extractor if you asked for both a positive and negative prompt and want them split.

    Installing and keys

    It ships with the whole pack, so:

    cd ComfyUI/custom_nodes
    git clone https://github.com/yiwangsimple/ComfyUI_GroqChat
    

    restart, and copy api_key.ini.exampleapi_key.ini in the pack folder. Grab a key at platform.moonshot.cn/console/api-keys and put it in the MOONSHOT_API_KEY field. The openai>=1.0 dependency comes from requirements.txt.

    Gotchas

    If you get "MOONSHOT_API_KEY not set or invalid", the ini isn't where the node looks for it - same story as every API node in this pack: key goes in the pack root. And if you find yourself wanting the model to remember what you said last run, you're using the wrong sibling - that's the Multi Chat node's job, deliberately. The only real trap here is expecting context and not getting it; this node is stateless by design.

    Category🌙DW/Chat

    Inputs (5)

    NameTypeDefaultDescription
    promptSTRING
    modelCOMBO3 options: moonshot-v1-8k, moonshot-v1-32k, moonshot-v1-128k
    temperatureFLOAT0.30–2
    max_tokensINT10001–128000
    system_messageoptSTRING

    Outputs (1)

    NameTypeDescription
    responseSTRING