feat: prompt_influence on video_to_music and video_to_video_music (0.12.0 / cli 0.10.0) - #27
Merged
Merged
Conversation
…12.0 / cli 0.10.0)
Adds the API's new prompt_influence multipart field: a 0-1 float setting how
strongly the generated music follows the prompt (lower lets the video lead,
higher follows the prompt more literally). Free of charge; the API's own
default is 0.5.
Omitted-means-unchanged: the field is only sent when explicitly passed, with
an `is not None` check so an explicit 0.0 ("let the video lead entirely")
does go on the wire. Range checking is left to the API's 422, same as
variants_num.
Unlike the finalize-time options it is NOT async-only — the API takes it on
the video-to-music streaming path with no mode guard — so it lives in
build_v2m_parts (keyword-only, None default, per the shared-builder pattern)
and is exposed on stream()/generate() as well as submit()/generate_async().
video_to_video_music forwards it through build_v2v_music_parts. No other
endpoint accepts it, asserted on the public signatures.
sonilo-cli gains --prompt-influence on video-to-music and
video-to-video-music, and its core pin widens from >=0.11.0,<0.12 to
>=0.12.0,<0.13 to make the 0.12.0 core resolvable. Core sonilo
0.11.3 -> 0.12.0, sonilo-cli 0.9.0 -> 0.10.0. READMEs document the knob.
Sapient docs evalsWaiting for the staging docs URL before running evals. Sapient will start the selected PR evals automatically when GitHub reports a successful docs deployment for this PR. This usually happens within 15 minutes. Commit: |
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
Propagates the API's new
prompt_influenceparameter to the Python SDK and CLI, mirroring howkeep_original_soundwas propagated in #23.The parameter: an optional float, 0-1 inclusive, on
/v1/video-to-musicand/v1/video-to-video-musiconly. It sets how strongly the generated music follows the prompt (API default 0.5): lower values let the video lead; higher values follow the prompt more literally. Free of charge.Omit-means-unchanged contract: the multipart field is only emitted when explicitly passed, guarded with
is not None— never truthiness — so an explicit0.0("let the video lead entirely") goes on the wire while unset leaves the field off entirely and the API's own 0.5 default (the long-standing behavior) applies. Range checking is left to the API's 422, matching the existingvariants_numconvention.Not async-only: the API takes it on the video-to-music streaming path with no mode guard, so it lives in
build_v2m_parts(keyword-only, None default — the shared-builder pattern used foroutput_format/keep_original_sound) and is exposed onstream()/generate()as well assubmit()/generate_async(), sync and async clients alike.video_to_video_musicforwards it throughbuild_v2v_music_partsonsubmit()/generate(). No other endpoint exposes it — asserted on the public signatures.CLI:
--prompt-influenceonvideo-to-musicandvideo-to-video-music; on the former it rides the streaming default rather than forcing async.Versions
sonilo0.11.3 → 0.12.0sonilo-cli0.9.0 → 0.10.0, core pin widened>=0.11.0,<0.12→>=0.12.0,<0.13(the narrow pin would make the 0.12.0 core unresolvable otherwise)Tests
Run exactly as CI does (
pytest/pytest sonilo-video-kit/pytest sonilo-cli):tests/test_prompt_influence.py: omitted-when-None, sent when set, sent when 0.0, async-parts forwarding, signature presence/absence)🤖 Generated with Claude Code