Closed vojtajina closed 2 weeks ago
This is naive implementation of #20
Actually, it's not solving all the issues. This only fixes MaskedFill
node, but there are other hooks/patches that fail during more complex workflows.
I think the issue in MaskedFill
was mostly this line:
mask.expand(1, *mask.shape[-2:])
and the rest already work for batches. So there's no need to put another loop.
I pushed a minimal version: https://github.com/Acly/comfyui-inpaint-nodes/commit/59af54b72d70d28ae49c07cf56e89899e81a3397
As for adapting the inapint node, I think your code works.
Maybe simplify it to:
inpaint = inpaint_head_feature.to(h)
h = h + inpaint.repeat(h.shape[0] // inpaint.shape[0], 1, 1, 1)
?
Iterate over all images and call the fill functionality for each image sequentially and then stack the results back together.
It’s probably gonna be much faster to do it with single tensor, but I don’t have time to figure that out. If someone knows how to do that, please feel free to send a patch, or tell me how to do it.