Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add content-type filter method to folder_paths #4054

Merged

Conversation

christian-byrne
Copy link
Contributor

Video, audio, image files are all in input dir. I addeed folder_paths.filter_files_content_types() to filter files by mimetype. It lazily caches extension -> content-type mappings, so it can be used by other nodes efficiently. Then I changed LoadAudio to filter for audio and video files in input dir, instead of only allowing '.wav', '.mp3', '.ogg', '.flac', '.aiff', '.aif'. Better solution than #3941.

folder_paths.py Outdated Show resolved Hide resolved
@@ -0,0 +1,52 @@
import pytest
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding tests!

@huchenlei
Copy link
Collaborator

Hmmm, the github runner is not picking up the job

@huchenlei huchenlei added the Good PR This PR looks good to go, it needs comfy's final review. label Jul 19, 2024
@comfyanonymous comfyanonymous merged commit e760bf5 into comfyanonymous:master Sep 11, 2024
3 checks passed
@christian-byrne christian-byrne deleted the filter-audio-formats branch September 16, 2024 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good PR This PR looks good to go, it needs comfy's final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants