Skip to content
Back to search

c2c-img

MarketplaceWorks with Claude CodeGitHub

c2c_img: let Claude Code generate and edit images through your local Codex (ChatGPT) image_gen.

Safety scan

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

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/actionow-ai--c2c-img/badge.svg)](/listings/actionow-ai--c2c-img)

HTML

<a href="/listings/actionow-ai--c2c-img"><img src="/api/listings/actionow-ai--c2c-img/badge.svg" alt="findsafeskills safety rating" /></a>

Install

Install instructions from the README

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

Requirements: - The Codex CLI, from the ChatGPT desktop app or `npm i -g @openai/codex`, signed in with `codex login` using a ChatGPT account. - Python 3.9 or later.

**As a Claude Code plugin (recommended)**:

/plugin marketplace add actionow-ai/c2c_img
/plugin install c2c-img@c2c-img

**As a plain skill**, for Claude Code and other agents that support [Agent Skills](https://agentskills.io):

npx skills add actionow-ai/c2c_img -g -a claude-code

Or copy `skills/c2c-img/` into `~/.claude/skills/`.

**Check your setup** (this generates nothing):

python3 skills/c2c-img/scripts/c2c_img.py --doctor

`pip install pillow` is optional. It adds webp output, and on Linux and Windows it also adds `--size` and jpg support. On macOS, the built-in `sips` already handles resizing, png and jpg.

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.

.claude-plugin/marketplace.json · Manifest · 18 lines

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

  1. {
  2. "name": "c2c-img",
  3. "description": "c2c_img: let Claude Code generate and edit images through your local Codex (ChatGPT) image_gen.",
  4. "owner": {
  5. "name": "actionow"
  6. },
  7. "plugins": [
  8. {
  9. "name": "c2c-img",
  10. "source": "./",
  11. "description": "Built-in image generation and editing for Claude Code, powered by your local Codex (ChatGPT) image_gen. No API key needed.",
  12. "version": "0.4.1",
  13. "author": {
  14. "name": "actionow"
  15. }
  16. }
  17. ]
  18. }
README.md · README · 96 lines

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

  1. # c2c-img — built-in image generation for Claude Code, powered by Codex
  2. **English** | [简体中文](README.zh-CN.md)
  3. If you have both **Claude Code** and **Codex** (ChatGPT), this plugin lets Claude generate and edit images with Codex's built-in `image_gen` tool. It runs on your ChatGPT login, so **you don't need an `OPENAI_API_KEY`**.
  4. It is designed to feel native. You say "draw me a…", and a moment later the image appears in the conversation. Say "make it brighter" or "now a portrait version", and Claude edits the last image. Claude writes the prompt, checks the result itself, and never shows you the plumbing.
  5. | Chinese poster, text rendered exactly | Edit: change dawn to an aurora night, and nothing else | Transparent sticker (`-t -s 512x512 -f webp`) |
  6. |---|---|---|
  7. | ![poster](docs/images/poster-zh.jpg) | ![before](docs/images/edit-before.jpg) → ![after](docs/images/edit-after.jpg) | ![sticker](docs/images/sticker-transparent.png) |
  8. ## Install
  9. Requirements:
  10. - The Codex CLI, from the ChatGPT desktop app or `npm i -g @openai/codex`, signed in with `codex login` using a ChatGPT account.
  11. - Python 3.9 or later.
  12. **As a Claude Code plugin (recommended)**:
  13. ```
  14. /plugin marketplace add actionow-ai/c2c_img
  15. /plugin install c2c-img@c2c-img
  16. ```
  17. **As a plain skill**, for Claude Code and other agents that support [Agent Skills](https://agentskills.io):
  18. ```bash
  19. npx skills add actionow-ai/c2c_img -g -a claude-code
  20. ```
  21. Or copy `skills/c2c-img/` into `~/.claude/skills/`.
  22. **Check your setup** (this generates nothing):
  23. ```bash
  24. python3 skills/c2c-img/scripts/c2c_img.py --doctor
  25. ```
  26. `pip install pillow` is optional. It adds webp output, and on Linux and Windows it also adds `--size` and jpg support. On macOS, the built-in `sips` already handles resizing, png and jpg.
  27. ## Use it
  28. Just ask: *"Draw a cozy isometric reading nook with a sleeping cat"*, *"make a 1200×630 OG image for this blog post"*, *"remove the background from ./logo.png"*, or *"做一张中秋海报"*. Claude picks sensible defaults (aspect ratio, style, where to save), generates the image, checks it, and shows it to you.
  29. Under the hood, Claude calls the script:
  30. | Option | What it does |
  31. |---|---|
  32. | `"prompt"` | Text-to-image. Codex passes the prompt through verbatim |
  33. | `-i IMG` (repeatable) | Edit an image, or use it as a reference (Image 1, Image 2, …) |
  34. | `-t` | Transparent background. The output has real alpha |
  35. | `-s 1200x628` | Exact size: generates at the nearest aspect ratio, then scales and center-crops |
  36. | `-f png\|jpg\|webp` | Output format. It can also be inferred from the `-o` extension |
  37. | `-n 3` / `--batch -` | Variants of one prompt, or several different jobs from JSONL, run in parallel |
  38. | `--doctor` / `--stop-daemon` | Check the setup, or stop the background helper |
  39. Without `-o`, images are saved to `~/Pictures/c2c_img/<time>-<slug>.png`. Existing files are never overwritten: a new version is saved as `-v2`, `-v3`, and so on.
  40. ## How it works
  41. ```
  42. Claude ─Bash─▶ c2c_img.py ─▶ 127.0.0.1 + token ─▶ daemon ─▶ codex app-server (kept warm)
  43. └─ fallback ─▶ codex exec --ephemeral (lean mode), one process per image
  44. ```
  45. - **Daemon engine (default):** keeps `codex app-server` warm between calls, cutting the median overhead per call from 13.9 s to 6.6 s. It reads the saved path directly from `imageGeneration` events. It gets structured errors: quota with its reset time, capacity (it retries on another model), and refusals. It exits after 15 idle minutes, and it's replaced automatically when Codex or the script is upgraded.
  46. - **Exec engine (fallback):** runs `codex exec` with the user's config ignored and 17 unneeded tools disabled, including shell. It stops Codex as soon as the image file is complete.
  47. - **Both engines** run Codex in an empty temp directory with a read-only sandbox. They move (not copy) the result out of `~/.codex/generated_images`.
  48. A typical new image takes about 40–50 s. Most of that is the image model itself, and it varies with server load.
  49. ## Platforms and tests
  50. macOS has been tested with a real Codex install. Linux and Windows are supported through process groups and `taskkill`, cross-platform file locks, and UTF-8 stdio. CI covers **macOS, Ubuntu and Windows with Python 3.9 and 3.12**.
  51. ```bash
  52. python3 tests/test_offline.py
  53. ```
  54. ```bash
  55. python3 tests/test_engines.py
  56. ```
  57. - `test_offline.py`: unit tests and post-processing.
  58. - `test_engines.py`: end-to-end tests of both engines against [`tests/fake_codex.py`](tests/fake_codex.py). No Codex login or quota is needed.
  59. ## Limitations
  60. - It relies on Codex internals: the app-server protocol (marked experimental), `exec --json` events, and the `generated_images/` layout. The two engines back each other up. After a Codex upgrade, run `--doctor`.
  61. - The image tool has no size parameter. The prompt sets the aspect ratio, and `-s` post-processes to exact pixels.
  62. - Each image uses your ChatGPT/Codex quota.
  63. ## License
  64. [MIT](LICENSE) © 2026 actionow

Ratings and comments

Sign in to rate this skill.

Sign in

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