gpt-image
Skill1 starsChanged 33 days agoMITView on GitHub
Generate images with the official OpenAI gpt-image-2.5 API using the user's own API key — text-to-image, reference images, mask inpainting; 1K/2K/4K at any aspect ratio, quality low…max; saves locally and reports the cost of every run. Use when the user asks to generate / draw / create an image, poster, cover, portrait, character sheet or scene, or gives specs like 2K, 4K, 16:9, high, max. 用用户自己的 OpenAI key 出图(出图 / 生图 / 画一张 / 海报 / 封面 / 定妆照 / 四视图 / 场景图)。 Also use for “sync my balance” / “同步余额” with the studio MCP.
- Reads credentials
19 other projects use a version of this.
Adopted by
Most recently taken up by
- potofo/gpt-imagetheir own version, first seen Nov 8, 2026
- jujijigo/agent-skillstheir own version, first seen Nov 8, 2026
- AiAi-Mastermind/aiai-mastermind-tools-and-skillstheir own version, first seen Oct 13, 2026
- Suge8/friedbuntheir own version, first seen Oct 11, 2026
- wuyoscar/gpt_image_2_skilltheir own version, first seen Oct 8, 2026
- xingfanxia/AX-skillstheir own version, first seen Sep 19, 2026
Other versions19 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 19
- wuyoscar/gpt_image_2_skill★ 6ksame name
- wuyoscar/GPT-Image2-Skill★ 5.6ksame name
- GENEXIS-AI/gpt-image-skill★ 157same name
- nikships/droidproxy★ 128same name
- Yuki001/game-dev-skills★ 110same name
- dshark3y/gpt-image-2-skill★ 19same name
- Suge8/friedbun★ 12same name
- ZeyuLing/research_autocode_skills★ 9same name
- egoist/gpt-image★ 7same name
- tuoxie2046/claude-code-research-skills★ 5same name
9 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repositoryOne other file it gives its agents.
- AGENTS.mdAGENTS.md
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 0 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 15 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
Read local rules first: if rules.local.md exists in this folder, read it before anything else.
- Very specific: line 16
Always write the prompt to a UTF-8 text file first and pass it with --prompt-file — long non-ASCII prompts on the command line get mangled …
“Common” is measured: kept by at least 6 in 10 of the 15 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
gpt-image: generate images with the official API
Costs are charged to the user's own OpenAI API balance. The scripts use only the Python standard library — nothing to install.
Read local rules first: if rules.local.md exists in this folder, read it before anything else. It holds this machine's user preferences (default specs, prompt habits, environment notes) and overrides this file where they conflict. Reply to the user in their own language.
<skill folder> below means the folder containing this SKILL.md.
How to call it
Always write the prompt to a UTF-8 text file first and pass it with --prompt-file — long non-ASCII prompts on the command line get mangled by shells.
python <skill folder>/scripts/gen.py --prompt-file <p.txt> --size "2K 16:9" --quality high --name <short-name>If python isn't found (some agent sandboxes don't have the full PATH), try python3, then py -3, then the full path — on Windows usually %LOCALAPPDATA%\Programs\Python\Python3xx\python.exe. If rules.local.md gives this machine's full command, use it as-is.
| Option | Values | Default |
--size | exact 2560x1440; 1K/2K/4K + ratio (e.g. "2K 9:16"); or auto | 2K 16:9 |
--quality | low medium high xhigh max auto | high |
--model | gpt-image-2.5-sunburst / gpt-image-2.5-flare | sunburst |
--ref | reference image path, repeatable (up to 16); uses the edits endpoint | none |
--mask | PNG mask, transparent = area to repaint; use with --ref | none |
--n | number of images | 1 |
--moderation | auto; switch to low if normal content gets blocked | auto |
--out-dir | output folder | out_dir in config.json, default ~/Pictures/gpt-image |
--dry-run / --check | print the request / test key + network — both free | |
--json | print one JSON line instead of text (for tools; see docs/INTEGRATIONS.md) |
Size limits: sides are multiples of 16, long side ≤ 3840, aspect ratio ≤ 3:1, total pixels between 655,360 and 8,294,400. Shorthand is converted automatically, e.g. 4K 1:1 → 2880x2880, 2K 9:16 → 1440x2560.
Each image is saved next to a .json record with the prompt, parameters, timing, usage and cost, so it can be reproduced later.
Always tell the user what it cost. The script ends with "Cost" and "Today / This month" lines — relay them. Cost = the usage OpenAI returns × rates in config.json (USD per 1M tokens); update rates if OpenAI changes prices.
Show the user the image afterwards, using whatever your environment offers for sending files or displaying images.
Default spending rules (unless rules.local.md says otherwise): with no spec requested, use 2K + high; when the user gives a spec, follow it — don't upgrade on your own; for several images, or 4K / xhigh / max, tell the user the rough cost first.
Web workbench (optional)
web/server.py is a local web page at http://127.0.0.1:8765 (this computer only). The user starts it with start.bat (Windows) or start.sh (macOS / Linux) in this folder. The page and the script share one output folder:
- While you generate, the script writes a marker into
<out_dir>/.running/. The page polls it every 2 s and shows "<name>is generating" (name =config.agent_name) with a timer, then the result. So when the user says they're watching the page, just callgen.pyas usual. - Don't change
--out-dir— the page only watchesout_dirfromconfig.json, so images saved elsewhere won't show up. - The page's Settings read and write
config.json, which the script also reads, so defaults the user changes there apply to your runs too.
The same page can be hosted on GitHub Pages: on a computer running the local service it connects to it automatically; elsewhere it runs in browser mode (key and images stay in that browser).
Balance. When the user says “同步余额” or “sync my balance”, call the MCP tool sync_balance({}). Follow its instructions using the user's signed-in browser and submit the fresh official observation. Report the amount and time after the tool returns synced. A sign-in or browser permission prompt is for the user to complete. For an estimate between syncs, use get_spending or read balance from the local workbench's /api/status. The workbench subtracts subsequent spending from the recorded balance, using the organization Costs API when an admin key is configured.
Troubleshooting
Can't reach OpenAI: usually the network. If a proxy is needed, set"proxy": "http://127.0.0.1:PORT"inconfig.json.No API key found: add it in the web page under Settings → API, putapi_keyinconfig.json, or setOPENAI_API_KEY.OpenAI error 400: read which parameter it complains about — usually an invalid size or a wrong model name.- Blocked by moderation: if the content is fine, retry with
--moderation low(the edits endpoint doesn't take this option). - Relay service (OpenAI-compatible proxy such as one-api / new-api): set
api_urlto the relay's address andapi_keyto its key; use the relay's model name with--model. If it rejects parameters with HTTP 400, set"minimal_params": true. Image URLs in responses and per-image pricing ("rates": {"per_image": …}) are supported; with relays that expose the legacy billing endpoints the real balance is read automatically. - Messages are in English by default;
"lang": "zh"inconfig.jsonswitches them to Chinese.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

