Skip to content

Conversation

@christian-byrne
Copy link
Collaborator

@christian-byrne christian-byrne commented Apr 11, 2025

Filter out non-images from the file selection list in LoadImage node, as there is starting to be more video and 3d model files in the input folder which can cause issues if accidentally selected (e.g., when using the arrow buttons on the combo widget).

LoadAudio node uses same filtering function for past 7 months (since #4054) without reported bugs:

files = folder_paths.filter_files_content_types(os.listdir(input_dir), ["audio", "video"])

@Symbiomatrix
Copy link

Symbiomatrix commented Apr 11, 2025

I propose that sorted(files) be moved to folder_paths.filter_files_content_types as with folder_paths.get_filename_list_ . Otherwise that still forces sort order in the node.
A bit of a personal annoyance that filter doesn't do recursive search like get filename (part of my sort is based on nesting), but that's probably not important for the average user.
Edit: I see filter simply selects files based on mimetype, so it can be combined with get_files, which handles the filesystem access, sorting, recursion etc, without any issue.

Don't forget about the LoadImageMask node too. Though I'm not sure if it accepts any special types.

@Symbiomatrix
Copy link

Question: Should a separate node perhaps be created for loading video? I don't know if loadimage supports automatic frame splitting (I always use VHS), but if it does then the filter will disable the vanilla ability to do that.

@comfyanonymous comfyanonymous merged commit 73ecb75 into comfyanonymous:master Apr 12, 2025
5 checks passed
@christian-byrne
Copy link
Collaborator Author

christian-byrne commented Apr 13, 2025

Question: Should a separate node perhaps be created for loading video? I don't know if loadimage supports automatic frame splitting (I always use VHS), but if it does then the filter will disable the vanilla ability to do that.

Yes, eventually we will have that. But currently we don't have nodes that take video input (only leaf nodes that output video), so there's no reason to have a loader for it. The frontend has already been changed to support video loader nodes once we have reason to add one.

@christian-byrne christian-byrne deleted the filter-images branch April 13, 2025 03:52
@Symbiomatrix
Copy link

Symbiomatrix commented Apr 13, 2025

Hum, odd; Don't hunyuan and wan fun have V2V, with native support?

@christian-byrne
Copy link
Collaborator Author

Hum, odd; Don't hunyuan and wan fun have V2V, with native support?

Not to my knowledge. How is V2V done natively at the moment? If there's a reason to add a LoadWEBM or LoadVideo node then I'd love to add it.

@Symbiomatrix
Copy link

Symbiomatrix commented Apr 13, 2025

Hum, odd; Don't hunyuan and wan fun have V2V, with native support?

Not to my knowledge. How is V2V done natively at the moment? If there's a reason to add a LoadWEBM or LoadVideo node then I'd love to add it.

Ah, I see what I did back in hun for V2V: It's set to load up a webp (genned in T2V) using native load image, resize image and vae tile encode to latent, then pass to a standard custom sampler. It's quite possible I never actually used an mp4 directly - apparently that yields "cannot identify image file" error as you say, so I couldn't have successfully. Though if there were such a video load node converting it to an image batch as VHS does, that could make the extension redundant for basic V2V (though tbf without ffmpeg's universal format support, it's not great).
A quick glance indicates the standard workflows on civ probably all use VHS for the load.

image

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.

3 participants