Skip to content
Back to search

"image-use"

SkillWorks with Claude CodeGitHub

Backend-neutral image generation: create new raster images and looping GIF/WebP animations through the local one-file image-use CLI (formerly chatgpt-imagegen), using the user's ChatGPT subscription by default, the Codex backend as fallback, or an optional Gemini subscription — no API key or daemon. Triggers: image generation, generate an image, draw a picture, 画图, 画一张, 生成图片, 生图, 配图. 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 uses the logged-in ChatGPT browser via chrome-use. Gemini users can pass --backend gemini or agy. 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.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/leeguooooo/image-use with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/leeguooooo/image-use'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/leeguooooo--image-use/badge.svg)](/listings/leeguooooo--image-use)

HTML

<a href="/listings/leeguooooo--image-use"><img src="/api/listings/leeguooooo--image-use/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

These steps run a script from the network that findsafeskills does not scan.

Needs Python 3.10+ and a ChatGPT subscription (free tier works).

**For AI agents (recommended)** — drops the skill into Claude Code, Codex, Cursor, etc.:

npx skills add leeguooooo/image-use -g

Then just ask: *"画一张 …"* / *"generate a hero banner for the README"*.

**Standalone CLI** — no `pip`, no virtualenv, no sudo. Keeps a git checkout under `~/.agents/use-family/image-use`, links `image-use` into `~/.local/bin` and the skill for Claude Code / Codex; re-run to update:

curl -fsSL https://raw.githubusercontent.com/leeguooooo/image-use/main/install.sh | sh

Or by hand:

git clone https://github.com/leeguooooo/image-use
sudo install image-use/image-use /usr/local/bin/image-use
sudo ln -sf image-use /usr/local/bin/chatgpt-imagegen   # optional: keep the old command name

You also need **one backend** — `web` (default, drives your logged-in Chrome, spends no Codex-usage) or `codex` (headless fallback). `image-use doctor` shows what's ready. → **[Backends & troubleshooting](https://drawstyle.leeguoo.com/en/docs/backends)**

Got a **Gemini** subscription too? Two more backends use it instead of OpenAI: `--backend gemini` (drives a logged-in `gemini.google.com` Chrome) and `--backend agy` (the Antigravity CLI, headless). They bill **separate quotas** from each other, so either can cover for the other. Neither is ever chosen automatically — ask by name. Pin the subscribed Chrome profile with `--gemini-profile`, since most profiles are signed in to *some* Google account. Note that Gemini **text-to-image** output carries a visible watermark in the bottom-right corner (image-to-image does not), and `--size` steers the aspect ratio there rather than the exact pixel count.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 315 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. # image-use
  2. [![CI](https://github.com/leeguooooo/image-use/actions/workflows/ci.yml/badge.svg)](https://github.com/leeguooooo/image-use/actions/workflows/ci.yml)
  3. **English** | [中文](./README.zh-CN.md)
  4. **Generate images with the subscriptions you already have — no `OPENAI_API_KEY`.**
  5. A tiny zero-dependency Python CLI (and AI-agent skill): one file, stdlib only. It uses your ChatGPT subscription by default, falls back to Codex, and can use a Gemini subscription instead. Works on a **free ChatGPT account** too — the default backend just drives the normal ChatGPT web chat, where even free-tier users get image generation.
  6. > **Formerly `chatgpt-imagegen`.** It was renamed once it grew non-ChatGPT backends. The `chatgpt-imagegen` command still works as an alias, and every `CHATGPT_IMAGEGEN_*` environment variable is still honoured (the new `IMAGE_USE_*` name wins if both are set). Your saved styles are untouched.
  7. ```bash
  8. image-use "a watercolor cat sitting on a windowsill" -o cat.png
  9. # -> saved: cat.png (812,344 bytes) size=1024x1024 quality=medium
  10. ```
  11. <img width="1494" height="870" alt="image" src="https://github.com/user-attachments/assets/b48b0563-58a3-41ff-a207-f01eafbf2ccb" />
  12. ---
  13. ## Install
  14. Needs Python 3.10+ and a ChatGPT subscription (free tier works).
  15. **For AI agents (recommended)** — drops the skill into Claude Code, Codex, Cursor, etc.:
  16. ```bash
  17. npx skills add leeguooooo/image-use -g
  18. ```
  19. Then just ask: *"画一张 …"* / *"generate a hero banner for the README"*.
  20. **Standalone CLI** — no `pip`, no virtualenv, no sudo. Keeps a git checkout under `~/.agents/use-family/image-use`, links `image-use` into `~/.local/bin` and the skill for Claude Code / Codex; re-run to update:
  21. ```bash
  22. curl -fsSL https://raw.githubusercontent.com/leeguooooo/image-use/main/install.sh | sh
  23. ```
  24. Or by hand:
  25. ```bash
  26. git clone https://github.com/leeguooooo/image-use
  27. sudo install image-use/image-use /usr/local/bin/image-use
  28. sudo ln -sf image-use /usr/local/bin/chatgpt-imagegen # optional: keep the old command name
  29. ```
  30. You also need **one backend** — `web` (default, drives your logged-in Chrome, spends no Codex-usage) or `codex` (headless fallback). `image-use doctor` shows what's ready, and names a backend pinned by `IMAGE_USE_BACKEND` (or legacy `CHATGPT_IMAGEGEN_BACKEND`). → **[Backends & troubleshooting](https://drawstyle.leeguoo.com/en/docs/backends)**
  31. Got a **Gemini** subscription too? Two more backends use it instead of OpenAI: `--backend gemini` (drives a logged-in `gemini.google.com` Chrome) and `--backend agy` (the Antigravity CLI, headless). They bill **separate quotas** from each other, so either can cover for the other. Neither is ever chosen automatically — ask by name. Pin the subscribed Chrome profile with `--gemini-profile`, since most profiles are signed in to *some* Google account. Note that Gemini **text-to-image** output carries a visible watermark in the bottom-right corner (image-to-image does not), and `--size` steers the aspect ratio there rather than the exact pixel count.
  32. ## Upgrade
  33. ```bash
  34. image-use upgrade # install the latest release and refresh the skill
  35. image-use upgrade --check # only report: image-use 0.29.2 -> 0.30.0
  36. image-use upgrade --json # the same as JSON
  37. ```
  38. `upgrade` (alias `update`) installs the newest GitHub release the same way this copy was installed — `skills update` for an `npx skills add` install, `git pull --ff-only` for a clone, a fresh copy of the script for a standalone file — then refreshes every other copy of the skill it finds (Claude Code plugin, clones and copies under `~/.agents/skills`, `~/.claude/skills`, `~/.codex/skills`). Any other command checks for a newer release at most once a day and prints one line to stderr when there is one. `IMAGE_USE_NO_UPDATE_CHECK=1` or the family-wide `USE_NO_UPDATE_CHECK=1` turns the check off; it is also skipped when `CI` is set. Nothing is installed until you run `upgrade`.
  39. **On 0.23.1 or earlier?** That self-update only looked for a global `skills` and gave up when it was missing, so it cannot deliver its own fix. Bootstrap once with (installs from before the rename are registered as `chatgpt-imagegen`):
  40. ```bash
  41. npx -y skills update chatgpt-imagegen
  42. ```
  43. After that `image-use upgrade` works on its own.
  44. ## Parallel generation across Chrome profiles (opt-in)
  45. The normal `web` backend **serializes all ChatGPT image generations** via the
  46. shared `~/.chatgpt-web.lock`, coordinating with `chatgpt-use`. This remains
  47. the default. To run across *different signed-in Chrome profiles* concurrently,
  48. explicitly choose a stable Chrome profile for each process and add
  49. `--parallel-profiles`:
  50. ```bash
  51. image-use "red potion sprite" --backend web --profile "Profile 1" --parallel-profiles -o potion.png &
  52. image-use "blue slime sprite" --backend web --profile "Profile 2" --parallel-profiles -o slime.png &
  53. wait
  54. ```
  55. Each profile receives a stable browser session and its own cross-process lock.
  56. Two jobs for the **same** profile still queue when both use this flag; jobs
  57. for different profiles can overlap. Use the flag consistently for each named
  58. profile: mixing flagged and unflagged calls for the same profile uses different
  59. locks and can cause interference. The default `Default` Chrome profile continues to use the legacy
  60. ChatGPT cross-tool lock, so existing tools keep coordinating. Explicit profile
  61. selection avoids unexpected account changes: `auto`, `relay`, display-name
  62. aliases and custom profile paths are not accepted in this mode. Use Chrome's
  63. canonical `Default` or `Profile N` identifier. Don't pass `--session` alongside
  64. this flag. A missing lock primitive or inaccessible profile lock fails instead
  65. of pretending the jobs are isolated.
  66. The same option works on the `gemini` backend
  67. (`--backend gemini --gemini-profile "Profile 3" --parallel-profiles`),
  68. which drives `gemini.google.com`, **not Google Flow**. This does not add a
  69. Flow backend. For a work queue, start one worker per profile, retain each
  70. job's input/output mapping, and check the returned files. Concurrent browser
  71. sessions still depend on the connected `chrome-use` version and actual web
  72. service rate limits; this is account isolation, not a guaranteed throughput.
  73. ## Usage
  74. ```bash
  75. image-use "moody mountain sunset" -o web/hero.png --size 1536x1024
  76. image-use "make it a warm golden-hour photo, cinematic 35mm" -i photo.jpg # reference the subject
  77. image-use "a different fictional person" --composition-ref photo.jpg # borrow the framing, not the face
  78. image-use "a robot mascot" --style doodle # apply a gallery style (auto-pulled + saved)
  79. image-use animate "a dog happily wagging its tail" --style-online snoopy --also-gif
  80. OUT=$(image-use "icon" --quiet) # capture the path
  81. image-use "product hero" --backend codex --image-model gpt-image-2.5-sunburst --quality xhigh
  82. ```
  83. The last line opts into the GPT Image 2.5 knobs — `--image-model`
  84. (`sunburst` for precise editing, `flare` for fast high quality), `--quality`
  85. (`low`→`max`), `--background transparent`, `--compression`, `--action`,
  86. `--partial-images`. They are **codex-only** (the web/gemini surfaces have no
  87. such controls), all optional, and are *requests* — the saved line prints the
  88. `model=`/`quality=`/`size=` the backend actually used. Note: the **codex**
  89. backend rewrites these server-side (observed `gpt-image-2-codex` / `auto`), so
  90. they rarely survive there; what does matter on codex is `--model`, the *driver*
  91. model that calls the tool (default `gpt-5.6-luna`, a fast/affordable Codex model
  92. — a frontier coding model just burns the metered Codex bucket). Every run prints
  93. the `tokens=` it cost.
  94. All three below came straight out of the commands above — no retouching:
  95. <table>
  96. <tr>
  97. <td width="33%"><img src="./docs/gallery/watercolor-cat.png" alt="Watercolor cat on a windowsill"></td>
  98. <td width="33%"><img src="./docs/gallery/mountain-sunset.png" alt="Moody mountain sunset"></td>
  99. <td width="33%"><img src="./docs/gallery/coffee-logo.png" alt="Coffee shop logo"></td>
  100. </tr>
  101. <tr>
  102. <td><sub><code>"a watercolor cat sitting on a windowsill"</code></sub></td>
  103. <td><sub><code>"moody mountain sunset" --size 1536x1024</code></sub></td>
  104. <td><sub><code>"a coffee shop logo, circular emblem"</code></sub></td>
  105. </tr>
  106. </table>
  107. `animate` asks the image model for a strict 4×2 sprite sheet, crops eight equal
  108. frames, rejects obvious subject drift, and writes a smooth ping-pong loop. It
  109. defaults to animated WebP; pass `--animation-format gif` or `--also-gif` when
  110. GIF compatibility matters. The source sprite PNG is always kept beside the
  111. animation. Animation post-processing needs
  112. [ImageMagick](https://imagemagick.org/) (`magick`); WebP output additionally
  113. needs [libwebp](https://developers.google.com/speed/webp/download) (`img2webp`).
  114. `image-use doctor` reports whether both are installed.
  115. Full options: `image-use --help`. → **[Generate images](https://drawstyle.leeguoo.com/en/docs/generate)** · **[Styles](https://drawstyle.leeguoo.com/en/docs/styles)**
  116. To organize web runs, `--project` accepts an exact **name** (found or created;
  117. default `imagegen`) or an existing **Project landing URL** such as
  118. `https://chatgpt.com/g/g-p-<32-hex-id>/project`. URL targets open directly by ID,
  119. without listing or creating projects; localized display slugs, query strings,
  120. and fragments are accepted and discarded when opening the canonical URL.
  121. Malformed URL targets are rejected. `--project ""` uses a plain chat.
  122. Project routing is best-effort by default: an unavailable project warns and
  123. continues in a plain chat. Add `--require-project` (or `IMAGE_USE_REQUIRE_PROJECT=1`)
  124. when that fallback would be unwanted. It requires a non-empty target and
  125. `--backend web` or `auto`, verifies Project identity after opening and again in
  126. a capture guard on the native Send click, and disables Codex fallback even when
  127. the browser is unavailable. `IMAGE_USE_PROJECT` can supply either a name or URL.
  128. Use `--no-require-project` to override the environment default for one run,
  129. restoring best-effort routing and ordinary backend/fallback rules without
  130. changing the exported variable.
  131. Required-mode failures before Send retain the current draft for inspection.
  132. Inspect it in ChatGPT and manually clear the composer before the next run;
  133. ChatGPT can restore unsent drafts in new chats.
  134. ```bash
  135. image-use "a watercolor cat" --project "Art" --require-project --keep-conversation
  136. # To target an existing project exactly, set PROJECT_URL to its browser URL:
  137. image-use "a watercolor cat" --project "$PROJECT_URL" --require-project --keep-conversation
  138. ```
  139. Routing and retention are independent: **the conversation is deleted by default**,
  140. including with `--require-project`. Use `--keep-conversation` (or
  141. `IMAGE_USE_KEEP_CONVERSATION=1`) to retain it; `--keep-tab` also retains it.
  142. The ChatGPT browser backend pastes multiline prompts, checks the exact editor
  143. text, and waits for every reference upload to finish before clicking Send once.
  144. Incomplete uploads or altered text stop the run. If a send cannot be confirmed,
  145. it reports the uncertainty without sending again. Start with an empty composer;
  146. an existing draft is preserved. A run that stops before sending clears the text
  147. it pasted, except in required Project mode: it preserves the current draft for
  148. inspection because the route or draft ownership may have changed.
  149. After sending, the web backend waits up to `--timeout` for a fresh image confirmed
  150. in two consecutive page reads. Assistant text or a missing Stop control does not
  151. prove image generation has finished. Detected rate-limit dialogs stop the run
  152. immediately. When no image or streaming control is present, explicit English
  153. reply prefixes such as "You've hit the image generation limit" or "I can't
  154. generate that image." also fail immediately. Quoted mentions, vague "try again
  155. later" text, and unrecognized replies keep waiting until the deadline; this is
  156. not a complete quota/refusal detector for every wording or language. Timeout and
  157. recognized reply-body errors include assistant text (up to 240 characters);
  158. timeouts retain the last nonempty text through interrupted page reads.
  159. On timeout, check the original conversation before retrying: the image may still
  160. appear there, and `auto` does not fall back to Codex after submission. The error
  161. names the conversation; once the image shows up, collect it without prompting
  162. again:
  163. ```bash
  164. image-use recover https://chatgpt.com/c/<id> -o out.png
  165. ```
  166. `recover` uses the `chatgpt/images` adapter from
  167. [chrome-use-sites](https://github.com/leeguooooo/chrome-use-sites) (`chrome-use site update`
  168. installs it) and the same single chatgpt.com tab and lock as a web run.
  169. ## Community styles
  170. Browse and reuse art styles other people tuned — a public gallery at **[drawstyle.leeguoo.com](https://drawstyle.leeguoo.com)**. No script update needed:
  171. ```bash
  172. image-use "a fox barista" --style-online doodle # generate with a gallery style, nothing saved
  173. image-use style search "watercolor mascot" # search the gallery
  174. image-use style publish mystyle --category cute --from-last # share yours (one-time login)
  175. image-use upload out.png --style doodle # share a result to the style's player gallery (no login, on request)
  176. ```
  177. A style can pin a **character**, not just a look. Style assets carry reference images, so the same character comes back in a brand-new scene:
  178. ```bash
  179. image-use style add pip --kind character --ref pip-ref.png
  180. image-use "a fox barista" --style pip
  181. ```
  182. <table>
  183. <tr>
  184. <td width="50%"><img src="./docs/gallery/pip-ref.png" alt="Pip the fox — character reference"></td>
  185. <td width="50%"><img src="./docs/gallery/pip-cafe.png" alt="Pip the fox, redrawn in a cafe scene"></td>
  186. </tr>
  187. <tr>
  188. <td align="center"><sub>the pinned reference</sub></td>
  189. <td align="center"><sub>generated from <code>"a fox barista"</code></sub></td>
  190. </tr>
  191. </table>
  192. Gallery packages can be characters too — `xiaohei` is one.
  193. → **[Using gallery styles](https://drawstyle.leeguoo.com/en/docs/community)** · **[Submitting a style](https://drawstyle.leeguoo.com/en/docs/submit)**
  194. ## Learn more
  195. - 📖 **[Full documentation](https://drawstyle.leeguoo.com/en/docs)** — install, generating, styles, backends, the platform.
  196. - 🎨 **[Style gallery](https://drawstyle.leeguoo.com)** — browse and contribute community art styles.
  197. - 📝 **[Deep dive (blog)](https://blog.leeguoo.com/en/posts/chatgpt-imagegen/)** — the design and principles behind it.
  198. - ⚙️ **[How it works](./docs/how-it-works.md)** · **[HTTP API wrapper](https://github.com/leeguooooo/agent-cli-to-api)**
  199. - 🚀 Releasing: `scripts/release.sh <version> "<whatsnew>"` (`--dry-run` to preview) bumps the version, tests, pushes `main`, waits for the CI-created Release, then syncs the plugin marketplace.
  200. ## License
  201. MIT — see [LICENSE](./LICENSE).
  202. ## Disclaimer
  203. This tool calls ChatGPT's internal `backend-api/codex` endpoint — the same one the official Codex CLI uses. It is not a documented public API; OpenAI could change or restrict it at any time. Use at your own risk and within the [OpenAI Terms of Use](https://openai.com/policies/row-terms-of-use/) — in particular, **do not use your ChatGPT subscription to power a public-facing image generation service**.
  204. <details>
  205. <summary>Keywords</summary>
  206. `ChatGPT subscription image generation`, `free ChatGPT account image generation`, `use ChatGPT Plus for image API`, `gpt-image-2.5 without OPENAI_API_KEY`, `gpt-image-2.5 ChatGPT subscription`, `gpt-image-2 ChatGPT subscription`, `image_generation tool Responses API`, `ChatGPT image CLI`, `Codex CLI image_gen as standalone tool`, `DALL-E via ChatGPT Plus`, `OAuth-backed OpenAI image generation`, `no-API-key image generation`, `AI agent image generation skill`, `Claude Code image skill`, `OpenAI image generation without billing`.
  207. **中文:** 用 ChatGPT 订阅生成图片、免费 ChatGPT 账号生图、ChatGPT Plus 生图工具、不用 API key 生图、gpt-image-2 用订阅、ChatGPT 订阅生图 CLI、Codex CLI 生图能力独立工具、给 AI agent 用的生图 skill、本地生图脚本、零依赖 Python 生图工具。
  208. </details>
  209. ## Author
  210. Built by **郭立 (Guo Li / leeguoo)** — [leeguoo.com](https://leeguoo.com/about) · [GitHub](https://github.com/leeguooooo) · [X](https://x.com/leeguooooo) · more tools in the [*-use family](https://github.com/leeguooooo/plugins).
  211. ### Custom Codex Responses providers
  212. Use `--backend codex --codex-provider current` (or set
  213. `IMAGE_USE_CODEX_PROVIDER=current`) to select the top-level `model_provider`
  214. from `$CODEX_HOME/config.toml` (default `~/.codex/config.toml`). A provider name
  215. such as `--codex-provider myrelay` selects `[model_providers.myrelay]` directly.
  216. Provider mode requires Python 3.11+; leaving the option/environment variable
  217. empty preserves the existing ChatGPT OAuth backend on Python 3.10+.
  218. ```toml
  219. model = "gpt-6-astra"
  220. model_provider = "myrelay"
  221. [model_providers.myrelay]
  222. base_url = "https://relay.example"
  223. wire_api = "responses"
  224. requires_openai_auth = false
  225. auth = { command = "/usr/local/bin/get-token", args = ["--name", "relay"], timeout_ms = 15000, refresh_interval_ms = 3600000 }
  226. ```
  227. Recommended: use `auth.command`, which also works in desktop Codex and keeps the
  228. returned token out of config files and environment variables. The command and
  229. `args` run directly without a shell; trimmed stdout becomes the Bearer token.
  230. `auth` must be a table with a nonempty string `command`. Optional `args` must be
  231. a string list; `timeout_ms` must be a positive integer (default 15000); optional
  232. string `cwd` sets the working directory. This one-shot CLI ignores
  233. `refresh_interval_ms` and caches command success or failure once per provider
  234. per process. Priority is `env_key` → `auth.command` → `experimental_bearer_token`;
  235. failure of the selected source does not fall back. Alternatively, set
  236. `env_key = "MYRELAY_API_KEY"` and inject the token securely into the process
  237. environment; avoid plaintext `experimental_bearer_token` in config. The endpoint is
  238. `base_url.rstrip("/") + "/responses"`; the relay must support the Responses
  239. `image_generation` tool. Provider mode uses no ChatGPT OAuth or account ID.
  240. The top-level `model` supplies the driver default; `--model` (or
  241. `IMAGE_USE_MODEL`) overrides it. Static `http_headers` and `env_http_headers`
  242. (header name → environment variable name) are supported; unset header
  243. variables are skipped. `image-use doctor --codex-provider current` checks
  244. configuration/token readiness without displaying the token.
  245. The portable agent Skill is in [`skills/image-use`](skills/image-use). The root `image-use` is the canonical CLI source; after editing it, sync the bundled executable with `cp image-use skills/image-use/image-use`. Tests and release checks reject a stale copy. Codex-managed copies defer updates to their host instead of replacing cache files.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.