Add a Novita provider backend - #7
Open
jax-novita wants to merge 5 commits into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Novita as a second pluggable media backend alongside Atlas Cloud.
scripts/provider.pyalready abstracts every media call behind aProviderABC + registry; this addsNovitaProviderand a matching client,scripts/novita_cloud.py, following the same shape asatlas_cloud.py.Changes
scripts/novita_cloud.py(new) — client for Novita's/v3API: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— addsNovitaProvider+ a"novita"registry entry. Select it per project viabeats.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_videoonly covers the generic image-drivenimg2videomodel 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_audionarration uses MiniMax's documented async TTS route (voice_idfrom 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.NovitaProvider,sd_xl_base_1.0.safetensors) — completed, output present; narration TTS (Deep_Voice_Manvoice) — completed, output present; default BGM path (MiniMax Music, synchronous) — completed, output present.package.jsonhas no test script, no pytest/jest directories) — no unit tests to run.