-
Notifications
You must be signed in to change notification settings - Fork 59
Description
Description
Passing generate_audio=False to video_generate has no effect. Seedance 1.5 Pro always generates audio regardless of the value set, because the parameter is silently converted to None and then omitted from the API request body.
veadk-python version
0.5.27
Steps to Reproduce
Minimal reproduction repo: https://github.com/windrichie/byteplus-agentkit-samples/tree/debug/video_generate_debug
The reproduction script calls through veadk's actual internal functions (_parse_item_to_config → _should_disable_audio → _build_request_body → _create_video_task → _get_task_status) to demonstrate the bug end-to-end.
params = {
"video_name": "test.mp4",
"prompt": "A pair of blue shoes rotating on a white surface.",
"ratio": "9:16",
"duration": 5,
"resolution": "720p",
"generate_audio": False, # explicitly set to False
}
config = _parse_item_to_config(params)
# config.generate_audio = False ✓ correctly parsed
body = _build_request_body(params["prompt"], config, "seedance-1-5-pro-251215")
# "generate_audio" not in body ← BUG: field is absentThe resulting video has audio despite generate_audio=False.
Root Cause
In veadk/tools/builtin_tools/video_generate.py, _should_disable_audio() converts False to None:
# line 133
def _should_disable_audio(model_name, generate_audio):
if generate_audio is False:
return None # ← returns None instead of False
...Then in _build_request_body():
# line 175
generate_audio = _should_disable_audio(model_name, config.generate_audio)
if generate_audio is not None: # None → field is skipped
body["generate_audio"] = generate_audioSince Seedance 1.5 Pro generates audio by default when the field is absent, the three states collapse:
| Value passed | _should_disable_audio returns |
Field in request body | Audio generated? |
|---|---|---|---|
True |
True |
"generate_audio": true |
Yes |
False |
None ← bug |
field absent | Yes (unexpected) |
None (not set) |
None |
field absent | Yes (expected default) |
Expected Behaviour
When generate_audio=False is passed, the request body should contain "generate_audio": false, and the generated video should have no audio track.
Proposed Fix
One-line change in _should_disable_audio:
def _should_disable_audio(model_name, generate_audio):
if generate_audio is False:
- return None
+ return False
...