Skip to content

Add a Novita provider backend - #7

Open
jax-novita wants to merge 5 commits into
Alisa0808:mainfrom
jax-novita:add-novita-provider
Open

Add a Novita provider backend#7
jax-novita wants to merge 5 commits into
Alisa0808:mainfrom
jax-novita:add-novita-provider

Conversation

@jax-novita

Copy link
Copy Markdown

Summary

Adds Novita as a second pluggable media backend alongside Atlas Cloud. scripts/provider.py already abstracts every media call behind a Provider ABC + registry; this adds NovitaProvider and a matching client, scripts/novita_cloud.py, following the same shape as atlas_cloud.py.

Changes

  • scripts/novita_cloud.py (new) — client for Novita's /v3 API: submit_image (txt2img), submit_video (img2video), submit_audio (narration via MiniMax's async TTS endpoint, plus music via the synchronous MiniMax Music endpoint), remove_bg, get_status, upload/download.
  • scripts/provider.py — adds NovitaProvider + a "novita" registry entry. Select it per project via beats.json's {"provider": "novita"}.
  • SKILL.md / SKILL.zh.md — one line each noting the new backend and its two scoped-down calls.

Two gaps are left explicit rather than guessed at, since Novita's API doesn't line up 1:1 with Atlas Cloud's:

  • submit_video only covers the generic image-driven img2video model family (no text prompt) — the prompt-steered flagship video models (Kling/Seedance/Gemini-video equivalents) live behind separate per-model endpoints not wired up here.
  • submit_audio narration uses MiniMax's documented async TTS route (voice_id from MiniMax's System Voices catalog, not Atlas Cloud's). Music generation uses Novita's synchronous MiniMax Music endpoint, given a longer request timeout since a full-song render routinely exceeds the client's default 60s socket timeout.

Both scoped-down paths raise clearly instead of silently mismapping fields.

Verification

  • python3 -m py_compile scripts/audio.py scripts/novita_cloud.py scripts/provider.py — passes.
  • Live authenticated catalog request — HTTP 200, 307 models.
  • End-to-end against the live Novita API: image generation (NovitaProvider, sd_xl_base_1.0.safetensors) — completed, output present; narration TTS (Deep_Voice_Man voice) — completed, output present; default BGM path (MiniMax Music, synchronous) — completed, output present.
  • Repo has no test suite (package.json has no test script, no pytest/jest directories) — no unit tests to run.

scripts/provider.py already abstracts every media call behind a Provider
ABC + registry (AtlasCloudProvider is the only entry). This adds
NovitaProvider + scripts/novita_cloud.py, a client for Novita's /v3
async task_id -> poll pattern (txt2img, img2video, txt2speech,
remove-background), following the same shape as atlas_cloud.py.

Two gaps are left explicit rather than guessed at, since Novita's API
doesn't line up 1:1 with Atlas Cloud's: submit_video only covers the
generic image-driven img2video model family (no text prompt -- the
prompt-steered flagship video models live behind separate per-model
endpoints not wired up here), and submit_audio covers narration only
(Novita's music-generation endpoint has a different, unverified request
shape). Both raise clearly instead of silently mismapping fields.

Docs: one line each in SKILL.md/SKILL.zh.md noting the new backend and
its two scoped-down calls.
… Music BGM

- Every Novita request now sends a real User-Agent (WAF was returning 403
  before requests were even inspected).
- submit_image now wraps the body in a top-level "request" key, matching
  Novita's documented txt2img schema and the official python-sdk's
  CommonV3Request -- posting the fields flat produced 400 INVALID_REQUEST_BODY.
- submit_audio now supports music (prompt=..., is_instrumental=...) via
  Novita's synchronous MiniMax Music endpoint (/minimax-music), wrapped
  behind a synthetic sync job id like remove_bg already does, so audio.py's
  BGM stage has a supported path instead of always raising.
…fault

leo (Atlas Cloud's xai/tts-v1 default) 400s on Novita's txt2speech
(voice_id: leo not supports) -- different engines, unrelated voice
catalogs. Novita's engine is MiniMax's, so give it a MiniMax System
Voice as its own default instead of overriding the Atlas default.
Both prior QA rounds failed on the same guessed, nonexistent route --
changing the voice_id value couldn't fix a wrong endpoint. Switch to
Novita's actual documented async TTS route, MiniMax's
/async/minimax-speech-2.8-hd, whose schema nests voice_id under
voice_setting rather than taking it flat.
Novita's own error-handling docs say client/proxy timeouts must exceed
60s for exactly this kind of long synchronous render; the module's
default _post timeout of 60s was cutting the request off before
MiniMax Music could return the audio URL.
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