Match Comfy BF16 audio carry input

This commit is contained in:
Daniel Maddern 2026-08-13 21:47:02 +07:00
parent 3e56fbc32c
commit c4d64d0d72

View file

@ -61,13 +61,13 @@ def sample_video_res_multistep(model, packer: H3PromptPacker, text: torch.Tensor
previous_index = index - 1
sigma_down = sigmas[index]
sigma_audio = _audio_sigma(sigma)
native_audio = audio_carried * (sigma_audio / sigma)
carry = sigma_audio / sigma
native_audio = audio_carried.to(torch.bfloat16) * carry
hidden, times, segments, positions, video_segment, audio_segment = packer(text, video, native_audio, float(sigma))
raw_video, raw_audio = model(hidden, times, positions, segments, video_segment, audio_segment)
raw_video = raw_video.to(torch.bfloat16).float()
raw_audio = raw_audio.to(torch.bfloat16)
velocity_video = -unpatchify_video(raw_video, video.shape[2], video.shape[-2], video.shape[-1])
carry = sigma_audio / sigma
velocity_audio = (
(1.0 - 4.0) * (audio_carried.to(torch.bfloat16) * carry.to(torch.bfloat16))
+ (1.0 + 3.0 * sigma_audio).to(torch.bfloat16) * (-_unpack_audio(raw_audio))