gpt2api-image-generator
GPT2API Image Generator
Overview
Use this skill for direct image-generation and direct image-edit requests. It
calls the configured GPT2API public image endpoints, stores generated images
under .run/artifacts/generated/, and returns local artifact paths that can be
sent with reply-current --image.
Do not answer image-generation requests with text only unless generation fails. Do not use GPT2API session APIs for this skill.
Config
The private config lives at:
.bridge-private/gpt2api-image.json
That directory is gitignored. The required fields are:
base_url: GPT2API public API root, for examplehttps://ackingliu.top/api/gpt2apiapi_key: bearer token for GPT2API
Optional fields:
model: defaults togpt-image-2size: defaults to1024x1024n: defaults to1response_format: defaults tob64_jsontimeout_seconds: defaults to300endpoint_path: defaults to/images/generationsedit_endpoint_path: defaults to/images/edits
Workflow
Direct Generation
- Treat the user's visual request as the prompt. Keep concrete style, subject, text, ratio, and size requirements if they were given.
- Generate the image:
python3 skills/gpt2api-image-generator/generate_gpt2api_image.py \
--prompt "一只穿宇航服的猫,月球表面,电影感光照"
Direct Edit
- Recover or use the input image file path from the current request context.
- Treat the user's requested change as the prompt. Keep size requirements if they were given.
- Edit the image:
python3 skills/gpt2api-image-generator/generate_gpt2api_image.py \
--image .run/artifacts/input.png \
--prompt "保留人物姿势,把背景改成雨夜霓虹街道" \
--size 1024x1536
Reply
- Parse the JSON output. For one image, use
path; for multiple images, use each value inpaths. - Send each generated image with
reply-current:
python3 skills/reply-current/reply_current.py \
--context-file /abs/path/from/developer_instructions/contexts/group_111.json \
--image .run/artifacts/generated/gpt2api_20260428T120000Z_1_abcd1234.png
Rules
- This skill exposes only two bot-level concepts: direct generation
(
prompt+ optionalsize/n) and direct edit (image+prompt+ optionalsize/n). - Use
/images/generationsfor direct generation and/images/editsfor direct edit. Do not use/sessions,/messages, or product session APIs. - Always send the generated image artifact itself. A text-only "done" reply is not enough.
- If the user asks for more than one image, pass
--n, capped by the script. - If the user specifies a square or exact size, pass
--size WIDTHxHEIGHT. - If the user asks to edit an existing image, pass that image with
--image. - Keep the prompt focused on the requested image. Do not prepend chat markers, routing notes, or commentary.
- Do not expose the API key in replies, logs, or copied command output.
More from acking-you/codex-bridge
reply-current
Use when a Codex turn running inside codex-bridge must send normal results back to the active QQ conversation as text, image, or file
1invoke-capability
Call another registered model (Claude via Kiro, Gemini images, ...) to produce this turn's reply, keeping Codex as the harness but letting a better-suited model own the actual voice. Use liberally for conversational / emotional / creative turns; Codex's own voice is a poor fit for most QQ chat.
1qq-current-history
Query normalized QQ message history for the current conversation only, with optional time, sender, keyword, and free-form filters
1qq-quoted-image-recovery
Use when a quoted QQ message likely contained an image or screenshot but the bridge only exposed a quote marker or flattened text
1staticflow-kiro-log-diagnoser
Use when a Codex turn needs to diagnose StaticFlow Kiro upstream failures by reading the backend error log and correlating real usage events through sf-cli
1