Skip to content

Commit

Permalink
VAEDecodeAudio now does some normalization on the audio.
Browse files Browse the repository at this point in the history
  • Loading branch information
comfyanonymous committed Sep 16, 2024
1 parent e813abb commit 56e8f5e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions comfy_extras/nodes_audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ def INPUT_TYPES(s):

def decode(self, vae, samples):
audio = vae.decode(samples["samples"]).movedim(-1, 1)
std = torch.std(audio, dim=[1,2], keepdim=True) * 5.0
std[std < 1.0] = 1.0
audio /= std
return ({"waveform": audio, "sample_rate": 44100}, )


Expand Down

0 comments on commit 56e8f5e

Please sign in to comment.