Community影像github.com

Fishkiller111/ai-ecommerce-product-images

使用真實商品原圖製作白底摳圖和電商商品主圖。嚴格鎖定原商品身份、包裝文字、顏色、結構和比例;透過 APIMart 的 gpt-image-2.6-flare-ext 完成圖像編輯與生成。

ai-ecommerce-product-images 是什麼?

這是一個專為電商商品圖像製作設計的 AI 技能,能將真實商品照片快速轉換為兩張可交付圖片:白底保真圖與真實電商主圖。其核心優勢在於嚴格鎖定原始商品的包裝文字、顏色、結構與比例,避免 AI 重新設計或美化商品,確保圖像的商業可信度。該技能支援 APIMart 平台,並使用其 gpt-image-2.6-flare-ext 模型進行圖像編輯與生成。工作流程包含上傳原圖、生成白底圖、進行保真檢查(確認商品身份、包裝文字、結構比例無誤),最後生成電商場景圖。技能內建嚴格的檢查機制與禁止事項,防止文字篡改、功效暗示或 API 金鑰洩漏,適合需要高保真商品圖的電商賣家或設計師使用。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Fishkiller111/ecommerce-product-image-skills/tree/HEAD/skills/ai-ecommerce-product-images

Installed? Explore more 影像 skills: steipete/songsee, affaan-m/frontend-design, mattpocock/improve-codebase-architecture · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

電商商品圖製作

目標

把一張真實商品照片快速處理成兩張可交付圖片:

  1. 白底保真圖:去除原背景,商品置於純白背景,保留原商品的全部外觀與包裝資訊。
  2. 真實電商主圖:以白底保真圖為唯一商品事實來源,生成乾淨、可信、可用於電商展示的場景圖。

預設只做必要的光線、構圖和背景處理,不把商品「重新設計」。

輸入

  • SOURCE_IMAGE:客戶提供的真實商品原圖,必需。
  • STYLE_REFERENCE:可選的電商構圖參考圖。只參考佈局、光線、留白和資訊層級,不複製其商品、文字、價格、認證或宣傳語。
  • OUTPUT_DIR:輸出目錄;預設 ./outputs/product-images/。

收到多張圖時,先判斷哪張是商品事實圖,哪張只是風格參考圖。不要把風格參考圖裡的商品細節覆蓋到原商品上。

固定流程

1. 讀取 APIMart 規則

使用當前環境可用的 APIMart 工具,或依 APIMart 官方介面文件的上傳、鑑權及非同步輪詢方式呼叫。API Key 從 APIMART_API_KEY 等使用者設定的環境變數或安全憑證管理員讀取;服務位址使用 APIMART_BASE_URL 或服務商官方設定。不得將金鑰、使用者檔案或臨時 URL 寫入技能檔案、腳本、日誌或交付文案。未設定憑證或服務位址時說明需要設定,不冒用或搜尋其他使用者的金鑰。API 可能計費;使用者指定或已同意使用 APIMart 處理原圖時,依本次任務執行並提示費用,若沒有該授權、使用者拒絕上傳或服務未設定則先說明。

主模型固定為 gpt-image-2.6-flare-ext。如果介面明確回傳「模型不存在」,再使用 APIMart 中可用的 GPT Image 擴展模型,並在結果中說明發生回退;不要靜默更換模型。

2. 上傳原圖

使用 APIMart 圖片上傳介面上傳 SOURCE_IMAGE,得到 source_url。如有 STYLE_REFERENCE,單獨上傳得到 style_url。上傳完成後立即儲存任務記錄,不把臨時 URL 寫入客戶交付文案。

3. 生成白底保真圖

呼叫 APIMart 圖片生成/編輯介面,使用 source_url 作為唯一商品參考。提示詞直接使用下面模板,替換方括號內容:

