Open attashe opened 6 months ago
I caught mismatch dimension error during normal map extraction
normal = (normal - normal.min()) / ((normal.max() - normal.min())) # normal = 1, 1, H, W, C normal_list.append(normal) ... divided = torch.max(divided, dim=3, keepdim=True)[0].repeat(1, 1, 1, 3) # divided= 4, H, W, C divided_list.append(divided) normal_out = torch.cat(normal_list, dim=0) # normal_out = 1, 1, H, W, C divided_out = torch.cat(divided_list, dim=0)
For able to save and preview results I suggest:
normal = (normal - normal.min()) / ((normal.max() - normal.min())) normal_list.append(normal.squeeze()) # squeeze all extra dimensions ... divided = torch.max(divided, dim=3, keepdim=True)[0].repeat(1, 1, 1, 3) divided_list.append(divided) normal_out = torch.stack(normal_list, dim=0) # replace cat to stack divided_out = torch.cat(divided_list, dim=0)
Workflow attached
You may have an old version of the ComfyUI-Video-Matting -nodes, there was a bug in the BRIAAI node giving wrong mask shape, which would also add extra dimension to the normal map.
I caught mismatch dimension error during normal map extraction
For able to save and preview results I suggest:
Workflow attached