⏳ This skill is pending AI review.
Scores will appear once the review pipeline completes.
c2c-img
Generate or edit images with the user's local Codex (ChatGPT) image model, with no API key needed. Use it for ANY request to create a picture (photo, illustration, poster, banner, cover, wallpaper, avatar, icon, logo concept, sticker, mockup, meme) or to change an existing image or photo. That especially includes creative restyling that keeps the people and composition, such as turning a photo into cartoon, anime, pixel art, watercolor, sketch, oil painting, 3D clay or Ghibli style, as well as retouching, removing or replacing the background, and adding or removing objects. Prefer this skill over writing PIL, OpenCV or ImageMagick filter code for any creative or stylistic change. Use code only for exact mechanical edits (crop, resize, rotate, compress, convert format) or when the user explicitly asks for an algorithmic filter. Chinese triggers include 画/生成图片/生图/出图/海报/配图/头像/壁纸/改图/P图/抠图/换背景/卡通化/动漫化/漫画风/像素画/像素风/手绘风/水彩/素描/油画/吉卜力/Q版/风格化/再来一张. Don't use it for charts, diagrams or UI that should be built as code.
Choose how to use this skill
You do not need every option. Choose the path your AI client supports. The stable page stays the same; versioned files are immutable.
1. Native installer
This listing has no registered native installer command. Use the complete package or source fallback below, depending on what your client supports.
Do not guess an installer command or replace an existing version without reviewing the diff.
2. Complete package recommended
Download the ZIP when available. It includes SKILL.md plus the references, security notes and version metadata.
No complete ProSkills package is published for this listing yet.3. Prompt-only
Copy the prompt above when the agent can read the stable page or when you want to adopt the workflow without installing a skill.
Need only the instruction file?
Download SKILL.md only if your client requires a single file. The complete ZIP is safer for a full installation because it preserves the references and release context.
No path installs or executes anything by itself. Your agent still needs access to the project files. Before updating, compare the installed version and review the diff.
// RATINGS
Not yet listed on ClawHub or SkillsMP
// README
c2c-img — built-in image generation for Claude Code, powered by Codex
English | 简体中文
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.
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.
| Chinese poster, text rendered exactly | Edit: change dawn to an aurora night, and nothing else | Transparent sticker (-t -s 512x512 -f webp) |
|---|---|---|
![]() | → ![]() | ![]() |
Install
Requirements:
- The Codex CLI, from the ChatGPT desktop app or
npm i -g @openai/codex, signed in withcodex loginusing 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:
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.
Use it
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.
Under the hood, Claude calls the script:
| Option | What it does |
|---|---|
"prompt" | Text-to-image. Codex passes the prompt through verbatim |
-i IMG (repeatable) | Edit an image, or use it as a reference (Image 1, Image 2, …) |
-t | Transparent background. The output has real alpha |
-s 1200x628 | Exact size: generates at the nearest aspect ratio, then scales and center-crops |
-f png|jpg|webp | Output format. It can also be inferred from the -o extension |
-n 3 / --batch - | Variants of one prompt, or several different jobs from JSONL, run in parallel |
--doctor / --stop-daemon | Check the setup, or stop the background helper |
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.
How it works
Claude ─Bash─▶ c2c_img.py ─▶ 127.0.0.1 + token ─▶ daemon ─▶ codex app-server (kept warm)
└─ fallback ─▶ codex exec --ephemeral (lean mode), one process per image
- Daemon engine (default): keeps
codex app-serverwarm between calls, cutting the median overhead per call from 13.9 s to 6.6 s. It reads the saved path directly fromimageGenerationevents. 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. - Exec engine (fallback): runs
codex execwith the user's config ignored and 17 unneeded tools disabled, including shell. It stops Codex as soon as the image file is complete. - 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.
A typical new image takes about 40–50 s. Most of that is the image model itself, and it varies with server load.
Platforms and tests
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.
python3 tests/test_offline.py
python3 tests/test_engines.py
test_offline.py: unit tests and post-processing.test_engines.py: end-to-end tests of both engines againsttests/fake_codex.py. No Codex login or quota is needed.
Limitations
- It relies on Codex internals: the app-server protocol (marked experimental),
exec --jsonevents, and thegenerated_images/layout. The two engines back each other up. After a Codex upgrade, run--doctor. - The image tool has no size parameter. The prompt sets the aspect ratio, and
-spost-processes to exact pixels. - Each image uses your ChatGPT/Codex quota.
License
MIT © 2026 actionow
// HOW IT'S BUILT
// FILES
4 files shipped with this skill. Inline text is the catalog copy. The upstream link is the source repository.
skills/c2c-img/SKILL.md8.5 KB214b4b3eb321upstream ↗
--- name: c2c-img description: Generate or edit images with the user's local Codex (ChatGPT) image model, with no API key needed. Use it for ANY request to create a picture (photo, illustration, poster, banner, cover, wallpaper, avatar, icon, logo concept, sticker, mockup, meme) or to change an existing image or photo. That especially includes creative restyling that keeps the people and composition, such as turning a photo into cartoon, anime, pixel art, watercolor, sketch, oil painting, 3D clay or Ghibli style, as well as retouching, removing or replacing the background, and adding or removing objects. Prefer this skill over writing PIL, OpenCV or ImageMagick filter code for any creative or stylistic change. Use code only for exact mechanical edits (crop, resize, rotate, compress, convert format) or when the user explicitly asks for an algorithmic filter. Chinese triggers include 画/生成图片/生图/出图/海报/配图/头像/壁纸/改图/P图/抠图/换背景/卡通化/动漫化/漫画风/像素画/像素风/手绘风/水彩/素描/油画/吉卜力/Q版/风格化/再来一张. Don't use it for charts, diagrams or UI that should be built as code. license: MIT compatibility: Requires the Codex CLI signed in with a ChatGPT account, and Python 3.9+. Built for Claude Code; works in any agent that can run shell commands and view images. metadata: author: actionow version: "0.4.1" --- # c2c-img: image generation that feels built in To the user, you can simply make images. Behind the scenes, `scripts/c2c_img.py` has Codex's `image_gen` render your prompt exactly as written, and you do the art direction. **The user should feel that they asked for an image and got one.** Don't mention Codex, scripts, JSON, or your prompt unless they ask or something breaks. > **Other agents:** tool names below are Claude Code's. Use your own equivalents: a shell tool for > the script, an image-viewing tool for checking the result, and a file-sharing tool (if any) for showing it. ## The loop 1. **Start right away.** Don't ask clarifying questions for ordinary requests. Choose sensible defaults for aspect ratio, style, and composition from context, the way a good designer would. Ask only when a missing detail would make the result useless, such as the exact wording for a poster headline the user clearly cares about. 2. **Write the prompt yourself** and don't show it to the user. Follow [references/prompting.md](references/prompting.md). Read it the first time you use this skill in a conversation. 3. **Generate** by running a single Bash call with `timeout: 600000`. Set the `description` to plain language, such as `Generating image: red fox in snow` or `正在生成图片:中秋海报`. That line is what the user sees while they wait. 4. **Check the result quietly** by opening each image with the Read tool. If it has an obvious defect, fix it once before showing anything. Obvious defects are garbled or misspelled text, a missing required element, the wrong aspect ratio, or a watermark. Don't iterate on matters of taste. 5. **Show it.** If a tool for showing files to the user exists (such as `SendUserFile` with `display: "render"`), send the image or images so they appear inline. Otherwise, link the path. Add one short sentence about what you made. Offer one natural next step only when it helps, such as "Want a warmer palette or a portrait version?". Reply in the user's language. 6. **Keep the thread going.** Remember the paths you've produced. For requests like "make it brighter", "换成蓝色", or "remove the cup", edit the latest image with `-i <last path>` and restate what must stay the same. The script never overwrites files: it saves `-v2`, `-v3`, and so on automatically. ## Running the script ```bash python3 <skill_dir>/scripts/c2c_img.py [options] "<prompt>" ``` `<skill_dir>` is the base directory shown when this skill loaded. On Windows, use `python` or `py -3` if `python3` isn't available. | Option | Use | |---|---| | *(no `-o`)* | For preview or brainstorming images. They are saved to `~/Pictures/c2c_img/<time>-<slug>.png`, which keeps the user's repo clean | | `-o PATH` | For project assets. Put them where the project keeps images (for example `public/`, `assets/`, `static/img/`) and give them a descriptive name. The extension sets the format | | `-s WxH` | Exact pixel size. The image is generated at the nearest aspect ratio, then scaled and center-cropped. Use it for icons, banners, and social cards | | `-f png\|jpg\|webp`, `-q 90` | Output format and quality. Use jpg or webp for web photos and png for anything with transparency or crisp text | | `-t` | Transparent background. Also write "isolated on a fully transparent background" in the prompt | | `-i IMG` (repeatable) | An input image to edit or use as a reference. In the prompt, refer to them as Image 1, Image 2, … in the order given | | `-n N` | N variants of the **same** prompt, run in parallel. Only use it when the user wants options | | `--batch -` | Several **different** images in one call, run in parallel. Pass JSON lines on stdin, one per image: `{"prompt", "out"?, "ref"?, "transparent"?, "size"?, "format"?}` | | `--doctor` | Checks the setup without generating anything. Run it when something fails for an unclear reason | Timing: a new image takes about 35–50 s, and an edit or a transparent image about 45–75 s. The server side varies from minute to minute. Parallel jobs finish in about the time of one job. For a batch of 3 or more images, tell the user in one short line that they're on the way (for example "Making 4 images, about a minute."). Run the batch with `run_in_background: true` if you have other work to do meanwhile. Output on stdout is JSON. Progress goes to stderr. ```json {"ok": true, "images": ["/abs/a.png"], "results": [{"ok": true, "path": "/abs/a.png", "width": 1254, "height": 1254, "notes": [...]}]} ``` A failed job has `error_type`, `error`, and `hint` fields. Act on `hint`. When you explain the problem to the user, keep it short and non-technical. | `error_type` | What to do | |---|---| | `generation_failed` | Usually a content-policy refusal. Rephrase within the policy, or tell the user plainly why it can't be made. Never try to evade the policy | | `quota` | The ChatGPT/Codex usage limit has been reached. Tell the user, including when it resets (`resets_at`) if that's given, and don't retry | | `capacity` | OpenAI is overloaded, and another model was already tried. Wait a minute, retry once, then report it | | `auth` | The user needs to run `codex login` with their ChatGPT account | | `timeout` | Retry once, then report it | | `bad_request` | Fix the arguments and retry. For example, if webp isn't available here, use png | | `model` / `unknown` | Run `--doctor` and report what it shows. `--no-daemon` forces the simpler engine, and `--stop-daemon` restarts the background helper | ## Inputs from the user - **An image path or dragged-in file:** pass the original file with `-i`. Say whether it's the thing to edit or only a style reference. Convert HEIC first (`sips -s format jpeg in.heic --out in.jpg`). Photos from a phone may be rotated by EXIF: if a preview looks sideways, pass an upright copy. - **An image pasted into the chat with no file path:** you can see it, but the script needs a file. Ask the user, in one line, to drag the file in or give its path. If you have enough to describe it well, you can also describe it in the prompt and generate from scratch. ## Judgment - **Choose AI edits over filter code.** Restyling a user's photo (cartoon, pixel art, anime, watercolor, sketch, and so on) is an **edit**: pass the original with `-i` and list what must stay the same (faces and likeness, expressions, hair, outfits, pose, framing, background layout). The image model keeps the likeness and redraws it in the style. Filter code (PIL, OpenCV, ImageMagick) can only pixelate or posterize, and the result looks mechanical, so don't reach for it for these requests. Use code only for exact mechanical operations, or when the user explicitly wants a deterministic, algorithmic effect. - Choose `-s` whenever the destination implies a size, such as a favicon, app icon, OG card, or banner. - For images that go into a project, update whatever references them (HTML, CSS, markdown) if that is part of the task. - Each image uses the user's ChatGPT/Codex quota. Make what was asked for. Don't generate speculative variants unless the user wants options. - Anything that should be precise and editable, such as a chart, a diagram, a UI, or a simple geometric icon, is better built as code or SVG. Offer that instead.skills/c2c-img/scripts/c2c_img.py47 KB5f9990e56c96upstream ↗
Contents are not inlined in the catalog. Open the upstream file.
skills/c2c-img/references/prompting.md6.1 KBed5a05996fdeupstream ↗
# Writing image prompts Codex passes your prompt to the image model exactly as written, so the result is only as good as your art direction. Write the prompt in English. The exception is any text that must appear in the image: quote it exactly, in its own language. ## How much to add - **The user was specific:** keep every detail. Put it in order and structure it, but don't add creative ideas of your own. - **The user was vague**, as in "画只猫" or "a hero image for my site": add tasteful direction where it materially helps, such as medium, composition, lighting, palette, and intended use. A vague request should still come back looking deliberate and polished. - **Never add** characters, objects, brands, slogans, or text that the request doesn't imply. - For a vague request, take the obvious reading. Don't ask the user which one they meant. ## Structure Use only the lines that help: ```text Use case: <photo | product-mockup | illustration | logo-brand | ui-mockup | infographic | poster | sticker | edit ...> Asset type: <where it will be used: landing hero, app icon, book cover, social post ...> Primary request: <one sentence: the core ask> Input images: <Image 1: edit target; Image 2: style reference> (only with -i) Scene/backdrop: <environment> Subject: <main subject, with concrete details> Style/medium: <photoreal 50mm | flat vector | watercolor | 3D clay render | ink wash ...> Composition: <framing + placement, e.g. "subject on right third, empty sky top-left for a title"> Lighting/mood: <golden hour, soft studio, moody low-key ...> Color palette: <2-4 colors or a feel> Text (verbatim): "<exact text>" — <font feel>, <placement> Constraints: <must keep / must avoid>; no watermark ``` Scene first, then the subject, then details, then constraints. Use camera language for photos (lens, depth of field, angle), and name the medium for illustration. ## Choosing aspect ratio and size by context | Destination | Ratio | Suggested `-s` | |---|---|---| | Avatar, icon, social square, sticker | 1:1 | `1024x1024`, or `512x512` for an icon | | Blog header, OG or social share card | ~1.91:1 | `1200x630` | | Website hero, slide, video thumbnail | 16:9 | `1920x1080` or `1280x720` | | Phone wallpaper, story, reel cover | 9:16 | `1080x1920` | | Poster, flyer, book cover | 3:4 or 2:3 | `1200x1600` | | Product shot, portrait photo | 4:5 | `1080x1350` | Without `-s`, write the ratio into the Composition line, for example "wide 16:9 landscape". The model's native output is around 1–1.7 MP. Upscaling well beyond that (to 4K, for instance) looks soft; the script adds a note when it upscales. ## Text in images - Keep in-image text short, since headlines work better than paragraphs. Quote it exactly. Chinese, Japanese, and Korean text works well. - Say where it goes, how big it is, and what it feels like, for example "large brush-calligraphy title centered in the upper third". - For unusual words or brand names, spell them out letter by letter and ask for a verbatim rendering. - If the user didn't specify any text, prefer none ("no text"). Don't invent copy. - Always check the text when you review the image. Garbled text is the most common defect worth a retry. ## Recipes **Photo or lifestyle scene.** Give a real place, real textures, and natural light. Mention the lens and depth of field. "candid, editorial" keeps it from looking like stock. **Product shot.** Give the surface, the backdrop color, and the lighting setup (softbox, rim light). Say "no logos" unless the user gave one. Leave negative space if it's for a page. **Illustration or concept art.** Name the medium and its texture, the palette, and the level of detail. For a series, reuse the same style line word for word so the images match. **Logo or icon concept.** Ask for simple bold shapes that read at small sizes, a limited palette, and a centered mark with padding. Add `-t` for a transparent background. It's a concept: mention that a production logo should be redrawn as a vector. **Poster or cover.** Put the scene and mood first. Give the text lines verbatim with their hierarchy (title, then subtitle, then date), and leave clear space for the text. **UI mockup.** Give the fidelity (wireframe or polished), the platform and screen size, and the key components. Keep text minimal and real. If the user needs working UI, build it as code instead. **Photo restyle (cartoon, pixel art, anime, watercolor, and so on).** Pass the photo with `-i` and describe the whole redraw. Keep the people recognizable: ```text Use case: style-transfer Primary request: Edit Image 1 — redraw the entire photo as <style>. Keep: the same people with recognizable faces, expressions, hairstyles and outfits; the same pose, framing and background layout. Style: <e.g. pixel art — visible square pixels, limited ~32-color palette, clean dark 1-px outlines, 16-bit retro game look | anime — cel shading, clean line art, soft pastel light> Constraints: no text, no watermark ``` **Sticker or transparent cutout.** Use `-t` and write "isolated on a fully transparent background". Mention an outline ("thick white die-cut border") for stickers. Check the edges when you review. ## Edits (`-i`) - Start with `Edit Image 1:` and then **what changes**. Follow with **what stays**: identity, face, pose, framing, colors, text, and background, as relevant. - Change one thing per round. Repeat the unchanged list word for word on every iteration, so details don't drift over several rounds. - For a style reference, write: `Use Image 2 only as a style reference (palette, brushwork, lighting); do not copy its subject or layout.` - For compositing, write: `Place the product from Image 2 onto the table in Image 1; match perspective, lighting and shadows.` - To change the background or remove it: `Edit Image 1: replace only the background with …; keep the subject's edges, colors and lighting unchanged.`, adding `-t` to remove it. ## Always avoid Watermarks and signatures, extra text or logos nobody asked for, cluttered compositions, imitating a named living artist's style, and realistic images of real, identifiable people in fabricated situations.README.mdupstream ↗
Contents are not inlined in the catalog. Open the upstream file.
Plain-text copy, no login: /skill-bundles/actionow-ai-c2c-img-skills-c2c-img.md

→ 
