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
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:
@@ -9,18 +9,16 @@ Author: valknar@pivoine.art
|
|||||||
import sys
|
import sys
|
||||||
sys.path.append('/workspace/ComfyUI/custom_nodes/ComfyUI_DiffRhythm')
|
sys.path.append('/workspace/ComfyUI/custom_nodes/ComfyUI_DiffRhythm')
|
||||||
|
|
||||||
# Monkey-patch the infer function to force chunked=False
|
# Monkey-patch decode_audio from infer_utils to force chunked=False
|
||||||
import DiffRhythmNode
|
import infer_utils
|
||||||
_original_infer = DiffRhythmNode.infer
|
_original_decode_audio = infer_utils.decode_audio
|
||||||
|
|
||||||
def patched_infer(*args, **kwargs):
|
def patched_decode_audio(latent, vae_model, chunked=True):
|
||||||
# Force chunked to False if present
|
"""Patched version that always uses chunked=False"""
|
||||||
if 'chunked' in kwargs:
|
return _original_decode_audio(latent, vae_model, chunked=False)
|
||||||
kwargs['chunked'] = False
|
|
||||||
return _original_infer(*args, chunked=False, **kwargs)
|
|
||||||
|
|
||||||
# Apply the monkey patch
|
# Apply the monkey patch
|
||||||
DiffRhythmNode.infer = patched_infer
|
infer_utils.decode_audio = patched_decode_audio
|
||||||
|
|
||||||
from DiffRhythmNode import DiffRhythmRun
|
from DiffRhythmNode import DiffRhythmRun
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user