LoadImage node should optionally return Mask the same size as the input image
- Dominant language
- Python
- Stars
- 133k
- Forks
- 15.7k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 155
Description
### Feature Idea
Today I encountered an issue in the workflow I am working on.
The issue I encountered is that the mask returned on an image that has no alpha, is 64x64 pixels. This wasn't an issue in most workflows I had, but in this workflow I am feeding this mask into a "Image batch Multiple" Node, which taks 1 to 5 images and processes them. In concrete it's an upscaling workflow, where I take 1 to 4 images and upscale them. But since they can have alpha, I have to split of the mask, upscale it and join it later on.
Now the behavior of the "Image Batch Multiple" node is, that it takes the first images resolution and scales up/down (can't be turned off) other images of the batch to the same size. So if the first image fed in has no alpha, the mask will be 64x64 and all other images masks will be scaled down to 64x64. When they get merged at the end, the image is natuarlly messed up.
https://github.com/comfyanonymous/ComfyUI/blob/7a13f74220dcfcf6d8a6e7c1984f2c718cd9eda8/nodes.py#L1669
I see in the code above that the image is fixed 64x64. Would it be possible to return an mask with the same dimensions as the actual image?
If there are performance implications (i.e. slowing down of the rest of the workflow, because an empty 1024x1024 image is processed), an true/false options could be added "Default (64x64) mask if no alpha" or so.
### Existing Solutions
There are none, just ugly and unreliable workarounds as in controlling the order of images loaded which is not acceptable solution.
### Other
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.