SuperAPI AI Directory

ecommerce-images

Design & creation

View repository

Updated 10-16 08:24

About this skill

E-commerce main image/detail image workflow (script-free version)

Execute according to the following process, and do not create custom code scripts for this skill.

Input specification

  • Required input:
    • Product original image path (local file, can be used as a reference image)
  • Optional input:
    • mode:main | detail | both(default both)
    • mainStyle: main image style name (recommended)
    • detailStyle: detail image style name (recommended)
    • detailCount: number of detail images (when mode=detail|both , must ask; if the user has not provided it, ask first)
    • quality、imageSize、model(passed through to the image generation skill)
    • ar(optional override; if not passed, use the default ratio)

Execution order

  1. Verify that the input image exists and is readable.
  2. Determine the generation target based on mode :
    • main: generate only the main image
    • detail: generate only the detail image set
    • both: generate the main image first, then the detail image set
  3. When mode=detail|both , first ask the user "How many detail images are needed?", and after obtaining detailCount , execute.
  4. Assemble Chinese prompts for each target image according to the style name.
  5. First call banana-proxy to generate:
    • Use the reference image (--ref)
    • Default ratio:
      • Main image:1:1
      • Detail image:3:4
    • Suggested output paths:
      • Main image:out/ecommerce-images/<原图名>_main_<风格key>.png
      • Detail image i:out/ecommerce-images/<原图名>_detail_<风格key>_n<i>.png
  6. If banana-proxy fails, immediately fall back to baoyu-image-gen:
    • keep the same prompt, reference image, and output path conventions
  7. Return a structured result, including at least: mode, style name, number of detail images, final output path of each image, and the provider actually used.

Provider strategy

  • Default:banana-proxy
  • Fallback:baoyu-image-gen
  • Reverse order is prohibited (unless the user explicitly requests it)

Style selection (extensible)

Main image styles (mainStyle):

  • 白底极简(default)
  • 卖点文案
  • 轻场景

Detail image styles (detailStyle):

  • 卖点总览(default)
  • 参数规格
  • 场景对比

When an undefined style name is received, fall back to the default style, and state in the result that a fallback occurred.

Detail image set rules

  • detailCount Suggested values for3-6 : images (adjustable according to user requirements).
  • Each image in the set needs a clear division of roles to avoid repeated compositions. Example division of roles:
    • Image 1: overview of core selling points
    • Image 2: partial close-up
    • Image 3: parameters/specifications
    • Image 4: usage scenario
    • Image 5: comparison or additional details
  • If the user only says "generate detail images" but does not give a quantity, you must first ask for the quantity, then start generation.

Prompt template

Main image 白底极简:

基于参考图片中的商品,生成一张电商平台可用的商品主图。
要求:
1) 商品为唯一主体,完整不截断、无遮挡。
2) 使用干净白色或浅色背景,画面简洁。
3) 不添加Logo、水印、价格角标、二维码。
4) 光线均匀,突出材质与轮廓,符合主流电商审核要求。

Detail image 卖点总览:

基于参考图片中的商品,生成一张电商详情页模块图。
要求:
1) 以商品为主体,可展示2-3个局部特写。
2) 可添加少量简短中文卖点,排版清晰易读。
3) 背景可轻场景化,但不喧宾夺主。
4) 不添加Logo、水印、二维码或平台强绑定UI元素。

Environment variables

  • When using banana-proxy :
    • LNAPI_KEY(required)
  • When using baoyu-image-gen fallback:
    • Prefer GOOGLE_API_KEY, or OPENAI_API_KEY

Output convention

  • mode=main: return the main image path
  • mode=detail: return the detail image path
  • mode=both: return the main image and detail image paths
  • Detail images return an array:savedDetailImages[]
  • Include for each image the provider(banana-proxy or baoyu-image-gen) and styleKey

user-facing wording

  • First confirm the style in natural language, for example:
    • "Should the main image be minimalist with a white background, or include selling-point copy?"
    • "For the detail images, do you want a selling-point overview, parameter specifications, or scenario comparison?"
  • If the user says "default style", then use for the main image 白底极简, and for the detail images 卖点总览。