ComfyUI Node

Kimi K2.6

Kimi K2.6 — a 1M-token-reasoning model as a ComfyUI node

By Runware·Created 2 years ago·Updated about a month ago· 140
Kimi K2.6
  • messages
  • images
  • text
seed0
numberResults1
includeUsagefalse
settings.frequencyPenalty0.00
settings.maxTokensfalse
settings.maxTokens_value1
settings.minP0.00
settings.presencePenalty0.00
settings.promptCacheKey
settings.repetitionPenalty1.00
settings.systemPrompt
settings.temperature1.00
settings.thinkingLevelnone
toolChoicefalse
toolChoice.name
toolChoice.type(default)
settings.topK0
settings.topP1.00
outputFormatTEXT
advanced_json

Kimi is Moonshot AI's model line, and the K2 series has a reputation for strong open-weights reasoning - the kind of model people use for the thinking-heavy jobs that small local LLMs embarrass themselves on. K2.6 is the current tier, and this node puts it inside ComfyUI as a text node with a serious spec: an up-to-1,000,000-token output ceiling via settings.maxTokens_value, five levels of settings.thinkingLevel, tool calling, JSON schema output, and vision via an IMAGE input.

Why would a ComfyUI user want this? Same reason you'd want any good LLM node: prompt rewriting, captioning, structured JSON generation for downstream nodes, and decision logic in multi-step workflows. K2.6's edge is the combination of a huge context, cheap reasoning levels, and JSON output - which makes it genuinely useful as a workflow brain that hands structured data to the rest of the graph.

How it works

The standard pack text-node path: required messages socket (Runware Messages builder: role + content, stackable), a textInference request, and a STRING text output. Where K2.6 stands out is the control surface - it exposes more thinking and output control than the other text nodes in the pack.

Inputs that matter

  • messages (required) + settings.systemPrompt - conversation and system instruction. For structured-output workflows, put the format spec in the system prompt and use outputFormat: JSON.
  • settings.thinkingLevel - none, low, medium, high, xhigh (default none). This is the knob that makes K2.6 interesting: it's a reasoning model, but unlike some peers it lets you dial reasoning from off to extreme. For pipeline tasks, none/low is fast and cheap; for hard analysis, high/xhigh. Defaulting to none is a nice "don't pay for thinking you didn't ask for" default.
  • outputFormat - TEXT or JSON. JSON mode is the underrated one: combined with the advanced_json jsonSchema field, you can get reliably-structured output out of a text node - hugely useful when the result feeds other nodes.
  • settings.maxTokens - off-by-default gate with maxTokens_value (up to 1,000,000). That ceiling is enormous; leave the gate off for the model default, and only flip it on if you're doing something genuinely long. One careless 1M-token call is a bill, not a result.
  • images - an IMAGE input, so K2.6 is vision-capable: wire a rendered image in and ask for analysis, captioning, or critique.
  • settings.promptCacheKey - a cache key for reusing prompt processing across requests. If you're running the same big system prompt repeatedly (batch captioning, same-context loop), set a key and the repeated prefix gets cached - a real cost saver for cloud LLM use.
  • toolChoice / toolChoice.type / toolChoice.name - tool calling via advanced_json (tools). auto/any/tool/none.
  • settings.temperature (default 1), settings.topK (default 0), settings.topP (default 1), minP, the three penalties - full sampler set. For deterministic pipeline work, drop temperature to ~0.2.
  • numberResults (1–4), seed, includeUsage - variations and spend visibility.

Single output: text (a STRING - if you chose JSON mode, it's a JSON string; parse it in a downstream node).

Installing

cd ComfyUI/custom_nodes
git clone https://github.com/Runware/ComfyUI-Runware
pip install -r ComfyUI-Runware/requirements.txt

Or ComfyUI Manager → search Runware → install → restart. API key via Settings, RUNWARE_API_KEY, or runware auth login.

The honest caveats

The 1M-token output ceiling is real but you will almost never touch it - and the cost scales with what you use, so default to small. The advanced_json fields (jsonSchema, tools, settings.stopSequences) are where half the power lives, and they're easy to miss if you only look at the visible widgets. And remember the output is a plain string: wiring K2.6's answer into a workflow that needs numbers or booleans means you're parsing text (or using JSON mode) yourself. For "big-brain reasoning that hands structured answers to my graph," this is one of the best values in the pack.

CategoryRunware/Text/moonshotai

Inputs (22)

NameTypeDefaultDescription
messagesRUNWARE_MESSAGES
imagesoptIMAGE
seedoptINT00–9223372036854776000Random seed for reproducible generation. When not provided, a random seed is generated in the unsigned 32-bit range.
numberResultsoptINT11–4Number of results to generate. Each result uses a different seed, producing variations of the same parameters.
includeUsageoptBOOLEANfalseInclude token usage statistics in the response.
settings.frequencyPenaltyoptFLOAT0.00-2–2Penalizes tokens based on their frequency in the output so far. A value of 0.0 disables the penalty.
settings.maxTokensoptBOOLEANfalseEnable to set settings.maxTokens. Off uses the model's default.
settings.maxTokens_valueoptINT11–1000000Maximum number of tokens to generate in the response.
settings.minPoptFLOAT0.000–1Minimum probability threshold. Tokens with probability below this value are excluded from sampling.
settings.presencePenaltyoptFLOAT0.00-2–2Encourages the model to introduce new topics. A value of 0.0 disables the penalty.
settings.promptCacheKeyoptSTRINGCache key for reusing prompt cache across requests. Requests sharing the same key reuse cached prompt processing.
settings.repetitionPenaltyoptFLOAT1.000–5Penalizes tokens that have already appeared in the output. A value of 1.0 disables the penalty.
settings.systemPromptoptSTRINGSystem-level instruction that guides the model's behavior and output style across the entire generation.
settings.temperatureoptFLOAT1.000–2Controls randomness in generation. Lower values produce more deterministic outputs, higher values increase variation and creativity.
settings.thinkingLeveloptCOMBOnoneControls the depth of internal reasoning the model performs before generating a response.
toolChoiceoptBOOLEANfalseEnable to set toolChoice. Off uses the model's default.
toolChoice.nameoptSTRINGName of the specific tool the model must call. Required when type is `tool`.
toolChoice.typeoptCOMBO(default)Strategy the model uses to decide when and which tools to call.
settings.topKoptINT00–999Top-K sampling parameter that limits the number of highest-probability tokens considered at each step.
settings.topPoptFLOAT1.000–1Nucleus sampling parameter that controls diversity by limiting the probability mass. Lower values make outputs more focused, higher values increase diversity.
outputFormatoptCOMBOTEXTOutput format for the generated text.
advanced_jsonoptSTRINGOptional JSON merged into the request. For: settings.stopSequences, jsonSchema, tools

Outputs (1)

NameTypeDescription
textSTRING