CommunityImagegithub.com

shelf-display-image

Generate retail shelf display images — supermarket shelf, hanging-strip / sidekick, PDQ display box, endcap and stack display — with the user's own OpenAI-compatible image API key (GPT-Image, or a new-api gateway image channel). Use when the user wants a product shown on a store shelf / hanging strip, a shelf-display mockup, or a photo like a supermarket endcap with price tags. Not for white-background packshots, detail pages, or general lifestyle photos — use a product-photography skill for those.

What is shelf-display-image?

shelf-display-image is a Codex agent skill that generate retail shelf display images — supermarket shelf, hanging-strip / sidekick, PDQ display box, endcap and stack display — with the user's own OpenAI-compatible image API key (GPT-Image, or a new-api gateway image channel). Use when the user wants a product shown on a store shelf / hanging strip, a shelf-display mockup, or a photo like a supermarket endcap with price tags. Not for white-background packshots, detail pages, or general lifestyle photos — use a product-photography skill for those.

Works with~Claude Code✓Codex CLI~Cursor✓Gemini CLI
npx skills add https://github.com/zyx667788/shelf-display-image/tree/HEAD

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

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Shelf Display Image / 货架陈列生图

Adapted from wubin1836/ai-hive-agent-skills — imiva-shelf-display-image (MIT). Original idea kept: simulate a compliant retail shelf / stack / endcap scene, keep the product's structure, packaging, logo and confirmed text, never invent price, efficacy, sales or certification.

What changed in this fork: IMIVA / IMIVA MCP removed entirely. No create_smart_refine_task, no IMIVA token, no IMIVA credits. Generation goes through a plain OpenAI-compatible /v1/images endpoint, driven by scripts/generate_shelf_image.py with the user's own key.

Configuration — key never goes in the skill, chat, or code

Set these in the local agent's environment (or a local .env the agent loads, never committed):

SHELF_IMAGE_BASE_URL=https://vertex.zyxapi.pp.ua/v1   # or the upstream GPT-Image endpoint
SHELF_IMAGE_API_KEY=<your-image-api-key>                  # never paste in chat
SHELF_IMAGE_MODEL=gpt-image-1                             # exact model name, see below

Defaults if unset: SHELF_IMAGE_BASE_URL=https://vertex.zyxapi.pp.ua/v1, SHELF_IMAGE_MODEL=gpt-image-1. There is no default key.

Verified 2026-11-27: the new-api gateway token vertex-main lists only gemini-3.8-flash / gemini-4-hydrogen / gemini-4-neon / gemini-4-carbon — no image model yet. So the gateway route only works after an image channel is added to new-api (type 1 OpenAI channel, upstream GPT-Image base_url + key, model e.g. gpt-image-1 / gpt-image-1.5 / gpt-image-2 — use the exact name the upstream returns in /v1/models). Until then, point SHELF_IMAGE_BASE_URL at the upstream endpoint directly. Do not guess a model name: call GET {base_url}/models with the key first and use a name that is actually listed.

Workflow

1. Confirm product facts first

Only use what the user supplied or confirmed: brand, product name, category, package form / size, flavour / variant, price and promo mechanics (2元3条 etc.), logo and any text that must appear. Mark anything missing as 未提供. Do not invent ingredients, claims, certifications, prices, or platform badges.

2. Choose the display type

Read references/prompt-template.md and pick one — do not mix two types in one image:

  • shelf — flat shelf row, products lined up, shelf-edge price tags
  • hanging-strip — the photo the user sent: sidekick hanging strip on a shelf end, products hanging in vertical strips from hooks, header card on top, price tags below. This is the default for that photo.
  • pdq-box — yellow / branded PDQ display box on a shelf, products standing in the box
  • endcap — end-of-aisle endcap, full-face display
  • stack — floor stack / 堆头, pallet or dump-bin display

3. Build the prompt

Use the template in references/prompt-template.md. Structure, in English for the image model (it renders English prompts more reliably), with the confirmed Chinese text quoted verbatim inside:

retail scene → display type → product (exact packaging) → price / promo text (verbatim) → camera / lighting → what must NOT change

Keep copy short and legible in the image: 1 headline + price, no dense paragraphs. If the model garbles Chinese text, regenerate once, then fall back to: generate the scene with a blank / minimal price tag and composite the real text locally.

4. Generate

Text-to-image (no product photo supplied):

python3 scripts/generate_shelf_image.py \
  --prompt "Supermarket hanging-strip display, ..." \
  --size 1024x1536 --out generated/shelf-01.png

Image-to-image (product photo supplied — preferred, keeps packaging faithful):

python3 scripts/generate_shelf_image.py \
  --prompt "Place this exact product, packaging and logo unchanged, into a ..." \
  --image /path/to/product.jpg \
  --size 1024x1536 --out generated/shelf-01.png

The script calls POST {base_url}/v1/images/generations without --image, and POST {base_url}/v1/images/edits (multipart) with --image. It accepts b64_json and url responses, saves to --out, prints only the output path and the model used. It never prints the API key. If the endpoint returns 404 / model_not_found, stop — the model name is wrong for that endpoint, do not retry with another guessed name.

Optional flags: --model, --base-url, --size (default 1024x1536, also 1024x1024, 1536x1024), --n 1, --quality high|medium|low (only if the upstream supports it).

5. Quality check before delivery

  • Product shape, colour, packaging, logo, flavour, count and variant match the input.
  • Price / promo text in the image matches the confirmed facts, legible, not garbled.
  • Hanging strips hang straight, header card on top, price tags aligned under the right product.
  • No invented price, claim, certification, or brand that was not supplied.
  • No poster / screenshot / collage look. If it fails, critique first, then regenerate with one variable changed — do not present a failed image as final.

Do Not

  • Do not call IMIVA, do not ask for an IMIVA token, do not use create_smart_refine_task.
  • Do not hard-code, log, or paste the API key anywhere. Read it only from the environment.
  • Do not invent product facts, prices, or text for the image.
  • Do not use a model name that was not confirmed in that endpoint's /v1/models list.
  • Do not submit a paid generation without confirming model, size, count and the prompt.

Related Skills