生成设计策略
The Art-Director Node That Writes Your Final Prompt for You
- product_image
- reference
- final_prompt
- design_strategy
Somewhere between "here's my product" and "here's a gorgeous marketing shot" there's a prompt. Writing it by hand is the fiddly part - you want lighting, props, camera angle, color tone, all matched to the actual product in the photo. KSDesignStrategy is the node that writes it for you, and honestly, it's the most useful idea in this whole pack.
What it does
You feed it the product image, the product_profile JSON from KSAnalyzeProduct, and an optional reference image. It asks a vision-language model to act as "an art director for product photography" and returns two things:
final_prompt- yourbase_promptplus a structured design strategy plus your negative prompt, all stitched into one string you can paste straight into an image generator.design_strategy- the raw JSON (lighting, props_layout, camera_angle, color_tone) if you want to inspect or reuse the pieces.
The design-strategy JSON is the clever bit. Instead of hoping the generator reads your vibes, the node has the VLM look at the actual product and decide, e.g., "side lighting, marble prop layout, 45° angle, warm tone" - then it hard-embeds that decision into the prompt text. That's the difference between a generic "high-quality product photo" and a shot that looks directed.
The inputs that matter
product_image- the product. The model studies the subject's appearance to make the strategy fit.product_profile- the JSON from KSAnalyzeProduct. Not strictly required to get output, but it's what makes the strategy specific.reference- a KS_REFERENCE object (from KSSelectReference). If it has an image, that image participates in the strategy; if it's empty, the node treats it as pure AI design.base_prompt- default"Create a high-quality professional e-commerce product photograph."Make it specific to your style and use case; the node keeps it and appends strategy to it.negative_prompt- default"low quality, blurry, text, watermark, distorted product". Leave blank to skip appending one.
Like all the Kongshan API nodes, provider / api_key / model start at default, which resolves through the pack's bundled pipeline.config.json (default VLM provider: opencode, model mimo-v2.5). Keys come from env vars (OPENCODE_API_KEY, OPENROUTER_API_KEY, Gemini_API_KEY_FREE, GEMINI_API_KEY). Every run is a live API call with a per-image cost - this isn't running a local model.
Installing
Same as every node in this pack - install Kongshan Nodes, not the node by itself:
cd ComfyUI/custom_nodes
git clone https://github.com/kongshan4219/ComfyUI-Kongshan-Nodes
restart ComfyUI, and make sure at least one of the four env keys is set (copy the pack's .env.example to .env). ComfyUI Manager's "Install via Git URL" works too.
Troubleshooting
- "No default model configured for category: vlm" - the bundled
pipeline.config.jsonis missing or unreadable. The pack ships it insidesrc/py/api/; if you moved files around, that's what broke. - Final prompt ignores your base_prompt - it shouldn't; the base prompt is literally the first line of
final_prompt. If the output looks like it dropped it, the VLM returned garbage JSON and the strategy string is malformed - checkdesign_strategyoutput. - It's slow / costs money every run - yes. That's the nature of a hosted VLM wrapper. The pack's generator node (
KSGeminiGenerate) also re-calls the API every run by design, so a "warm-up" run on a test image is normal.
One honest caveat: this pack is young and tiny (zero impressions on every node), and the whole API group is one author's opinionated pipeline for Chinese marketplace (1688-style) product photography. The strategy JSON fields are tuned for that world - which is exactly why they work so well if that's your world too.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| product_image | IMAGE | 商品图片。模型会参考主体外观,生成更贴合商品的拍摄策略。 | |
| product_profile | STRING | 商品特征 JSON,通常来自“分析商品图”节点。 | |
| reference | KS_REFERENCE | 参考图对象。包含图像时会参与策略生成;为空时按纯 AI 设计处理。 | |
| base_prompt | STRING | Create a high-quality professional e-commerce product photograph. | 基础正向要求。内容越具体,最终 final_prompt 越贴近目标风格、场景和用途。 |
| negative_prompt | STRING | low quality, blurry, text, watermark, distorted product | 负向要求。留空则不追加 Negative prompt;填写后用于约束低质量、文字、水印、变形等问题。 |
| provider | COMBO | default | 策略生成供应商。default 使用配置文件 vlm.defaults.provider。 |
| api_key | COMBO | default | API 密钥名称。default 使用配置文件默认密钥。 |
| model | COMBO | default | 策略生成 VLM 模型。不同模型会影响策略细节、稳定性、速度和费用。 |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| final_prompt | STRING | — |
| design_strategy | STRING | — |