feat: add Pivoine custom ComfyUI nodes for DiffRhythm
All checks were successful
Build and Push RunPod Docker Image / build-and-push (push) Successful in 14s

Add custom node wrapper PivoineDiffRhythmRun that fixes tensor dimension
mismatch error by disabling chunked VAE decoding. The original DiffRhythm
node's overlap=32 parameter conflicts with the VAE's 64-channel architecture.

Changes:
- Add comfyui/nodes/pivoine_diffrhythm.py: Custom node wrapper
- Add comfyui/nodes/__init__.py: Package initialization
- Add arty.yml setup/pivoine-nodes: Deployment script for symlink
- Update all 4 DiffRhythm workflows to use PivoineDiffRhythmRun

Technical details:
- Inherits from DiffRhythmRun to avoid upstream patching
- Forces chunked=False in diffrhythmgen() override
- Requires more VRAM (~12-16GB) but RTX 4090 has 24GB
- Category: 🌸Pivoine/Audio for easy identification

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-24 16:28:54 +01:00
parent 073711c017
commit 5096e3ffb5
7 changed files with 121 additions and 4 deletions

20
comfyui/nodes/__init__.py Normal file
View File

@@ -0,0 +1,20 @@
"""
Pivoine Custom ComfyUI Nodes
Custom node extensions and wrappers for RunPod deployment
Author: valknar@pivoine.art
"""
from .pivoine_diffrhythm import NODE_CLASS_MAPPINGS as DIFFRHYTHM_MAPPINGS
from .pivoine_diffrhythm import NODE_DISPLAY_NAME_MAPPINGS as DIFFRHYTHM_DISPLAY
# Combine all node mappings
NODE_CLASS_MAPPINGS = {
**DIFFRHYTHM_MAPPINGS,
}
NODE_DISPLAY_NAME_MAPPINGS = {
**DIFFRHYTHM_DISPLAY,
}
__all__ = ['NODE_CLASS_MAPPINGS', 'NODE_DISPLAY_NAME_MAPPINGS']

View File

@@ -0,0 +1,69 @@
"""
Pivoine DiffRhythm Node
Custom wrapper for DiffRhythm that disables chunked decoding to prevent
tensor dimension mismatch errors (32 vs 64) in VAE overlap logic.
Author: valknar@pivoine.art
"""
import sys
sys.path.append('/workspace/ComfyUI/custom_nodes/ComfyUI_DiffRhythm')
from DiffRhythmNode import DiffRhythmRun
class PivoineDiffRhythmRun(DiffRhythmRun):
"""
Pivoine version of DiffRhythmRun with chunked decoding disabled.
Changes from original:
- chunked parameter defaults to False (was True)
- Prevents tensor dimension mismatch in VAE
- Requires more VRAM (~12-16GB) but works reliably on RTX 4090
"""
CATEGORY = "🌸Pivoine/Audio"
@classmethod
def INPUT_TYPES(cls):
return super().INPUT_TYPES()
def diffrhythmgen(
self,
edit,
model: str,
style_prompt: str = None,
lyrics_or_edit_lyrics: str = "",
style_audio_or_edit_song = None,
edit_segments: str = "",
chunked: bool = False, # Changed from True to False
odeint_method: str = "euler",
steps: int = 30,
cfg: int = 4,
quality_or_speed: str = "speed",
unload_model: bool = False,
seed: int = 0
):
# Force chunked=False to avoid dimension mismatch
return super().diffrhythmgen(
edit=edit,
model=model,
style_prompt=style_prompt,
lyrics_or_edit_lyrics=lyrics_or_edit_lyrics,
style_audio_or_edit_song=style_audio_or_edit_song,
edit_segments=edit_segments,
chunked=False,
odeint_method=odeint_method,
steps=steps,
cfg=cfg,
quality_or_speed=quality_or_speed,
unload_model=unload_model,
seed=seed
)
NODE_CLASS_MAPPINGS = {
"PivoineDiffRhythmRun": PivoineDiffRhythmRun,
}
NODE_DISPLAY_NAME_MAPPINGS = {
"PivoineDiffRhythmRun": "Pivoine DiffRhythm Run",
}

View File

@@ -4,7 +4,7 @@
"nodes": [
{
"id": 1,
"type": "DiffRhythmRun",
"type": "PivoineDiffRhythmRun",
"pos": [100, 100],
"size": [400, 400],
"flags": {},

View File

@@ -4,7 +4,7 @@
"nodes": [
{
"id": 1,
"type": "DiffRhythmRun",
"type": "PivoineDiffRhythmRun",
"pos": [100, 100],
"size": [400, 400],
"flags": {},

View File

@@ -27,7 +27,7 @@
},
{
"id": 2,
"type": "DiffRhythmRun",
"type": "PivoineDiffRhythmRun",
"pos": [500, 100],
"size": [400, 450],
"flags": {},

View File

@@ -4,7 +4,7 @@
"nodes": [
{
"id": 1,
"type": "DiffRhythmRun",
"type": "PivoineDiffRhythmRun",
"pos": [100, 100],
"size": [400, 400],
"flags": {},