Match Comfy sampler BF16 output boundary
This commit is contained in:
parent
1e6a65489a
commit
a2c49ad93b
2 changed files with 3 additions and 1 deletions
|
|
@ -64,6 +64,8 @@ def sample_video_res_multistep(model, packer: H3PromptPacker, text: torch.Tensor
|
|||
native_audio = audio_carried * (sigma_audio / 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_video.to(torch.bfloat16).float()
|
||||
raw_audio = raw_audio.to(torch.bfloat16).float()
|
||||
velocity_video = -unpatchify_video(raw_video, video.shape[2], video.shape[-2], video.shape[-1])
|
||||
velocity_audio_native = -_unpack_audio(raw_audio)
|
||||
carry = sigma_audio / sigma
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ for index, reference in enumerate(steps):
|
|||
|
||||
state_video = reference["x"].to("cuda").reshape(-1)[:video_count].reshape(video_shape)
|
||||
reference_denoised = reference["denoised"].to("cuda").reshape(-1)[:video_count].reshape(video_shape)
|
||||
converted_denoised = state_video + sigmas[index] * h3_output["video"].to("cuda")
|
||||
converted_denoised = state_video + sigmas[index] * h3_output["video"].to("cuda").to(torch.bfloat16).float()
|
||||
denoised_delta = (converted_denoised.float() - reference_denoised.float()).abs()
|
||||
|
||||
if index + 1 < len(steps):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue