Skip to content

feat(video): Seedance reference media and output controls, guarded per model and rail (supersedes #70) - #80

Merged
VickyXAI merged 5 commits into
mainfrom
fix/seedance-reference-media
Oct 2, 2026
Merged

VickyXAI merged 5 commits into
mainfrom
fix/seedance-reference-media

Conversation

@VickyXAI

@VickyXAI VickyXAI commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Supersedes #70 by @KillerQueen-Z. Their commit is cherry-picked onto current main with authorship kept. #70's branch carried 253 rewritten copies of main's commits and conflicted with main.

What #70 adds (kept)

  • reference_videos and reference_audios on VideoClient.generate and SolanaLLMClient.video (sync and async).
  • Up to 30 reference images on seedance-2.5.
  • bitrate_mode, output_format, camera_fixed, safety_identifier.
  • VideoClip.last_frame_url / last_frame_backed_up.

What review found, and the fixes

  1. P0 (on main already; feat(video): expose Seedance reference media and output controls #70 routed reference users into it): Solana account rail bills, then crashes.
    • With a brk_ key, _request_image_with_payment's first POST is the billed submit. Its 202 {id, poll_url} stub was returned as the result, so VideoResponse raised after the charge, with no job id.
    • A 502/503 replayed the billed POST.
    • The job is now polled unsigned to completion. 5xx is not replayed. A timeout says the account was billed and carries poll_url.
    • Both sync and async are fixed. The new tests fail on main and pass here.
  2. P1: reference media was advertised on every rail.
    • Both wallet gateways 400 every reference_* field before quoting (blockrun#728, blockrun-sol#374).
    • It is now refused locally with a pointer to BLOCKRUN_API_KEY.
  3. P1: no per-model guards.
    • A shared validate_video_request (validation.py) mirrors the MCP's table in src/tools/video.ts. It replaces the two duplicated validator blocks.
    • It refuses clips on 2.5, reference images on 1.5-pro, Grok and Sora, and audio-only references.
    • It refuses output_format off 2.5, bitrate_mode off 2.x, camera_fixed off 1.5-pro, and seedance-2.5 last frame on the Solana wallet gateway (MCP 0.53.1 parity).
    • It refuses clip dicts with extra keys and non-http(s) reference images.
    • On the account rail there is no quote step, so this check is the only gate before a charge.
  4. P1: reference-clip billing was not documented.
    • Each clip bills at the 15.2s reference ceiling (blockrun#730).
    • This is now documented on the kwargs and in docs/seedance-capabilities.md.
  5. P2: the root SEEDANCE_CAPABILITIES.md described gateway and MCP internals and claimed parity the SDK does not have. It is replaced by an SDK-scoped doc. A CHANGELOG entry is added under Unreleased.

Behaviour change to note

reference_image_urls on a wallet client now raises ValueError locally. Before, the SDK forwarded it and the gateway refused it with a 400. Either way it did not work; it now fails before any request.

Verification

  • pytest tests/unit: 1016 passed. Offline only, with an isolated HOME and mock transports.
  • black --check . and ruff check . are clean.
  • Nothing hits the gateway.

🤖 Generated with Claude Code

KillerQueen-Z and others added 3 commits October 2, 2026 16:48
…l account-rail jobs on Solana

- One shared validate_video_request (validation.py) replaces the copies in
  VideoClient.generate and SolanaLLMClient._build_video_body. It mirrors the
  MCP's capability table. It refuses reference media on the wallet rails
  (both gateways 400 before quoting), clips on 2.5, reference images on
  models without them, audio-only references, and Seedance-only controls on
  the wrong model. It also refuses seedance-2.5 last frame on the Solana
  wallet gateway (MCP 0.53.1 parity), clip dicts with extra keys, and
  non-http(s) reference images. Empty reference lists are omitted
  consistently.
- SolanaLLMClient / AsyncSolanaLLMClient media on the account rail: the
  first POST is the billed submit, and its 202 stub used to be returned as
  the result. VideoResponse then raised after the charge. The job is now
  polled unsigned to completion. 502/503 is not replayed (a replay could
  bill twice). A timeout says the account was billed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… billing, changelog

Replaces the root SEEDANCE_CAPABILITIES.md, which described gateway and MCP
internals and claimed parity this SDK does not have (2.5 last frame on
Solana, reference media on every rail). The new doc lives in docs/ and
covers only what the SDK accepts.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1bcMax added 2 commits October 2, 2026 22:22
….5 reference clips

- VideoClient and the shared jobs.py poller returned an absolute poll_url
  before resolve_poll_url could pin it, so a response naming another host
  received the API key. Every poll URL now goes through the pin; a refusal
  raises PollOriginRefusedError (APIError + ValueError) with id and poll_url.
  Solana account-rail polling uses the same helper.
- Solana music/speech/sound_effect with an API key route through the media
  helper: no 5xx replay of the billed submit, a 202 job is polled unsigned to
  completion. Wallet rail unchanged. Sync and async.
- seedance-2.5 accepts reference_videos/reference_audios (gateway
  supportsReferenceMedia, 30.2s per-clip ceiling); bitrate_mode models
  unchanged. Docs state the ceiling per model.
@VickyXAI
VickyXAI merged commit 90ae5fd into main Oct 2, 2026
6 checks passed
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.

2 participants