Skip to content

Fix: Error creating video when sliced audio tensor chunks are non-c-contiguous#7942

Merged
comfyanonymous merged 1 commit intoComfy-Org:masterfrom
christian-byrne:contiguous
May 5, 2025
Merged

Fix: Error creating video when sliced audio tensor chunks are non-c-contiguous#7942
comfyanonymous merged 1 commit intoComfy-Org:masterfrom
christian-byrne:contiguous

Conversation

@christian-byrne
Copy link
Contributor

@christian-byrne christian-byrne commented May 5, 2025

It's possible to create VIDEO Comfy type by combining AUDIO and IMAGE Comfy types (e.g., using core CreateVideo node). When this process happens, the audio is encoded from (tensor) chunks. A bug can occur if the slicing creates non-c-contiguous chunks, as av.AudioFrame.from_ndarray expects contiguous array. Fix by making contiguous explicitly before converting to numpy array.

To reproduce issue:

  1. Load and run this workflow
  2. Assets used: video, audio (LoadAudio node implicitly takes audio from video files)

After applying the fix, the workflow should work.

@comfyanonymous comfyanonymous merged commit 3e62c55 into Comfy-Org:master May 5, 2025
5 checks passed
@christian-byrne christian-byrne deleted the contiguous branch May 5, 2025 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants