分析商品图
It Reads Your Product Photo So the Rest of the Pipeline Can Talk About It
- image
- image
- product_profile
The first thing every product-photo pipeline needs is a way to talk about the product you just loaded. KSAnalyzeProduct is that step: it sends your image to a vision-language model and gets back a structured JSON profile - subject, main colors, material, shape, style tags - that the other Kongshan API nodes can actually consume.
What it's actually for
This is the entry node of the pack's e-commerce workflow, and it's pure plumbing. Drop in a product photo, and out comes a product_profile string that KSDesignStrategy reads to generate a shooting strategy, and that KSSelectReference reads to match a style reference. If you're hand-typing "red leather handbag with gold hardware" into a prompt, this node does that job automatically - and keeps the description in a format a machine can merge with other steps instead of a blob of prose.
The image input passes straight through to the image output untouched, so you can chain Analyze → DesignStrategy → Generate in a straight line. The product_profile output is the thing that matters: pretty-printed JSON with subject, main_colors, material, shape, and style_tags.
How it works
Under the hood it's a single VLM chat call. The image gets base64-encoded into a data URL, sent to the provider with a system prompt that demands "valid JSON with subject, main_colors, material, shape, and style_tags," and the parsed JSON comes back as your profile. Nothing runs locally - no GPU, no models. It's an HTTP request with your API key, exactly the API-wrapper-node pattern described in the KB's external-api-nodes essay, so it costs a little per image and needs network access.
The three dropdowns - provider, api_key, model - all start showing just default, which reads from the pack's bundled pipeline.config.json. Out of the box that's provider opencode, model mimo-v2.5 for VLM calls. A frontend extension in the pack fetches the real provider/model lists from /ks-nodes/models and populates the dropdowns when ComfyUI loads, so default is a sane starting point rather than a dead end.
Installing it
This is one node of the Kongshan Nodes pack, so you install the pack, not the node:
cd ComfyUI/custom_nodes
git clone https://github.com/kongshan4219/ComfyUI-Kongshan-Nodes
then restart ComfyUI. Or use ComfyUI Manager → Install via Git URL with https://github.com/kongshan4219/ComfyUI-Kongshan-Nodes.git. Dependencies (requests, transformers, etc.) install from the pack's requirements.txt on first start.
Before anything works you need a key in your environment, from the pack's .env file (copy .env.example): OPENCODE_API_KEY, OPENROUTER_API_KEY, Gemini_API_KEY_FREE, or GEMINI_API_KEY. The API nodes read these at call time - no key, no analysis, and the error message will tell you exactly which key it wanted.
Where people get burned
- "Provider 'opencode' not found in configuration" - the config file lives inside the pack and reads fine, but your env var isn't set. Check
printenv OPENCODE_API_KEY. - Dropdown stuck on
default- the web extension that fills in real model names didn't load (browser cache, or aweb/dir that didn't install). It still works; you're just locked to the config defaults. - The profile comes back as prose, not JSON - a weaker VLM occasionally wraps the JSON in markdown fences or adds commentary. The node asks hard for valid JSON, but if your provider is flaky, the
product_profilestring may not parse downstream. This is a "try a stronger model" fix, not a settings fix.
It's a niche pack from a niche author - 0 impressions on every node as of this writing - so treat it as "one person's battle-tested e-commerce pipeline, freshly open-sourced." If you run Alibaba/1688-style seller photos, this is exactly that person's daily driver.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | 待分析的商品图片。节点会把它发送给视觉语言模型,并原样传递到输出 image。 | |
| provider | COMBO | default | 视觉语言模型供应商。default 使用配置文件 vlm.defaults.provider;选择具体供应商会覆盖默认值。 |
| api_key | COMBO | default | API 密钥名称。default 使用配置文件默认密钥;选择其他名称会读取对应密钥或环境变量。 |
| model | COMBO | default | 分析商品图用的 VLM 模型。default 使用配置文件 vlm.defaults.model;不同模型会影响识别细节、速度和费用。 |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| product_profile | STRING | — |