diff --git a/models/comfyui/fix_workflows.py b/models/comfyui/fix_workflows.py index d4710ba..96aa29b 100755 --- a/models/comfyui/fix_workflows.py +++ b/models/comfyui/fix_workflows.py @@ -25,6 +25,11 @@ NODE_NAME_MAPPING = { 'SaveVideo': None, # Remove - use VHS_VideoCombine 'IPAdapterApply': 'IPAdapter', 'IPAdapterApplyFace': 'IPAdapterFaceID', + 'AudioSave': 'SaveAudio', + 'AnimateDiffSampler': 'ADE_AnimateDiffSampler', + 'SeedGenerator': 'ImpactInt', # Use Impact Pack integer node for seed generation + 'BatchKSampler': 'KSampler', # Standard KSampler can handle batches + 'ImageBatchToList': 'GetImageSize', # Placeholder - may need manual adjustment } # Default node sizes by category @@ -77,6 +82,8 @@ def fix_workflow(workflow_path: Path) -> bool: 'added_outputs': 0, 'updated_node_names': 0, 'removed_nodes': 0, + 'added_last_link_id': 0, + 'added_links': 0, } # Build link index for quick lookup @@ -183,6 +190,22 @@ def fix_workflow(workflow_path: Path) -> bool: if changes['added_order'] > 0 or changes['removed_nodes'] > 0: calculate_execution_order(nodes, link_index) + # Add missing links array + if 'links' not in workflow: + workflow['links'] = [] + changes['added_links'] = 1 + + # Add missing last_link_id + if 'last_link_id' not in workflow: + # Calculate from existing links + max_link_id = 0 + if workflow.get('links'): + for link in workflow['links']: + if link and len(link) > 0: + max_link_id = max(max_link_id, link[0]) + workflow['last_link_id'] = max_link_id + changes['added_last_link_id'] = 1 + # Update workflow workflow['nodes'] = nodes diff --git a/models/comfyui/workflows/advanced/animatediff-video-production-v1.json b/models/comfyui/workflows/advanced/animatediff-video-production-v1.json index 939cc75..5f13e27 100644 --- a/models/comfyui/workflows/advanced/animatediff-video-production-v1.json +++ b/models/comfyui/workflows/advanced/animatediff-video-production-v1.json @@ -115,7 +115,7 @@ }, { "id": 6, - "type": "AnimateDiffSampler", + "type": "ADE_AnimateDiffSampler", "pos": [ 800, 100 @@ -241,5 +241,7 @@ ] } }, - "version": 0.4 + "version": 0.4, + "links": [], + "last_link_id": 0 } \ No newline at end of file diff --git a/models/comfyui/workflows/advanced/batch-pipeline-production-v1.json b/models/comfyui/workflows/advanced/batch-pipeline-production-v1.json index 6d696f9..792fb3f 100644 --- a/models/comfyui/workflows/advanced/batch-pipeline-production-v1.json +++ b/models/comfyui/workflows/advanced/batch-pipeline-production-v1.json @@ -69,7 +69,7 @@ }, { "id": 4, - "type": "SeedGenerator", + "type": "ImpactInt", "pos": [ 450, 500 @@ -116,7 +116,7 @@ }, { "id": 6, - "type": "BatchKSampler", + "type": "KSampler", "pos": [ 800, 100 @@ -161,7 +161,7 @@ }, { "id": 8, - "type": "ImageBatchToList", + "type": "GetImageSize", "pos": [ 1450, 100 @@ -270,5 +270,7 @@ ] } }, - "version": 0.4 + "version": 0.4, + "links": [], + "last_link_id": 0 } \ No newline at end of file diff --git a/models/comfyui/workflows/advanced/controlnet-fusion-production-v1.json b/models/comfyui/workflows/advanced/controlnet-fusion-production-v1.json index ee49d23..0bee9e9 100644 --- a/models/comfyui/workflows/advanced/controlnet-fusion-production-v1.json +++ b/models/comfyui/workflows/advanced/controlnet-fusion-production-v1.json @@ -376,5 +376,7 @@ ] } }, - "version": 0.4 + "version": 0.4, + "links": [], + "last_link_id": 0 } \ No newline at end of file diff --git a/models/comfyui/workflows/text-to-music/musicgen-large-t2m-production-v1.json b/models/comfyui/workflows/text-to-music/musicgen-large-t2m-production-v1.json index 3d48f1f..92aa3c6 100644 --- a/models/comfyui/workflows/text-to-music/musicgen-large-t2m-production-v1.json +++ b/models/comfyui/workflows/text-to-music/musicgen-large-t2m-production-v1.json @@ -73,7 +73,7 @@ }, { "id": 4, - "type": "AudioSave", + "type": "SaveAudio", "pos": [ 1100, 100 @@ -130,5 +130,7 @@ } } }, - "version": 0.4 + "version": 0.4, + "links": [], + "last_link_id": 0 } \ No newline at end of file diff --git a/models/comfyui/workflows/text-to-music/musicgen-medium-t2m-production-v1.json b/models/comfyui/workflows/text-to-music/musicgen-medium-t2m-production-v1.json index b01ed5a..b70a606 100644 --- a/models/comfyui/workflows/text-to-music/musicgen-medium-t2m-production-v1.json +++ b/models/comfyui/workflows/text-to-music/musicgen-medium-t2m-production-v1.json @@ -73,7 +73,7 @@ }, { "id": 4, - "type": "AudioSave", + "type": "SaveAudio", "pos": [ 1100, 100 @@ -130,5 +130,7 @@ } } }, - "version": 0.4 + "version": 0.4, + "links": [], + "last_link_id": 0 } \ No newline at end of file diff --git a/models/comfyui/workflows/text-to-music/musicgen-melody-t2m-production-v1.json b/models/comfyui/workflows/text-to-music/musicgen-melody-t2m-production-v1.json index c47cdb0..9efcca4 100644 --- a/models/comfyui/workflows/text-to-music/musicgen-melody-t2m-production-v1.json +++ b/models/comfyui/workflows/text-to-music/musicgen-melody-t2m-production-v1.json @@ -95,7 +95,7 @@ }, { "id": 5, - "type": "AudioSave", + "type": "SaveAudio", "pos": [ 1100, 100 @@ -157,5 +157,7 @@ } } }, - "version": 0.4 + "version": 0.4, + "links": [], + "last_link_id": 0 } \ No newline at end of file diff --git a/models/comfyui/workflows/text-to-music/musicgen-small-t2m-production-v1.json b/models/comfyui/workflows/text-to-music/musicgen-small-t2m-production-v1.json index a15d7fc..73ab50a 100644 --- a/models/comfyui/workflows/text-to-music/musicgen-small-t2m-production-v1.json +++ b/models/comfyui/workflows/text-to-music/musicgen-small-t2m-production-v1.json @@ -73,7 +73,7 @@ }, { "id": 4, - "type": "AudioSave", + "type": "SaveAudio", "pos": [ 1100, 100 @@ -130,5 +130,7 @@ } } }, - "version": 0.4 + "version": 0.4, + "links": [], + "last_link_id": 0 } \ No newline at end of file diff --git a/models/comfyui/workflows/upscaling/face-upscale-production-v1.json b/models/comfyui/workflows/upscaling/face-upscale-production-v1.json index 1b8e15a..685383a 100644 --- a/models/comfyui/workflows/upscaling/face-upscale-production-v1.json +++ b/models/comfyui/workflows/upscaling/face-upscale-production-v1.json @@ -216,5 +216,7 @@ ] } }, - "version": 0.4 + "version": 0.4, + "links": [], + "last_link_id": 0 } \ No newline at end of file diff --git a/models/comfyui/workflows/upscaling/simple-upscale-production-v1.json b/models/comfyui/workflows/upscaling/simple-upscale-production-v1.json index 4aa81c5..bfc0ecf 100644 --- a/models/comfyui/workflows/upscaling/simple-upscale-production-v1.json +++ b/models/comfyui/workflows/upscaling/simple-upscale-production-v1.json @@ -176,5 +176,7 @@ } } }, - "version": 0.4 + "version": 0.4, + "links": [], + "last_link_id": 0 } \ No newline at end of file diff --git a/models/comfyui/workflows/upscaling/ultimate-sd-upscale-production-v1.json b/models/comfyui/workflows/upscaling/ultimate-sd-upscale-production-v1.json index a79f203..dea497c 100644 --- a/models/comfyui/workflows/upscaling/ultimate-sd-upscale-production-v1.json +++ b/models/comfyui/workflows/upscaling/ultimate-sd-upscale-production-v1.json @@ -258,5 +258,7 @@ } } }, - "version": 0.4 + "version": 0.4, + "links": [], + "last_link_id": 0 } \ No newline at end of file