-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
fix: 🐛 limit loadImage dropdown to supported formats #4148
Conversation
1e198f2
to
f1a1659
Compare
Perhaps testing for all those formats. Just because it says it supports it, doesnt mean it loads. I have tried PSD - fail I say this because the filter for loading an image into the LoadImage node has restricted filters for the types supported, which is really only jpg, png and webp, so I am unsure it can actually handle loading all those. IT SHOULD but does not seem to be the case. |
What do you mean by fail? That the preview doesn't update? Because this PR is only limiting what is shown in the list of LoadImage. And PIL should load all these but probably don't return the same things, I know that PSD for one is not simple a PIL.Image but a more scoped type |
Correct. They dont load in the preview. And for sure PIL loads them, as I load them using my Queue node, but the LoadImage node does not display the image: It sticks to the previous cached image. It also doesnt load ALPHA (1-MASK) but this is an ongoing struggle. P.S. ignore the color change; that was the first network I slapped your test image into -- image is fine, just doesnt preview. |
Yes, it makes sense actually, the frontend uses the endpoint ComfyUI/web/scripts/widgets.js Lines 378 to 392 in ddb6a9f
A straightforward solution would be to do an X to png conversion in the endpoint declaration for types not natively supported by browsers. It isn't something you call repeatedly and the cost would only be there for these formats
|
That issue already exists. This PR doesn't add any new formats to the dropdown selection it just filters out non-image formats. A separate issue should be made to discuss browser compatbility with the LoadImage preview. |
This is another possible solution which is more performant and can be used for LoadAudio, LoadImage, LoadVideo: |
f1a1659
to
fb0bd6d
Compare
Closing in favor of #4054 and to avoid bumping it each time I rebase/force push |
This limits the dropdown of the LoadImage to only display formats it can load:
This is because extensions like VHS upload videos to
input
, other audio extensions too and these video/audio get listed in loadImage