StepFun Chat Completion
Show an image to a cloud vision model and get a caption back without touching your VRAM
- client
- image
- response
- total_tokens
- finish_reason
StepFun Chat Completion is the node this whole pack orbits around. You drop an image into it, it asks a cloud vision model what's in the picture, and you get the answer back as plain text you can wire straight into a prompt, a CombineStrings node, or a ShowText display. No local model, no VRAM, no download - just your API key and an internet connection.
That's the whole pitch of these StepFun nodes, and it fits a wider pattern you'll see all over ComfyUI now: offloading the "understanding" part of a workflow to a hosted API while the diffusion part stays local. The image you generate on your GPU gets captioned by a model that never touches it. It's the same dynamic that makes people reach for cloud vision models in the first place - the local-vs-cloud tradeoff is real, and for captioning, cloud wins on convenience every time.
How it works
The node takes the STEPFUN_CLIENT object from the StepFunClient node - you have to make one first and feed it the API key. On run, it converts your IMAGE tensor to a PNG, base64-encodes it, and sends it to StepFun's OpenAI-compatible endpoint (api.stepfun.com/v1) as an image message alongside your system and user prompts. The whole pack is a thin wrapper over the official OpenAI Python SDK pointed at StepFun's URL.
One detail worth knowing: the image gets resized before upload. detail defaults to low, which caps the long side at 1280px; high allows 2688px. Higher detail means better fine-print reading but more tokens billed, so low is the sensible default for captioning.
Inputs and outputs that matter
- client - the
STEPFUN_CLIENTfrom StepFunClient. Required. - model -
step-1v-8k,step-1v-32k,step-1.5v-mini, orstep-2-16k. Default isstep-1.5v-mini, and that's the one to use with images. - system_prompt / user_prompt - the system prompt defaults to
Describe the picture, which is a fine starting point. User prompt is optional. - detail -
loworhigh, as above. - json_mode - a boolean that forces the API to return a JSON object. Pair the output with the pack's JSONParser node to split fields.
- image - the only optional input, type
IMAGE. Leave it unconnected and the node becomes a plain text chat call.
The outputs are all strings: response (the caption/answer - this is the one you want), total_tokens, and finish_reason.
Here's the trap: if you pick step-2-16k and attach an image, the image is silently ignored - the code only sends image content for models that don't start with step-2. The 16k model is a text model here. Pick a step-1v model when you want vision.
Installing and setting up
Install via ComfyUI Manager (search "ComfyUI-SCStepFun") or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/chenbaiyujason/ComfyUI_StepFun
cd ComfyUI_StepFun
pip install -r requirements.txt
Restart ComfyUI after. The only real dependency is the openai package (the oss2 line in requirements.txt isn't actually used by the shipped code). You also need an API key from platform.stepfun.com - it's a paid, hosted service, so there's no GPU requirement but there is billing.
Common issues
- 401 / auth errors - the key in your StepFunClient is wrong, or missing. That's the first thing to check.
- "No module named openai" - the pack imports
openaiat module load, so a missing install takes down the whole node list.pip install openaifixes it. - Silently missing image - you picked
step-2-16k. See above. - Your key travels with the workflow - the API key lives in the StepFunClient widget, so it's embedded in the workflow JSON and in any PNG metadata you save. Don't share workflows that contain a real key.
Worth being honest: this pack is small and lightly used - the README even says "more nodes are being updated." If you're already paying for a vision API and want it inside the graph, this works fine. If you're not sure you need it, try a local captioning node first; you only reach for StepFun when you want cloud-grade vision without spending VRAM on it.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| client | STEPFUN_CLIENT | — | |
| model | COMBO | step-1.5v-mini | 4 options: step-1v-8k, step-1v-32k, step-1.5v-mini, step-2-16k |
| detail | COMBO | low | 2 options: low, high |
| system_prompt | STRING | Describe the picture | — |
| user_prompt | STRING | — | |
| json_mode | BOOLEAN | false | — |
| temperature | FLOAT | 0.50–2 | — |
| top_p | FLOAT | 0.90–1 | — |
| max_tokens | INT | 20481–8192 | — |
| imageopt | IMAGE | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| response | STRING | — |
| total_tokens | STRING | — |
| finish_reason | STRING | — |