Set iFLYTEK Spark LLM Service Connector ๐
Two dropdown entries and a URL that picks the model for you
- llm_service_connector
What it is
The thinnest connector in the pack, and the one that looks strangest the first time you open it: the model dropdown has two entries, spark-x and Custom, and neither of them is really the thing selecting the model. This connects iFLYTEK's Spark (่ฎฏ้ฃๆ็ซ) to your graph - useful if you already have a Spark account, or if you're building for a Chinese-language pipeline where it's cheap and available.
Like every sibling here, its only job is to hand you an llm_service_connector socket.
Why the weird dropdown? Spark X2's HTTP protocol selects the generation by URL path, not by model name. The docs' model value for that endpoint is literally spark-x; the path is what says "X2". X1.5 lives under /v2/, and the retired lite/generalv3 classics under /v1/. This connector points at /x2/, so spark-x is not a placeholder - it's the correct string, and typing something else into custom_model won't move you to a different generation. If you specifically need a legacy Spark model, the pack's SetGeneralLLMServiceConnector with the /v1/ base URL is the route.
How it works
The request goes to https://spark-api-open.xf-yun.com/x2/chat/completions with your console-issued APIPassword as a Bearer token. The payload is deliberately slim - model, messages, stream: false, max_tokens - because Spark's documented HTTP surface for this generation is messages/stream/temperature-shaped and the sampling extras aren't guaranteed. If you're used to tuning top_k or penalties on other connectors, you won't here; that's intentional, not missing.
Retries, timeout and reasoning-block stripping come from the shared base class: three attempts five seconds apart on timeouts/connection errors/5xx, a 30-second per-request timeout, and <think> blocks removed from replies.
Inputs and output
api_token - the APIPassword from the iFLYTEK console, not the AppID or the APIKey. Those three fields sit next to each other in the console and this is the single most common reason the node returns a 401.
model_select - spark-x (default) or Custom.
custom_model - only meaningful with Custom; remember that the generation is chosen by path here, so this is not a "switch to a bigger model" lever.
config_file, config_key (default spark), prefer_local_config. Output: llm_service_connector, into CallLLMService, Translator, PromptGenerator, or CheckLLMServiceConnectivity for a one-request check.
Installing and keying it
cd ComfyUI/custom_nodes
git clone https://github.com/MieMieeeee/ComfyUI-MieNodes
cd ComfyUI-MieNodes && python -m pip install -r requirements.txt
Restart. ComfyUI Manager: search ComfyUI_MieNodes (publisher mie). No weights, no GPU work - this is an HTTP client with a UI.
cp mie_llm_keys.json.example mie_llm_keys.json
# "spark": "<APIPassword>"
prefer_local_config defaults to True, so the file's spark entry overrides the api_token box on the node. Put the APIPassword in the file and start from there when debugging auth.
Common issues
401 that no key seems to fix. Check that you've copied APIPassword and not APIKey/AppID, and that you're reading the Spark X2 credentials rather than an older service's.
"Why can't I pick a bigger model?" Because on X2 the path decides, and this node is pinned to X2. Use the general OpenAI-compatible connector with a different Spark base URL if you need an older generation.
Timeouts on long rewrites. 30 seconds per attempt, three attempts. A long output can still blow the budget; keep prompt-writing jobs short and structured rather than asking for a page of prose.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| api_token | STRING | โ | |
| model_select | COMBO | spark-x | 2 options: spark-x, Custom |
| custom_modelopt | STRING | โ | |
| config_fileopt | STRING | mie_llm_keys.json | โ |
| config_keyopt | STRING | spark | โ |
| prefer_local_configopt | BOOLEAN | true | โ |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| llm_service_connector | LLMServiceConnector | โ |