You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes#17055. Return an empty waveform before reshaping it during unequal-rate resampling. Existing argument and resampling-method validation still runs.
Tests
Before fix: focused regression test failed for both 44100→48000 and 48000→44100 Hz.
After fix: focused regression test passed (2 passed).
Ruff check passed for both changed files.
The change and tests were prepared with Codex assistance.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
IMPORTANT: Only comment on issues directly introduced by this PR's code changes.
⚙️ CodeRabbit configuration file
Files:
comfy/audio.py
tests-unit/comfy_test/audio_test.py
Source excerpt: Keep changes small and direct.
📄 CodeRabbit inference engine (AGENTS.md)
Files:
comfy/audio.py
tests-unit/comfy_test/audio_test.py
🔀 Multi-repo context Comfy-Org/ComfyUI_frontend
Linked repositories findings
Comfy-Org/ComfyUI_frontend
The frontend exposes AudioConcat, AudioMerge, EmptyAudio, and JoinAudioChannels as existing node contracts; this PR changes no node names, inputs, or outputs. [::Comfy-Org/ComfyUI_frontend::]
src/locales/en/nodeDefs.json:322,413,5100,9530
Browser synthesis tests use EmptyAudio as the standard AUDIO producer, confirming zero-duration audio is a supported frontend workflow. [::Comfy-Org/ComfyUI_frontend::]
browser_tests/fixtures/customNode/autoRun.ts:48
Comfy-Org/comfy-kitchen
No audio resampling, waveform, or affected-node implementation references were found, so this fix does not appear to require a comfy-kitchen coordination or ownership change.
🔇 Additional comments: 2
comfy/audio.py: 1
64-65: LGTM!
tests-unit/comfy_test/audio_test.py: 1
1-15: LGTM!
📝 Walkthrough
When the waveform’s last dimension is empty, resample now returns the input unchanged before constructing the resampling kernel. A parametrized test checks both 44.1 kHz-to-48 kHz and reverse conversions, including preservation of shape, dtype, and device.
Priority: ➖ Normal
Severity of issue fixed: Medium
Merge Risk:⚪ Minimal · up to 07677
Empty waveforms retain their dimensions and tensor properties during unequal-rate resampling, with input validation preserved. No actionable merge risk is evident.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files.
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Title check
The title clearly and concisely describes the main change: fixing resampling for zero-length audio.
Description check
The description directly explains the zero-length waveform fix, retained validation, linked issue, regression tests, and lint results.
Linked Issues check
Issue [#17055] requires unequal-rate resampling to preserve an empty waveform's time dimension, leading dimensions, dtype, and device, while retaining validation. comfy/audio.py now returns `wavefor…
Out of Scope Changes check
The pull request changes only resample and adds a focused regression test for issue [#17055]. Both changes directly support the linked issue. No unrelated production behavior or unrelated files are …
Fix all pre-merge checks with AI
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #17055. Return an empty waveform before reshaping it during unequal-rate resampling. Existing argument and resampling-method validation still runs.
Tests
The change and tests were prepared with Codex assistance.