codex-image-server
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.
- License 许可
- MIT
- 最近更新
- 2026-06-10
- Stars
- ★ 3
- Forks
- 0
01 前言 Front Matter
- name
- codex-image-server
- description
- 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.
03 SKILL.md 正文
Codex Image Server
Use this skill to help a user expose local Codex image generation as a local HTTP API that another app can call.
Workflow
- Inspect the target Codex installation or source repo.
- Prefer a wrapper service around
codex execwhen the installed Codex package should stay untouched. - Add a local HTTP server with these routes:
GET /healthzGET /v1/capabilitiesPOST /v1/images/generateGET /v1/images/:id/file
- Keep authentication optional by default for loopback use. Do not require an API key unless the target app explicitly needs one.
- Pass references as original image files through Codex image inputs. Avoid sampling or screenshot downscaling.
- Support up to 4 images per request. Run workers concurrently, and make each candidate distinct.
- Wire cancellation through
AbortSignal. If the HTTP client disconnects or cancels, terminate the fullcodex execprocess group. - Validate gpt-image-2 custom sizes:
- longest edge <= 3840
- total pixels between 655360 and 8294400
- width and height multiples of 16
- aspect ratio <= 3:1
- Store generated files in a stable output directory and return both metadata and file URLs.
- Run the verification checklist before reporting completion.
References
- Read
references/http-contract.mdbefore implementing the API surface. - Use
templates/codex-image-server.jsas a concrete Node server template when the target repo has no implementation. - Use
scripts/smoke-test.mjsto check health, capabilities, and cancellation after the server starts.
Verification
Run these checks against the local server:
node scripts/smoke-test.mjs http://127.0.0.1:17341
Then test the consuming app:
curl -sS http://127.0.0.1:17341/v1/capabilities
curl -sS -m 3 http://127.0.0.1:17341/v1/images/generate \
-H 'Content-Type: application/json' \
-d '{"prompt":"cancel test","count":4,"size":"1024x1024","quality":"low"}' || true
ps aux | rg -i 'codex exec|codex-image-server'
The process check should not show leftover codex exec workers after cancellation.
04 同仓库更多 Skills
youtube-content
YouTube transcripts to summaries, threads, blogs.
xurl
X/Twitter via xurl CLI: post, search, DM, media, v2 API.
touchdesigner-mcp
Control a running TouchDesigner instance via twozero MCP — create operators, set parameters, wire connections, execute Python, build real-time visuals. 36 native tools.
test-driven-development
TDD: enforce RED-GREEN-REFACTOR, tests before code.
teams-meeting-pipeline
Operate the Teams meeting summary pipeline via Hermes CLI — summarize meetings, inspect pipeline status, replay jobs, manage Microsoft Graph subscriptions.
systematic-debugging
4-phase root cause debugging: understand bugs before fixing.