The Mask Dilate Region and Mask Erode Region nodes ouput a tensor with different dimensions than their input. This leads to errors when attempting to operate on that output.
I discovered this when I tried feeding the output of a Mask Erode Region to a "Bitwise (Mask & Mask)" node along with another mask that hadn't been eroded. That fails because the "bitwise" node assumes its inputs are of the same shape, but instead they were [512, 512] and [1, 1, 512, 512].
The same issue also applies to other types of nodes, like Mask Threshold Region. They all call unsqueeze twice on their output before returning. Removing the unsqueeze calls has allowed things to work as expected. What's going on here?
The Mask Dilate Region and Mask Erode Region nodes ouput a tensor with different dimensions than their input. This leads to errors when attempting to operate on that output.
I discovered this when I tried feeding the output of a Mask Erode Region to a "Bitwise (Mask & Mask)" node along with another mask that hadn't been eroded. That fails because the "bitwise" node assumes its inputs are of the same shape, but instead they were [512, 512] and [1, 1, 512, 512].
The same issue also applies to other types of nodes, like Mask Threshold Region. They all call
unsqueeze
twice on their output before returning. Removing the unsqueeze calls has allowed things to work as expected. What's going on here?