2.1 KiB
2.1 KiB
name, description
| name | description |
|---|---|
| chorus | Generate an image through the Chorus asynchronous OpenAPI with credentials from chorus.env, then save it to a user-specified directory and filename. Use when the user asks Chorus to create and download an image; do not use for image editing or arbitrary Chorus administration. |
Chorus Image Generation
Use scripts/generate_image.py for deterministic submission, polling, and download.
Required Inputs
- A prompt.
- An output path, or both an output directory and filename.
- A
chorus.envfile. Prefer the user-specified path; otherwise usechorus.envin the current working directory.
The environment file must define:
CHORUS_URL=http://127.0.0.1:8085
CHORUS_API_KEY=replace-with-a-chorus-api-key
The parser also accepts URL with APIKEY or API_KEY in a dedicated chorus.env. Never display, copy into commands shown to the user, log, or persist the API key elsewhere.
Run
Prefer one complete output path:
python "$env:USERPROFILE\.codex\skills\chorus\scripts\generate_image.py" --env chorus.env --prompt "提示词" --output "D:\output\image.png"
When the directory and filename are supplied separately:
python "$env:USERPROFILE\.codex\skills\chorus\scripts\generate_image.py" --env chorus.env --prompt "提示词" --output-dir "D:\output" --filename "image.png"
Do not add --overwrite unless the user explicitly permits replacing an existing file. Optional controls are --timeout, --poll-interval, and --idempotency-key.
Behavior
- Submit
image_generateto/openapi/v1/generations/image; do not upload input images. - Treat the API as asynchronous. Poll only the returned generation until it succeeds, fails, or reaches the timeout.
- Download the first image output using the same API Key and save it at the exact requested path.
- Report the generation ID and final absolute path. On failure, report the returned error code/message without exposing credentials.
- Do not retry with a new idempotency key after an ambiguous submission failure. Reuse an explicitly supplied key when the user asks to retry the same request.