Match Comfy BF16 audio carry input
This commit is contained in:
parent
3e56fbc32c
commit
c4d64d0d72
1 changed files with 2 additions and 2 deletions
|
|
@ -61,13 +61,13 @@ def sample_video_res_multistep(model, packer: H3PromptPacker, text: torch.Tensor
|
||||||
previous_index = index - 1
|
previous_index = index - 1
|
||||||
sigma_down = sigmas[index]
|
sigma_down = sigmas[index]
|
||||||
sigma_audio = _audio_sigma(sigma)
|
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))
|
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_audio = model(hidden, times, positions, segments, video_segment, audio_segment)
|
||||||
raw_video = raw_video.to(torch.bfloat16).float()
|
raw_video = raw_video.to(torch.bfloat16).float()
|
||||||
raw_audio = raw_audio.to(torch.bfloat16)
|
raw_audio = raw_audio.to(torch.bfloat16)
|
||||||
velocity_video = -unpatchify_video(raw_video, video.shape[2], video.shape[-2], video.shape[-1])
|
velocity_video = -unpatchify_video(raw_video, video.shape[2], video.shape[-2], video.shape[-1])
|
||||||
carry = sigma_audio / sigma
|
|
||||||
velocity_audio = (
|
velocity_audio = (
|
||||||
(1.0 - 4.0) * (audio_carried.to(torch.bfloat16) * carry.to(torch.bfloat16))
|
(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))
|
+ (1.0 + 3.0 * sigma_audio).to(torch.bfloat16) * (-_unpack_audio(raw_audio))
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue