Community图像github.com

Fishkiller111/ai-ecommerce-product-images

用真实商品原图制作白底抠图和电商商品主图。严格锁定原商品身份、包装文字、颜色、结构和比例;通过 APIMart 的 gpt-image-2.6-flare-ext 完成图像编辑与生成。用户提供商品照片、抠图、白底图、电商图或商品主图时使用。

ai-ecommerce-product-images 是什么?

ai-ecommerce-product-images is a Claude Code agent skill that 用真实商品原图制作白底抠图和电商商品主图。严格锁定原商品身份、包装文字、颜色、结构和比例;通过 APIMart 的 gpt-image-2.6-flare-ext 完成图像编辑与生成。用户提供商品照片、抠图、白底图、电商图或商品主图时使用。.

兼容平台~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 的新对话。

文档

E-Commerce Product Image Creation

Objective

Quickly process a real product photo into two deliverable images:

  1. White-background faithful image: Remove the original background, place the product on a pure white background, preserving all original product appearance and packaging information.
  2. Realistic e-commerce hero image: Using the white-background faithful image as the sole product fact source, generate a clean, credible, e-commerce-ready scene image.

By default, only necessary lighting, composition, and background processing are performed; the product is not "redesigned."

Input

  • SOURCE_IMAGE: The real product original image provided by the client (required).
  • STYLE_REFERENCE: An optional e-commerce composition reference image. Only the layout, lighting, negative space, and information hierarchy are referenced; do not copy its product, text, prices, certifications, or marketing language.
  • OUTPUT_DIR: Output directory; default is ./outputs/product-images/.

When receiving multiple images, first determine which is the product fact image and which is just a style reference. Do not overwrite the original product details with those from the style reference.

Fixed Workflow

1. Read APIMart Rules

Use the APIMart tools available in the current environment, or follow the APIMart official API documentation for upload, authentication, and async polling. API Key is read from user-configured environment variables or secure credential managers (e.g., APIMART_API_KEY); the service URL uses APIMART_BASE_URL or the vendor's official configuration. Do not write keys, user files, or temporary URLs into skill files, scripts, logs, or deliverable copy. If credentials or service URL are not configured, explain what is needed; do not impersonate or search for other users' keys. API usage may incur charges; if the user has specified or agreed to use APIMart to process the original image, proceed with the task and mention the fee; if no authorization, the user refuses to upload, or the service is not configured, state that first.

The primary model is fixed to gpt-image-2.6-flare-ext. If the API explicitly returns "model not found," then fall back to an available GPT Image extension model on APIMart and note the fallback in the result; do not silently change models.

2. Upload Original Image

Upload SOURCE_IMAGE using the APIMart image upload API to obtain source_url. If STYLE_REFERENCE exists, upload it separately to obtain style_url. Immediately after upload, save a task record; do not write temporary URLs into client deliverable copy.

3. Generate White-Background Faithful Image

Call the APIMart image generation/editing API using source_url as the sole product reference. Use the following template for the prompt, replacing the bracketed content:

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.

Output naming: 01_white_bg_preserved.png.

4. Fidelity Check

Before proceeding to the e-commerce image, the white-background image must be checked:

  • Whether the package front, side, top, and edges match the original.
  • Whether the product quantity, size proportions, colors, perspective, and structure have changed.
  • Whether the brand, trademark, approval number, specifications, Chinese text, and English text have been rewritten or garbled.
  • Whether extra bottles, boxes, plants, pills, people, prices, certifications, efficacy claims, or decorative elements appear.
  • Whether the background is white, the product is complete, and whether there are obvious cutout fringes or cut-throughs.

If any check fails: do not deliver as a final product. Re-prompt the same original image with a stronger emphasis on "identity locked / preserve exact packaging / no new text" and retry at most once. If it still fails, explicitly mark it as REJECTED; do not pretend completion or retry indefinitely.

5. Generate Realistic E-Commerce Hero Image

Use 01_white_bg_preserved.png as the product fact image; STYLE_REFERENCE is used only as a composition reference. Use the following prompt:

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.

Default parameters:

  • SCENE: Clean, realistic, relevant to the product category e-commerce scene.
  • LIGHTING: Soft natural light; avoid over-smoothing, overexposure, and plastic appearance.
  • CAMERA_ANGLE: Slight three-quarter angle, ensuring the front and necessary side are readable.
  • Aspect ratio: prefer 1:1; for detail page landscape images, use 4:5 or 3:4.
  • Default resolution: 2k; use higher resolution only when explicitly requested by the client.

Output naming: 02_ecommerce_hero.png.

6. E-Commerce Image Check

Confirm: the product is still the original product; packaging text is unchanged; the scene does not create efficacy implications; no prices, platform badges, fabricated certifications, or exaggerated claims; composition is suitable for e-commerce thumbnails and detail pages; no obvious AI generation artifacts.

Output Contract

Deliver only:

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

If any stage fails, output the failure reason, the path of the failed image, and the next corrective step; do not deliver substandard images.

The result description should only have three lines:

Original Image: <filename>
Result: White-background faithful image <path>; E-commerce hero image <path>
Check: Product identity / Packaging text / Structure proportions verified; <passed or reason for redo>

Prohibitions

  • Do not beautify the original product into another product.
  • Do not arbitrarily modify or supplement packaging text, brand, trademark, approval number, specification, or price.
  • Do not treat the style reference image as the product fact image.
  • Do not add efficacy, cure, absolute, or unprovided promotional claims for drugs, health supplements, or medical-related products.
  • Do not leak the APIMart API Key; do not write the key into the skill file, logs, image metadata, or client documents.
  • Do not bypass the fidelity check; if the white-background image does not pass, do not proceed to generate the e-commerce image.

相关技能