📦 Codex Image Server — Codex 图像服务器
v0.1.0Use when a user wants to turn local Codex image_generation capability into a local HTTP image server for 应用s such as Photoshop 插件s, de签名 工具s, or int...
运行时依赖
安装命令
点击复制技能文档
Codex Image Server
Use this 技能 to help a user expose local Codex image generation as a local HTTP API that another 应用 can call.
工作流 Inspect the tar获取 Codex 安装ation or source repo. Prefer a wr应用er 服务 around codex exec when the 安装ed Codex package should stay untouched. 添加 a local HTTP server with these 路由s: 获取 /健康z 获取 /v1/capabilities POST /v1/images/生成 获取 /v1/images/:id/file Keep authentication optional by default for loopback use. Do not require an API key unless the tar获取 应用 explicitly needs one. Pass references as original image files through Codex image 输入s. Avoid sampling or screenshot downscaling. Support up to 4 images per 请求. 运行 workers concurrently, and make each candidate distinct. Wire cancellation through Abort签名al. If the HTTP 命令行工具ent disconnects or cancels, terminate the full codex exec process group. 验证 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 生成d files in a stable 输出 directory and return 机器人h metadata and file URLs. 运行 the verification 检查列出 before 报告ing completion. References Read references/http-contract.md before implementing the API surface. Use templates/codex-image-server.js as a concrete Node server template when the tar获取 repo has no implementation. Use scripts/smoke-test.mjs to 检查 健康, capabilities, and cancellation after the server 启动s. Verification
运行 these 检查s agAInst the local server:
node scripts/smoke-test.mjs http://127.0.0.1:17341
Then test the consuming 应用:
curl -sS http://127.0.0.1:17341/v1/capabilities curl -sS -m 3 http://127.0.0.1:17341/v1/images/生成 \ -H 'Content-Type: 应用/json' \ -d '{"prompt":"cancel test","count":4,"size":"1024x1024","质量":"low"}' || true ps aux | rg -i 'codex exec|codex-image-server'
The process 检查 should not show leftover codex exec workers after cancellation.