Skip to content

feat(providers): add WaveSpeed AI image and video tools - #975

Open
chengzeyi wants to merge 1 commit into
OpenMontageInc:mainfrom
chengzeyi:feat/wavespeed-provider
Open

chengzeyi wants to merge 1 commit into
OpenMontageInc:mainfrom
chengzeyi:feat/wavespeed-provider

Conversation

@chengzeyi

Copy link
Copy Markdown

Summary

Adds WaveSpeed AI as a hosting provider for image and video generation, using the existing schema-validated adapter (tools/schema_media.py) the same way wan_atlas_video and atlas_refresh_image do. Two small tools are added:

  • wavespeed_image (image_generation): Seedream 5.5 generate and multi-reference edit
  • wavespeed_video (video_generation): Wan 3.0 text-to-video and image-to-video with native audio

Both are found through the registry and need no selector changes. This is a smaller alternative to #245, scoped to the existing schema-driven adapter and two tools, so it can be reviewed and merged against current main on its own.

Related issue

Refs #245

Changes

  • tools/schema_media.py: wavespeed branch for submit (POST /api/v3/<model>), polling (GET /api/v3/predictions/<id>/result) and output extraction. Responses with a non-200 code are treated as errors even when the HTTP status is 200. Submissions are never retried, and a polling timeout returns resume_job as for the other schema-driven tools.
  • tools/provider_contracts/wavespeed_models.json: request schemas for the four routes, taken from WaveSpeed's model catalogue (GET /api/v3/models). Every payload is validated against them before submission.
  • tools/graphics/wavespeed_image.py, tools/video/wavespeed_video.py: provider wavespeed, env WAVESPEED_API_KEY.
  • No price estimates: preflight reports cost_status: quote_required and results carry cost_usd: null, as with the other schema-driven tools.
  • Docs: docs/PROVIDERS.md section and mapping row, README key and provider tables, .env.example.

Testing

  • make lint: passes
  • make test: 2934 passed, 17 skipped
  • New tests/tools/test_wavespeed_media.py (mocked HTTP, no network) covers contract and status behaviour, registry discovery, payloads for each route (local images sent as data URIs), schema rejection before submission, the full submit/poll/download path, resume without a second submission, error envelopes with HTTP 200, failed predictions, preflight cost not reported as free, and routing through image_selector and video_selector with hosting_provider: "wavespeed".
  • Manual: one live Seedream 5.5 text-to-image run through wavespeed_image.execute() produced the expected PNG. Video and edit routes were verified against the pinned schemas and mocked HTTP only.

Checklist

  • The change is focused on a single logical concern.
  • I ran the relevant tests locally (make test-contracts / make test) where applicable.
  • I updated docs/README if behavior or usage changed.
  • No unrelated files (build artifacts, local config) are included in the diff.

🤖 Generated with Claude Code

Adds two tools on the existing schema-validated adapter (tools/schema_media.py),
the same path used by wan_atlas_video and atlas_refresh_image:

- wavespeed_image (image_generation): Seedream 5.5 generate and edit
- wavespeed_video (video_generation): Wan 3.0 text-to-video and image-to-video

Both use provider "wavespeed" and WAVESPEED_API_KEY. Model input schemas are
pinned in tools/provider_contracts/wavespeed_models.json and every payload is
validated before submission. The adapter gains a wavespeed branch for submit
(POST /api/v3/<model>), polling (GET /api/v3/predictions/<id>/result) and
output extraction; WaveSpeed envelopes with a non-200 code are treated as
errors even when the HTTP status is 200. Submissions are never retried, and a
polling timeout returns resume_job like the other schema-driven tools. Prices
are not estimated: preflight reports quote_required and results carry
cost_usd null.

No selector changes; both tools are discovered through the registry.
Docs: PROVIDERS.md section and mapping row, README key and provider tables,
.env.example.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chengzeyi
chengzeyi requested a review from calesthio as a code owner November 22, 2026 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant