Chatgpt Imagegen
Use your ChatGPT subscription to generate images from the command line — no OPENAI_API_KEY, no gateway, no daemon. Zero-dep Python CLI + AI-agent skill.
leeguooooo · 已有 AI 审核记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add leeguooooo/chatgpt-imagegen技能说明
name: "chatgpt-imagegen" version: "0.23.6" description: >- Generate new raster images and looping GIF/WebP animations with the user's ChatGPT subscription through the local one-file chatgpt-imagegen CLI, without an API key or daemon. Use for photos, illustrations, icons, hero banners, mockups, sprites, concept art, animation loops, and figures for documents, proposals, blog posts, or READMEs; save outputs in the workspace. Auto mode prefers the logged-in ChatGPT browser through chrome-use to avoid Codex usage and falls back to the Codex backend only when the web path is unavailable. Users with a Gemini subscription can name --backend gemini or agy instead. Proactively propose useful figures while authoring long-form content. Do not use for editing existing images, SVG/vector work, code-native graphics, established icon systems, explicit high-quality or transparent API output, or end-user image-generation services.
chatgpt-imagegen — agent skill
A standalone Python CLI that produces images via the user's ChatGPT subscription. No API key, no network service, no extra config. It has two OpenAI backends that hit different usage buckets — pick with --backend — plus two opt-in Google/Gemini backends for users who also have a Gemini subscription.
Backends
| Backend | Surface | Usage bucket | Needs | Speed |
|---|---|---|---|---|
web | Drives the user's logged-in ChatGPT browser (via chrome-use, formerly agent-browser-stealth; older installs expose the same binary as agent-browser/abs) and generates in a regular chat — the same surface as typing in the app. Its real-Chrome connect is what clears Cloudflare + the sentinel proof-of-work a plain/headless client can't. | ChatGPT conversation — does not consume the metered Codex-usage limit. Works on any account, including free tier (subject to its daily image cap). | chrome-use installed and its extension connected to a Chrome signed in to chatgpt.com. | ~30–60 s; each run's chat is filed under a ChatGPT Project (default imagegen, auto-created) instead of littering the history. |
codex | Headless POST to chatgpt.com/backend-api/codex/responses with the image_generation tool, reusing ~/.codex/auth.json. | Codex-usage (metered — this is the bucket the user usually wants to spare). | codex login (writes ~/.codex/auth.json). | Fast; no browser, no history. |
Default is auto (--backend auto, or CHATGPT_IMAGEGEN_BACKEND): it tries web first because that spares the Codex-usage limit, and falls back to codex only when web is unavailable — i.e. chrome-use isn't installed, the browser isn't reachable, or chatgpt.com isn't logged in. The two not-set-up cases are handled explicitly:
- Browser not logged in / chrome-use missing → auto silently falls back to codex (a one-line notice prints to stderr). If codex is also not set up, it exits naming both fixes.
- codex not logged in (
~/.codex/auth.jsonabsent) → auto still uses web; codex is only the fallback.
Auto does not fall back to codex if web was reachable but the generation itself failed after submitting — that would spend the very bucket auto-mode protects. In that case it errors and tells you to rerun with --backend codex if you want the Codex-usage path. Force a single backend with --backend web or --backend codex.
Gemini backends (opt-in — auto never picks them)
For users who also have a Google/Gemini subscription. Both drive a Google account, not OpenAI.
| Backend | Surface | Needs | Speed |
|---|---|---|---|
gemini | Drives a logged-in gemini.google.com browser via chrome-use — the browser analogue of web. | chrome-use, plus a Chrome profile signed in to a subscribed Google account. | ~11–24 s |
agy | The Antigravity CLI (agy) run headless — the analogue of codex. | agy on PATH. Passes --dangerously-skip-permissions by default because headless agy cannot prompt for tool permissions; --no-agy-yolo opts out if the user maintains their own permissions.allow rules. | ~14–25 s |
Their quotas are separate — measured, not assumed: agy returned "Image generation model quota (gemini-3.1-flash-image) has been exhausted (429)" while a --backend gemini run on the same Google account succeeded seconds later. So each is a genuine fallback for the other, and a quota error from one names the other in its message.
Neither is ever chosen by auto. Deliberate: they hit a different vendor and account, and their output differs in ways a caller would notice. Ask for them by name.
Behaviour worth knowing before recommending one:
- Visible watermark.
geminitext-to-image results carry the Gemini "sparkle" glyph, fixed at 65 px in from the bottom-right corner (measured identical across 5 runs at 1024×559). Image-to-image results do not.agyresults have no visible mark. - Both are watermarked invisibly regardless.
agyoutput carries a Google-signed C2PA manifest whose own description reads "Applied imperceptible SynthID watermark". The SynthID signal is in the pixels and survives any re-encode. geminikeeps the C2PA manifest on current chrome-use. Gemini renders results from ablob:src, which in-pagefetch()still cannot read;chrome-use download-urlnow resolves the blob inside the page and writes the original bytes to disk, so the signed manifest survives. Older chrome-use rejectedblob:outright, leaving only a canvas re-encode — that path is still the fallback and still strips metadata, and the run prints a note naming the upgrade when it has to take it.agycopies the file, so its manifest always survives.--sizecontrols the aspect ratio ongemini, not the pixel count. The chat surface has no size widget, so the ratio is requested in words — and honoured: asking square returned 1024×1024, asking 3:2 returned 10