Comfy-Org/ComfyUI · warning · ValueError

Total storyboard duration ({duration}s) must be between 3 an

Error message

Total storyboard duration ({duration}s) must be between 3 and 15 seconds.

What it means

Client-side validation error raised in the Kling video node when custom multi-shot storyboard mode is enabled: the summed per-shot durations must total 3–15 seconds. It is thrown before any network call, so it costs no credits.

Source

Thrown at comfy_api_nodes/nodes_kling.py:2446

        multi_prompt_list = None
        if shot_type == "customize":
            count = int(multi_shot["multi_shot"].split()[0])
            multi_prompt_list = []
            for i in range(1, count + 1):
                sb_prompt = multi_shot[f"storyboard_{i}_prompt"]
                sb_duration = multi_shot[f"storyboard_{i}_duration"]
                validate_string(sb_prompt, field_name=f"storyboard_{i}_prompt", min_length=1, max_length=512)
                multi_prompt_list.append(
                    MultiPromptEntry(
                        index=i,
                        prompt=sb_prompt,
                        duration=str(sb_duration),
                    )
                )
            duration = sum(int(e.duration) for e in multi_prompt_list)
            if duration < 3 or duration > 15:
                raise ValueError(
                    f"Total storyboard duration ({duration}s) must be between 3 and 15 seconds."
                )
        else:
            duration = multi_shot["duration"]
            validate_string(multi_shot["prompt"], min_length=1, max_length=2500)

        if model["model"] == "kling-3.0-turbo":
            turbo_prompt = build_turbo_shot_prompt(multi_prompt_list) if custom_multi_shot else multi_shot["prompt"]
            return await execute_kling_turbo(
                cls,
                prompt=turbo_prompt,
                resolution=model["resolution"],
                aspect_ratio=model["aspect_ratio"],
                duration=duration,
                start_frame=start_frame,
            )

        if start_frame is not None:

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. Adjust the storyboard_N_duration widgets so they sum to 3–15 seconds (e.g. 3 shots x 5s = 15s).
  2. Count the number of active storyboard_N_prompt/duration pairs — every prompt with content contributes a shot to the sum.
  3. If using kling-3.0-turbo, remember build_turbo_shot_prompt embeds these same durations, so the same total applies to the rendered prompt.

Example fix

// before: shots of 1s + 1s -> total 2s, raises
// after: shots of 2s + 3s -> total 5s, passes
multi_shot = {
    "storyboard_1_duration": 2,
    "storyboard_2_duration": 3,
    ...
}
Defensive patterns

Strategy: validation

Validate before calling

total = sum(int(d) for d in storyboard_durations)
if not 3 <= total <= 15:
    raise ValueError(f"Storyboard total {total}s outside 3-15s; adjust shot durations")

Prevention

When it happens

Trigger: Custom multi-shot enabled with storyboard_N_duration widgets whose sum (parsed as int) is < 3 or > 15; e.g. two shots of 1s (total 2s) or four shots of 5s (total 20s). Non-integer widget values are coerced via int() and can sum unexpectedly.

Common situations: User adds/removes storyboard shots and forgets to rebalance durations; duration widgets fed by workflow logic produce fractional values that truncate; mixing shot counts across model versions with different totals.

Related errors


AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14). Data as JSON: /api/errors/6a147ecb453f9045. Report an issue: GitHub.