FlyReq Image Studio · WanAPIs media integration v1

Upstream: https://github.com/doudou770/flyreq-image-studio
Base commit: bcec8c8992b407997a5f872bcb7fa1436d7505cd (FlyReq 1.5.1)
License: GNU Affero General Public License v3. See the included, unmodified upstream LICENSE.
Original source: https://github.com/doudou770/flyreq-image-studio/tree/bcec8c8992b407997a5f872bcb7fa1436d7505cd
This package contains a source patch and mock protocol tests.

1. Apply and run locally

Extract this ZIP. Set WANAPIS_FLYREQ_PATCH to the absolute path of the extracted wanapis-flyreq.patch. Use a fresh FlyReq checkout. When you are ready to install and run the upstream application locally, use Node.js 22 and these commands.

    git clone https://github.com/doudou770/flyreq-image-studio.git
    cd flyreq-image-studio
    git checkout --detach bcec8c8992b407997a5f872bcb7fa1436d7505cd
    git apply --check "$WANAPIS_FLYREQ_PATCH"
    git apply "$WANAPIS_FLYREQ_PATCH"
    npm ci --prefix frontend
    npm ci --prefix backend
    npm run build
    HOSTNAME=127.0.0.1 PORT=3001 NODE_ENV=production FLYREQ_VIDEO_UPSTREAM_LOG_ENABLED=false npm start

Open http://127.0.0.1:3001. Use the full patched checkout so the backend can load its supporting modules. Keep keys in the app's model settings. Use a WanAPIs token authorized for the two model IDs below.

2. Configure images

Settings → Models → Image models → Add image model. In Built-in preset, select WanAPIs GPT Image 2. Verify that Base URL is https://api.wanapis.com and Model ID shows the gpt-image-2-official placeholder. Leave Model ID blank to use the preset, paste your key into API Key, and save. In the image workspace, select WanAPIs GPT Image 2, enter a prompt, choose 1:1 at 1K and set quantity to one for a first paid generation. Low quality is fixed. The UI offers five aspect ratios. Image-to-image accepts up to 16 PNG, JPEG, or WebP reference images. The result is saved through the normal studio image history.

3. Configure video

Settings → Models → Video models → Add video model. Set Protocol to WanAPIs before entering your key. Enter a display name such as WanAPIs Seedance Flash. Verify that Base URL is https://api.wanapis.com and Model ID shows the seedance-2-5-flash placeholder. Leave Model ID blank to use the preset, paste your key into API Key, and save. In the video workspace, select the video model, enter a text prompt and set quantity to one. This preset sends a 4-second 480p request with adaptive framing and audio enabled. Select the sole 4s and 480p options if the UI restores values from a previous model. The video is saved through the normal studio video history. Video reference uploads and H3 are outside this package's scope.

Both workspaces can use the configured model without Fetch models. The media adapter accepts https://api.wanapis.com and https://direct.wanapis.com, with an optional /v1 suffix. Set the Base URL before pasting the key. Quantity above one submits separate paid tasks. If a submission or poll returns an error after the task was accepted, check the WanAPIs task log before manually submitting it again. A FlyReq timeout or local cancellation does not cancel a task running at the gateway. The image preset is intended for the image workspace. GIF mode requires a custom grid size and is incompatible with this preset.

4. Reproduce the offline checks

Run `node --test /absolute/path/to/extracted/wanapis-media.test.cjs` using Node.js 20 or 22. It imports only the newly authored adapter beside it, which is also added by the patch. `cmp /absolute/path/to/extracted/wanapis-media.cjs /absolute/path/to/flyreq-image-studio/backend/wanapis-media.cjs` verifies the two copies match after applying the patch. `git apply --check` should be run before applying the patch. The tests use synthetic replies and loopback redirect servers. They exercise exact request payloads, task ID and status extraction, nested result URLs, one-shot image submit, and same-origin result authorization. FlyReq build, browser UI and real generation have not been run as part of this package's verification.

WanAPIs public contract: https://wanapis.com/docs#dx-os
