Skip to content

[feat] sekotalk v2.5 通过命令行控制每段生成长度#983

Merged
helloyongyang merged 1 commit intomainfrom
dev/sekotalk2.5
Apr 2, 2026
Merged

[feat] sekotalk v2.5 通过命令行控制每段生成长度#983
helloyongyang merged 1 commit intomainfrom
dev/sekotalk2.5

Conversation

@wangshankun
Copy link
Copy Markdown
Collaborator

No description provided.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a target_video_length parameter to allow more granular control over generated clip lengths. Changes include adding a CLI argument, updating the S2VInputInfo and RS2VInputInfo structures, and modifying the wan_audio_runner to prioritize this value during audio segmentation. Feedback was provided to refactor the logic for retrieving the video length from input info to make it more concise and Pythonic.

Comment on lines +320 to +325
target_video_length = self.config.get("target_video_length", 81)
ii = getattr(self, "input_info", None)
if ii is not None and hasattr(ii, "target_video_length"):
tvl = ii.target_video_length
if tvl is not None and tvl is not UNSET and tvl > 0:
target_video_length = tvl
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

为了提高代码的简洁性和可读性,可以对这部分逻辑进行重构。目前的嵌套 if 语句有些冗长,可以将其简化为更紧凑、更符合 Python 风格的形式。

Suggested change
target_video_length = self.config.get("target_video_length", 81)
ii = getattr(self, "input_info", None)
if ii is not None and hasattr(ii, "target_video_length"):
tvl = ii.target_video_length
if tvl is not None and tvl is not UNSET and tvl > 0:
target_video_length = tvl
target_video_length = self.config.get("target_video_length", 81)
ii = getattr(self, "input_info", None)
if ii is not None:
tvl = getattr(ii, "target_video_length", None)
if tvl not in (None, UNSET) and tvl > 0:
target_video_length = tvl

@helloyongyang helloyongyang merged commit 2845e32 into main Apr 2, 2026
2 checks passed
@helloyongyang helloyongyang deleted the dev/sekotalk2.5 branch April 2, 2026 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants