fix: patch infer_utils.decode_audio instead of DiffRhythmNode.infer
All checks were successful
Build and Push RunPod Docker Image / build-and-push (push) Successful in 13s

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 <noreply@anthropic.com>
This commit is contained in:
2025-11-24 17:28:30 +01:00
parent 1981b7b256
commit 67d41c3923

View File

@@ -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