Edit the provided product photo into a clean e-commerce white-background product cutout.
The product identity is locked to the source image.
Preserve exactly: package shape, front and side panels, dimensions, proportions, colors,
logos, labels, Chinese text, English text, dosage/volume markings, seals, caps, edges,
folds and all visible printed details.
Remove only the original environment and background. Use a pure white background,
soft natural contact shadow, centered product, full product visible, realistic camera
perspective, accurate geometry, high-detail commercial photography.
Do not redesign, beautify into another product, rewrite text, translate text, add text,
remove text, change the package, change the brand, change the logo, change the color,
add props, add people, add medical claims, add badges, add price tags or add decorative
copy. If any printed text is uncertain, preserve the original appearance rather than
inventing a replacement.

輸出命名:01_white_bg_preserved.png。

4. 保真檢查

在進入電商圖前,必須檢查白底圖:

  • 包裝正面、側面、頂部和邊角是否與原圖一致。
  • 商品數量、尺寸比例、顏色、透視和結構是否改變。
  • 品牌、商標、核准字號、規格、中文和英文是否被重寫或亂碼。
  • 是否出現額外瓶子、盒子、植物、藥片、人物、價格、認證、功效詞或裝飾。
  • 背景是否為白色,商品是否完整,是否存在明顯摳圖毛邊或穿透。

任一項失敗:不要交付為成品。用同一原圖強化「identity locked / preserve exact packaging / no new text」,最多再嘗試一次;仍不通過時明確標記 REJECTED,不要假裝完成或無限重試。

5. 生成真實電商主圖

將 01_white_bg_preserved.png 作為商品事實圖;STYLE_REFERENCE 僅作構圖參考。提示詞使用:

Create one realistic e-commerce product hero image using the provided preserved product cutout.
The supplied cutout is the exact product truth and must remain unchanged.
Keep the same package shape, logo, brand, printed text, colors, proportions, side panel,
volume markings and all visible details. Do not redraw or reinterpret the product.
Build a clean, credible commercial composition with [SCENE], [LIGHTING], [CAMERA_ANGLE]
and generous negative space. Use premium but restrained styling, realistic shadows and
accurate materials. No people, no hands, no extra products, no medical advice, no efficacy
claims, no price, no platform badge, no invented slogan, no invented certification, no
new package text and no visual element that could be mistaken as part of the product.
The final image must look like a real product photograph, not an illustration or a fantasy ad.

預設參數:

  • SCENE:簡潔、真實、與商品品類相關的電商場景。
  • LIGHTING:柔和自然光,避免過度磨皮、過曝和塑膠感。
  • CAMERA_ANGLE:略微四分之三角度,確保正面與必要側面可讀。
  • 畫幅優先 1:1;詳情頁橫圖可用 4:5 或 3:4。
  • 預設 resolution: 2k;只在客戶明確要求時使用更高解析度。

輸出命名:02_ecommerce_hero.png。

6. 電商圖檢查

確認:商品仍然是原商品;包裝文字未改;場景不製造功效暗示;沒有價格、平台角標、虛構認證或誇大宣傳;構圖適合電商縮圖和詳情頁;沒有明顯 AI 生成痕跡。

輸出契約

只交付:

OUTPUT_DIR/
├── 01_white_bg_preserved.png
└── 02_ecommerce_hero.png

如果任一階段失敗,輸出失敗原因、失敗圖片路徑和下一步修正,不交付不合格圖。

結果說明只保留三行:

原圖:<檔案名稱>
結果:白底保真圖 <路徑>;電商主圖 <路徑>
檢查:商品身份/包裝文字/結構比例已核對;<通過或需重做原因>

禁止事項

  • 不把原商品美化成另一個商品。
  • 不擅自修改或補寫包裝文字、品牌、商標、核准字號、規格和價格。
  • 不把風格參考圖當作商品事實圖。
  • 不為藥品、保健品或醫療相關商品添加療效、治癒、絕對化或未經提供的宣傳詞。
  • 不洩漏 APIMart API Key,不把金鑰寫入 Skill、日誌、圖片元資料或客戶文件。
  • 不繞過保真檢查;白底圖未通過時,不繼續生成電商圖。

相關技能