mirror of
https://github.com/leejet/stable-diffusion.cpp.git
synced 2026-11-26 23:29:53 +00:00
fix: trim MiniMax-H3 audio to video duration (#2350)
This commit is contained in:
parent
6201bcc7ea
commit
394d2104fc
1 changed files with 3 additions and 3 deletions
|
|
@ -2287,12 +2287,12 @@ namespace sd::pipeline {
|
|||
if (frames_out != nullptr) {
|
||||
*frames_out = result;
|
||||
}
|
||||
if (sd->version == VERSION_WAN2_2_S2V && generated_audio != nullptr) {
|
||||
// Limit the driving track to the generated video's duration.
|
||||
if ((sd->version == VERSION_WAN2_2_S2V || sd_version_is_minimax_h3(sd->version)) && generated_audio != nullptr) {
|
||||
// Limit the audio track to the generated video's duration.
|
||||
int fps = request.fps;
|
||||
uint64_t video_frames = num_frames_out != nullptr ? (uint64_t)*num_frames_out : 0;
|
||||
uint64_t want_samples = (uint64_t)((double)video_frames / fps * generated_audio->sample_rate);
|
||||
LOG_DEBUG("s2v audio truncate: %llu samples -> %llu (video %llu frames @ %d fps)",
|
||||
LOG_DEBUG("output audio truncate: %llu samples -> %llu (video %llu frames @ %d fps)",
|
||||
(unsigned long long)generated_audio->sample_count,
|
||||
(unsigned long long)want_samples,
|
||||
(unsigned long long)video_frames,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue