Skip to content

[enhancement]: Add video duration in seconds with automatic frame count calculation #9576

Description

@jimmybrancaccio

What should this feature add?

Add a Duration (seconds) field to the video generation workflow forms, including the built-in Wan 2.2 Image-to-Video Lightning workflow. Calculate a supported frame count automatically from the requested duration and FPS.

Currently, the workflow exposes Frames and FPS. To request a six-second clip at 16 FPS, users need to calculate the frame count themselves and account for Wan's supported frame counts (4n + 1), resulting in 97 frames. A duration field would make this much easier to understand.

Suggested behavior

  • Let users enter the desired duration in seconds, such as 6 or 10.
  • Convert the duration and FPS to the nearest frame count supported by the selected model, respecting its limits.
  • Show the resulting frame count and actual duration when rounding is required.
  • Keep Frames available as an advanced control for users who need it.
  • Keep duration and frame count consistent when FPS changes.

For example, entering 6 seconds at 16 FPS in a Wan workflow could select 97 frames and display approximately 6.06 seconds.

Alternatives

A calculated duration readout beside Frames would help, but entering seconds directly would be more intuitive.

Additional context

Using InvokeAI 6.14.0 and the built-in Image to Video - Wan 2.2 Lightning workflow.

I searched open and closed issues for duration, video length, frames, and Wan. #8903 mentions duration for an API-driven remote video generation node; this request is for duration controls in local video workflow forms.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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