Skip to content

video_generate silently drops generate_audio=False from API request body #540

@windrichie

Description

@windrichie

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 absent

The 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_audio

Since 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
     ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions