/c2c-img:c2c-imgfrom c2c-img
Generates and edits images using the local Codex image model without an API key. Handles creative tasks like illustrations, posters, avatars, and style transfers (cartoon, anime, watercolor, etc.) as well as retouching and background changes.
Ships in c2c-img. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
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.
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.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.-i <last path> and
restate what must stay the same. The script never overwrites files: it saves -v2, -v3,
and so on automatically.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.
{"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 |
-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.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.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub actionow-ai/c2c_img --plugin c2c-imgOther plugins' skills for the same job