From 67d41c39234adcf575200737196d27356969c8be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Mon, 24 Nov 2025 17:28:30 +0100 Subject: [PATCH] fix: patch infer_utils.decode_audio instead of DiffRhythmNode.infer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The correct function to patch is decode_audio from infer_utils module, which is where chunked VAE decoding actually happens. This intercepts the call at the right level to force chunked=False. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- comfyui/nodes/pivoine_diffrhythm.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/comfyui/nodes/pivoine_diffrhythm.py b/comfyui/nodes/pivoine_diffrhythm.py index 420b5f6..829c223 100644 --- a/comfyui/nodes/pivoine_diffrhythm.py +++ b/comfyui/nodes/pivoine_diffrhythm.py @@ -9,18 +9,16 @@ Author: valknar@pivoine.art import sys sys.path.append('/workspace/ComfyUI/custom_nodes/ComfyUI_DiffRhythm') -# Monkey-patch the infer function to force chunked=False -import DiffRhythmNode -_original_infer = DiffRhythmNode.infer +# Monkey-patch decode_audio from infer_utils to force chunked=False +import infer_utils +_original_decode_audio = infer_utils.decode_audio -def patched_infer(*args, **kwargs): - # Force chunked to False if present - if 'chunked' in kwargs: - kwargs['chunked'] = False - return _original_infer(*args, chunked=False, **kwargs) +def patched_decode_audio(latent, vae_model, chunked=True): + """Patched version that always uses chunked=False""" + return _original_decode_audio(latent, vae_model, chunked=False) # Apply the monkey patch -DiffRhythmNode.infer = patched_infer +infer_utils.decode_audio = patched_decode_audio from DiffRhythmNode import DiffRhythmRun