Batch Background Swap
- What
- Cost
- Free
- Needs
- Before you start: read this whole install prompt, tell me in a few lines what this skill does and what installing it involves, and wait for my go-ahead before you do anything else.
- Install
- Copy the installer prompt below into your Muse — your agent does the rest.
Batch-replace backgrounds or recolour SKU variants across a whole folder of product photos while keeping the product itself untouched: a product identity lock pasted into every prompt, a 2-image pilot before any full batch, prompt templates for pure white, brand-colour or scene backgrounds and for colour variants with exact colour names and hex codes, generation via your agent's built-in image tool, an OpenAI-compatible API key (the only route that runs the full folder batch, with resume, retries, a --max-images budget cap and a CSV log), or a one-click online link run per photo, and a 3-line QA note per asset.
Version:
Install
Copy the install package below, then paste it into Muse📌 Pinned version: commit f4566fdThe install prompt below already includes the vetting steps: your agent follows the community checklist before installing anything with executable code. Want more?
Before you start: read this whole install prompt, tell me in a few lines what this skill does and what installing it involves, and wait for my go-ahead before you do anything else. Prerequisites: none for the install itself: no account, no API key, no paid service, and nothing else to install first. For using the skill afterwards, read this first: the true folder batch only runs through the API key route — (b) below — which needs Python 3 and my own API key in the environment variable GPTIMAGE_API_KEY, billed by the provider I choose (see the sends disclosed in point 2: the default endpoint in the bundled scripts is https://api.openai.com, and SKILL.md recommends the third-party OpenAI-compatible gateway https://tryallapi.com/v1 — if I set that base URL, my key and my product photos go to that gateway, not to OpenAI). The other two routes work one photo at a time: (a) your agent's own built-in image tool, if it has one (no key from me); or (c) a no-key online link route, where the final prompt leaves this machine in a link to a third-party site (also disclosed in point 2). All three bundled scripts use the Python standard library only — scripts/batch_edit.py also imports the sibling scripts/generate.py sitting in the same folder; there is no Pillow or any other third-party library to install. I also provide the product photos myself: the skill asks for at least a front view, and text-only generation is only a concept, not the real product. Install "batch-background-swap" for me. It batch-replaces backgrounds or recolours SKU variants across a whole folder of product photos while keeping the product itself untouched: first a product identity lock written from my reference photos and pasted verbatim into every prompt, then a 2-image pilot before any full batch, prompt templates for a background swap (pure white #FFFFFF, a solid brand colour, or a described scene) and for a SKU recolour (exact colour name plus hex code, with the parts that must keep their colour named), generation through one of the three routes above (SKILL.md names GPT Image 2.5 Sunburst, gpt-image-2.5-sunburst, as this skill's default model, and its model step says to use Flare, gpt-image-2.5-flare, for new scenes and quick variations and Sunburst when a logo, label or small text must survive exactly, or for local edits such as a background swap or a recolour; scripts/batch_edit.py defaults to sunburst and scripts/generate.py defaults to flare), then the batch runner's resume, retries, hard budget cap and CSV log, and a 3-line QA note per asset. Repository: https://github.com/xianyu110/ecommerce-image-skills (the skill is the whole skills/batch-background-swap/ folder at the pinned commit: SKILL.md plus its scripts/ folder, 4 files) Pinned version: install the code at commit f4566fdc812584425728862ad8e08c90883d81ee exactly. Do not substitute a newer version. If this commit is unreachable, stop and tell me. 1. Clone https://github.com/xianyu110/ecommerce-image-skills into a temporary folder, check out commit f4566fdc812584425728862ad8e08c90883d81ee, and copy the skills/batch-background-swap/ folder from that checkout. Then compare every file in the folder with the fingerprints recorded for this listing on 2026-10-19: [FINGERPRINTS] - SKILL.md: SHA-256 b6d21bd5f2df9e34c143c07e25cffb3425d958ae56ed00a049b2151685a6a39e - scripts/batch_edit.py: SHA-256 5c4296c2cd5fcd0241374f53153e1c8ce87e4f49309aff33d5142b237243504b - scripts/generate.py: SHA-256 5339fc5c9c3fd9bb02a1f0dd8643386329ba813c7ebe958a8d28241ed343d1c5 - scripts/online_link.py: SHA-256 72a6a843157d8cfb84f809d4811edefbc1e222dd10807037f0b64524ebb43ad3 If a file does not match, it changed since the listing was prepared: do not install it yet, tell me what you found and let me decide. 2. Read SKILL.md in full and read all three scripts in scripts/ (batch_edit.py, generate.py, online_link.py), and tell me in plain words: what the skill does when used, which services it connects to, whether it reads or sends any personal information or keys, and anything that seems unusual. Stop on any red flag and tell me before going further. Confirm these points from the files: - The skill folder holds 4 files only: SKILL.md (5,969 bytes) and three Python scripts in scripts/ (batch_edit.py 2,834 bytes, generate.py 4,824 bytes, online_link.py 788 bytes). The three scripts in this folder are byte-identical copies of the same-named scripts at the repository root (scripts/): the skill is self-contained in its own folder and needs no file from elsewhere in the repository — not the other 11 skills, not the root scripts/, not the README. SKILL.md only ever calls the scripts sitting next to it (scripts/batch_edit.py, scripts/generate.py, scripts/online_link.py, relative to the skill folder), and scripts/batch_edit.py imports generate() from the sibling scripts/generate.py in the same folder. One textual exception to note, not a file dependency: the Specs line of SKILL.md points to the separate amazon-white-background skill for target-platform main-image sizes ("see amazon-white-background for main images"); that other skill is not part of this install and no file of it is read or called — it is a cross-reference for me to consult if I need those sizes. - Nothing is sent anywhere during installation itself; the only download at install time is the skill folder from GitHub at the pinned commit. No script is run during installation, no key is asked for, and there is no telemetry in the folder. - What leaves this machine at use time, disclosed here before it ever happens, by route — using the skill is a separate step that only starts when I ask for a background swap or a recolour: (a) built-in image tool: the final prompt (with the identity lock pasted in) and my product photo(s) go to whatever image generation/editing tool my agent already has (for example Codex imagegen or ChatGPT images), under that tool's own account and terms; this route edits one photo at a time, it is not the folder batch. (b) API key route — the only route that runs the real batch: scripts/batch_edit.py walks a folder of my photos (.png, .jpg, .jpeg, .webp), fills the {placeholders} of my prompt file from each --var name=value (for example one output per --var colour="Navy Blue (#1F2A44)" value), and for each photo and variant calls generate() from the sibling scripts/generate.py, which reads GPTIMAGE_API_KEY from the environment (never from a file, never printed), plus the optional GPTIMAGE_BASE_URL (default https://api.openai.com; SKILL.md recommends https://tryallapi.com/v1) and GPTIMAGE_MODEL, and sends an authenticated (Bearer key) multipart POST to /v1/images/edits at that base URL carrying the model, prompt, size and count plus the product photo itself (the batch always passes an image, so it always uses the edits endpoint); scripts/generate.py used on its own can also do a JSON POST to /v1/images/generations for text-to-image, or a multipart POST to /v1/images/edits with the reference photo(s) I pass with --image (front, side, logo close-up). If the API answers with an image URL instead of base64 data, the script downloads that URL. Whichever base URL I set receives my key, my prompt and my product photos: if I set the recommended tryallapi.com gateway, that third-party gateway is the recipient, not OpenAI. Batch safeguards from the files: outputs already present in the output folder are skipped (resume), failures are retried (--retries, default 2), and --max-images (default 50) is a hard cap on the number of API calls — each photo times each variant times each retry counts, so a batch can mean many billed calls; SKILL.md says to run a 2-image pilot first and to confirm the batch with me before running it in full. (c) Online link route: scripts/online_link.py itself makes no network call — it only prints a link — but the link it builds is https://gptimage2.asia/generate?prompt=<my final prompt, URL-encoded>&utm_source=github&utm_medium=skill&utm_campaign=ecommerce-image-skills&utm_content=batch-background-swap, so opening it sends my final prompt to gptimage2.asia, and SKILL.md tells me to upload my product photo on that site and to run the same prompt on each photo myself (this route is per-photo and manual, not an automated batch); SKILL.md also names an alternative site for users in mainland China, https://chatgpt-plus.top/list/#/home, where I would paste the prompt myself. Show that link once only, and never open it for me during installation. - The local-only parts at use time: scripts/batch_edit.py's own work never touches the network by itself — listing the input folder, substituting the prompt-file placeholders, skipping outputs that already exist, retrying, writing the edited PNGs and writing the out/log.csv log (input, variant, output, status, seconds) all happen locally; the network calls inside a batch run happen only through generate() as disclosed in route (b). The planning steps (identity lock, background/recolour prompt writing, the 2-image pilot decision, QA note) also stay local, between you and me. The identity lock rule from SKILL.md: only facts visible in my photos or confirmed by me — never invent specs, sizes or certifications, and if I gave no photo, ask for one before generating. - Do not set or ask for GPTIMAGE_API_KEY, do not run any of the three scripts, and do not generate or batch-edit any image: setup of a generation route is my decision, later, when I actually ask for a background swap or a recolour. 3. When I say "yes, install", install it as a skill: copy the whole batch-background-swap folder into the agent's skills directory, in a folder named "batch-background-swap", keeping all 4 files (SKILL.md at its root and the three scripts in its scripts/ subfolder). A manual clone followed by copying the skills/batch-background-swap folder into ~/.claude/skills/ is the route described here; any other route is fine only as long as every installed file matches its fingerprint. 4. Verify with no network calls: frontmatter valid (name: batch-background-swap), all 4 files in place with matching fingerprints. Do not run batch_edit.py, generate.py or online_link.py to verify. 5. Report what was installed, where, and what I still need to do myself (for example: provide the product photos — a folder of photos for a background swap, or one photo for SKU colour variants, front view at minimum — and confirm the prompt file, the target background or the exact recolour names with hex codes and the parts that must keep their colour; approve a 2-image pilot before any full batch; choose a generation route myself — my agent's built-in image tool if it has one, one photo at a time, or set GPTIMAGE_API_KEY and, if I want it, GPTIMAGE_BASE_URL in my environment for the API batch route, knowing the key, prompt and product photos go to the base URL I set and that I should set --max-images as my budget cap, or use the one-click online link per photo knowing the prompt goes to gptimage2.asia; using the skill is a separate step that only starts when I ask for it, and the use-time sends disclosed above happen only then, on the route that runs). GitHub is optional: if I have a GitHub account or the gh CLI, you may use it; otherwise public access is fine. Never require it unless it's in the prerequisites above. Rules: don't touch anything outside the temp folder and the install target. If anything looks off, stop and ask me.
Saved to your recent installs. Find it anytime on /connect.
Questions
How do I install a build?
Every product page includes a copy-paste install prompt. Paste it into your Muse and it sets the build up for you — no manual configuration.
Where does my money go?
Straight to the seller. Skill Harbor never processes payments: checkout happens on the seller’s own page, usually Stripe.
What does the ✓ next to a creator’s name mean?
It means we confirmed the identity of the person behind the listing. It says nothing about the code itself — always check a build before installing it.