From 56e8f5e4fd0a048811095f44d2147bce48b02457 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Mon, 16 Sep 2024 00:30:36 -0400 Subject: [PATCH] VAEDecodeAudio now does some normalization on the audio. --- comfy_extras/nodes_audio.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/comfy_extras/nodes_audio.py b/comfy_extras/nodes_audio.py index 6990b3f9..1c763f25 100644 --- a/comfy_extras/nodes_audio.py +++ b/comfy_extras/nodes_audio.py @@ -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}, )