{"skill":{"slug":"codex-image-server","displayName":"Codex Image Server","summary":"Use when a user wants to turn local Codex image_generation capability into a local HTTP image server for apps such as Photoshop plugins, design tools, or int...","description":"---\nname: codex-image-server\ndescription: Use when a user wants to turn local Codex image_generation capability into a local HTTP image server for apps such as Photoshop plugins, design tools, or internal image workflows. Covers adding routes, multi-image generation, cancellation, original reference images, gpt-image-2 size limits, and validation.\n---\n\n# Codex Image Server\n\nUse this skill to help a user expose local Codex image generation as a local HTTP API that another app can call.\n\n## Workflow\n\n1. Inspect the target Codex installation or source repo.\n2. Prefer a wrapper service around `codex exec` when the installed Codex package should stay untouched.\n3. Add a local HTTP server with these routes:\n   - `GET /healthz`\n   - `GET /v1/capabilities`\n   - `POST /v1/images/generate`\n   - `GET /v1/images/:id/file`\n4. Keep authentication optional by default for loopback use. Do not require an API key unless the target app explicitly needs one.\n5. Pass references as original image files through Codex image inputs. Avoid sampling or screenshot downscaling.\n6. Support up to 4 images per request. Run workers concurrently, and make each candidate distinct.\n7. Wire cancellation through `AbortSignal`. If the HTTP client disconnects or cancels, terminate the full `codex exec` process group.\n8. Validate gpt-image-2 custom sizes:\n   - longest edge <= 3840\n   - total pixels between 655360 and 8294400\n   - width and height multiples of 16\n   - aspect ratio <= 3:1\n9. Store generated files in a stable output directory and return both metadata and file URLs.\n10. Run the verification checklist before reporting completion.\n\n## References\n\n- Read `references/http-contract.md` before implementing the API surface.\n- Use `templates/codex-image-server.js` as a concrete Node server template when the target repo has no implementation.\n- Use `scripts/smoke-test.mjs` to check health, capabilities, and cancellation after the server starts.\n\n## Verification\n\nRun these checks against the local server:\n\n```bash\nnode scripts/smoke-test.mjs http://127.0.0.1:17341\n```\n\nThen test the consuming app:\n\n```bash\ncurl -sS http://127.0.0.1:17341/v1/capabilities\ncurl -sS -m 3 http://127.0.0.1:17341/v1/images/generate \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"prompt\":\"cancel test\",\"count\":4,\"size\":\"1024x1024\",\"quality\":\"low\"}' || true\nps aux | rg -i 'codex exec|codex-image-server'\n```\n\nThe process check should not show leftover `codex exec` workers after cancellation.\n","tags":{"codex":"0.1.0","image-generation":"0.1.0","image-server":"0.1.0","latest":"0.1.0","photoshop":"0.1.0"},"stats":{"comments":0,"downloads":321,"installsAllTime":0,"installsCurrent":0,"stars":0,"versions":1},"createdAt":1778175980929,"updatedAt":1778492872010},"latestVersion":{"version":"0.1.0","createdAt":1778175980929,"changelog":"Initial Codex image server extraction from Lightyear Banana.","license":"MIT-0"},"metadata":null,"owner":{"handle":"catrefuse","userId":"s1768eg87kddn8jfvabsrdrnz184h1q1","displayName":"CatREFuse","image":"https://avatars.githubusercontent.com/u/8400960?v=4"},"moderation":{"isSuspicious":false,"isMalwareBlocked":false,"verdict":"clean","reasonCodes":["review.llm_review"],"summary":"Review: review.llm_review","engineVersion":"v2.4.24","updatedAt":1780090759038}}