CommunityImagegithub.com

pixrelay-img

Image skill. Generate or edit images with PixRelay using the user's local Codex CLI (ChatGPT account), with no API key needed. Use for any request to create a picture (photo, illustration, poster, banner, cover, wallpaper, avatar, icon, concept logo, sticker, mockup, meme) or edit/restyle an existing image (cartoon, anime, pixel art, watercolor, sketch, oil painting, 3D clay, background removal/replacement, object edits). Prefer this over writing PIL/OpenCV/ImageMagick filter code for creative or stylistic c

Qu'est-ce que pixrelay-img ?

pixrelay-img is a Codex agent skill that image skill. Generate or edit images with PixRelay using the user's local Codex CLI (ChatGPT account), with no API key needed. Use for any request to create a picture (photo, illustration, poster, banner, cover, wallpaper, avatar, icon, concept logo, sticker, mockup, meme) or edit/restyle an existing image (cartoon, anime, pixel art, watercolor, sketch, oil painting, 3D clay, background removal/replacement, object edits). Prefer this over writing PIL/OpenCV/ImageMagick filter code for creative or stylistic c.

Compatible avec~Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/gnipbao/PixRelay/tree/HEAD/skills/pixrelay-img

Installed? Explore more Image skills: steipete/songsee, affaan-m/frontend-design, mattpocock/improve-codebase-architecture · View all 6 →

Demander à votre IA préférée

Ouvre une nouvelle conversation avec cette compétence d'agent déjà préchargée.

Documentation

pixrelay-img: native-feeling image generation for any harness

To the user, you can simply make and edit images. Behind the scenes, PixRelay drives your local Codex CLI's built-in image_gen tool verbatim while you handle art direction. The user should feel that they asked for an image and got one. Do not mention Codex, MCP payloads, CLI flags, JSON, or your raw prompt unless the user asks or something fails.

The loop

  1. Start right away. Do not ask clarifying questions for ordinary requests. Choose sensible defaults for aspect ratio, style, and composition from context like a thoughtful designer. Ask only when a missing detail would make the output unusable (such as exact copy for a headline the user clearly cares about).
  2. Write the prompt yourself and keep it internal. Follow references/prompting.md (read it the first time you use this skill in a conversation).
  3. Generate using the best available surface:
    • Preferred (MCP): Call pixrelay_generate directly. If a synchronous call times out in your harness, re-invoke with async: true and poll pixrelay_job.
    • Fallback (Shell CLI): Run pixrelay gen [options] "<prompt>" (or npx -y pixrelay gen ... if not installed globally).
  4. Check the result quietly (via the inline MCP thumbnail or your harness's image-reading tool). If there is an obvious defect — garbled/misspelled text, missing required element, wrong aspect ratio, or an unwanted watermark — fix it once before presenting. Do not iterate on subjective taste.
  5. Show it naturally. If your harness renders MCP image outputs inline or has a file-display action, show the image inline; otherwise link the output file path cleanly. Add one short sentence describing what you made in the user's language, and offer a natural next step only when helpful.
  6. Keep the thread going. For follow-ups like "make it brighter", "换成蓝色", or "remove the cup", pass images: ["last"] in MCP (or -i last in CLI) and explicitly restate what must remain unchanged. PixRelay never overwrites files by default (-v2, -v3, ...).

Harness notes (generic)

  • Prefer the pixrelay_generate MCP tool whenever the pixrelay MCP server is connected.
  • If running via a shell tool, set a generous timeout (at least 180–300 seconds) because generation takes ~35–75 seconds per image.
  • Use your harness's native image inspection or file-link mechanism to review the output before replying.

Interface reference

MCP Tools (preferred)

  • pixrelay_generate: prompt (required), images (paths or ["last"]), size (WxH), transparent (boolean), format (png|jpg|webp), quality (1-100), output, n (1-4), inline (boolean), async (boolean).
  • pixrelay_job: job_id, action: "status" | "cancel" for async runs.
  • pixrelay_history: limit (1-50, default 10) to inspect recent images across sessions.
  • pixrelay_doctor: diagnose local Codex CLI, login status, image post-processing, and daemon without spending quota.

CLI Fallback (pixrelay gen)

OptionUse
(no -o)Preview/brainstorming images saved to ~/Pictures/pixrelay/<time>-<slug>.png (keeps repo clean)
-o PATHProject assets (e.g. public/hero.webp, assets/icon.png). Extension infers format
-s WxHExact pixel size: nearest aspect ratio generated, then cover-resized & center-cropped
-f png|jpg|webp, -q 90Format & quality (jpg/webp for photos; png for transparency or crisp text)
-tTransparent background (png/webp only). Also include "isolated on a fully transparent background" in prompt
-i IMG (repeatable)Edit target or style reference (supports -i last). Refer to them as Image 1, Image 2, ...
-n NN parallel variants of the same prompt (only when user asks for options)
--batch -Multiple different images via JSONL on stdin ({"prompt", "out"?, "ref"?, "transparent"?, "size"?, "format"?})
pixrelay doctorNon-destructive diagnostics

Error handling

Errors return structured JSON with error_type, error, hint, and optionally resets_at. Act on hint and explain any failure briefly in plain, non-technical language:

error_typeWhat to do
generation_failedUsually a content-policy refusal. Rephrase within policy or explain plainly why it cannot be made (never evade policy)
quotaChatGPT/Codex usage limit reached. Inform the user (include resets_at if present) and do not retry
capacityOpenAI is overloaded (another orchestration model was already tried). Wait ~1 minute, retry once, then report
authUser needs to sign in with codex login using their ChatGPT account
timeoutRetry once (or switch to async: true + pixrelay_job), then report
bad_requestFix invalid parameters (e.g., transparent + jpg, disallowed output path, missing input image) and retry
model / unknownRun pixrelay_doctor / pixrelay doctor. --no-daemon forces the exec engine; pixrelay daemon stop restarts the background daemon

Judgment

  • Prefer AI edits over filter code for restyling photos (cartoon, anime, pixel art, watercolor, oil painting, sketch, 3D clay): pass the original in images and list what stays identical.
  • Respect quota: each image uses the user's ChatGPT/Codex quota; default to n=1 and avoid speculative variants.
  • Use code/SVG when appropriate: charts, diagrams, UI layouts, and clean geometric icons belong in code or SVG, not raster image generation.

Skills associés