Switch to VectorEngine gpt-image-2 and edits

Replace uses of the legacy `gpt-image-2-all` model with `gpt-image-2` and standardize image workflows: no-reference generation uses POST /v1/images/generations, any-reference flows use POST /v1/images/edits with multipart `image` parts. Update SKILLs, generation scripts, decision logs, and docs to reflect the contract change and edits-vs-generations guidance. Apply corresponding changes across backend (api-server match3d/puzzle modules, openai image adapter, mappers, telemetry, spacetime client/module), frontend components and services (Match3D, Puzzle, CreativeImageInputPanel, runtime shells), and add new spritesheet/parser files and tests. Also add media/logo.png. These changes align repository code and documentation with the VectorEngine image API contract and update generation/upload handling (green-screen -> alpha processing, spritesheet handling, and related tests).
This commit is contained in:
2026-05-22 03:06:41 +08:00
parent 321e1ea33a
commit ae014ac881
90 changed files with 7078 additions and 3389 deletions

View File

@@ -5,7 +5,7 @@ description: Generate or inspect project image assets through this repository's
# gpt-image-2 VectorEngine
Use this skill for project-local image asset generation that must match the repository's `server-rs` VectorEngine `gpt-image-2-all` path. The folder still contains `apimart` in its name for compatibility with existing local plugin references.
Use this skill for project-local image asset generation that must match the repository's `server-rs` VectorEngine `gpt-image-2` path. The folder still contains `apimart` in its name for compatibility with existing local plugin references.
## Workflow
@@ -40,22 +40,14 @@ Default body:
```json
{
"model": "gpt-image-2-all",
"model": "gpt-image-2",
"prompt": "<prompt>",
"n": 1,
"size": "1024x1024"
}
```
For weak visual references in text-to-image generation, add:
```json
{
"image": ["data:image/png;base64,..."]
}
```
For image-to-image work that must follow a reference image closely, use the VectorEngine edits endpoint instead of the generations `image` array:
For visual references, use the edit endpoint instead of the create endpoint:
```text
POST {VECTOR_ENGINE_BASE_URL}/v1/images/edits
@@ -73,9 +65,9 @@ size=1024x1024
image=@reference.png
```
Prefer edits for workflows where the reference image controls composition, pose, container shape, or layout. In this repository, Match3D container UI generation uses edits with `public/match3d-background-references/pot-fused-reference.png` as the `image` part.
In this repository, calls with no reference images use `POST /v1/images/generations`; calls with any reference image use `POST /v1/images/edits` and pass references as one or more `image` form parts. Match3D container UI generation embeds `public/match3d-background-references/pot-fused-reference.png` into the edit request as an `image` part.
Accept image output from `data[].url`, `data[].b64_json`, or direct nested `url` fields. VectorEngine GPT-image-2-all currently returns synchronously; do not poll APIMart task endpoints.
Accept image output from `data[].url`, `data[].b64_json`, or direct nested `url` fields. VectorEngine GPT-image-2 currently returns synchronously; do not poll APIMart task endpoints.
## Environment

View File

@@ -245,7 +245,7 @@ async function downloadUrl(url, timeoutMs) {
async function generateOne(env, entry, outDir) {
const requestBody = {
model: 'gpt-image-2-all',
model: 'gpt-image-2',
prompt: buildPrompt(entry),
n: 1,
size: '1024x1024',
@@ -305,7 +305,7 @@ if (dryRun) {
id: entry.id,
title: entry.title,
body: {
model: 'gpt-image-2-all',
model: 'gpt-image-2',
prompt: buildPrompt(entry),
n: 1,
size: '1024x1024',

View File

@@ -211,7 +211,7 @@ async function downloadUrl(url, timeoutMs) {
async function generateOne(env, template, outDir) {
const requestBody = {
model: 'gpt-image-2-all',
model: 'gpt-image-2',
prompt: buildPrompt(template),
n: 1,
size: '1024x1024',
@@ -275,7 +275,7 @@ if (dryRun) {
id: template.id,
title: template.title,
body: {
model: 'gpt-image-2-all',
model: 'gpt-image-2',
prompt: buildPrompt(template),
n: 1,
size: '1024x1024',