Handle batches and Tensors in pipeline_stable_diffusion_inpaint.py:prepare_mask_and_masked_image#1003
Conversation
|
The documentation is not available anymore as the PR was closed or merged. |
|
Not sure why |
|
In general this is ok for me! @patil-suraj could you also take a look? |
|
Regarding the and then run Also could we add one test that shows how the code changes now work? You can add a test under tests/pipelines/stable_diffusion/pipeline_inpaint.py |
theoretically, this allows the inpainting pipeline to have batches, not just single images in practice, diffusers needs to allow for inpaint batching before this will have any effect huggingface/diffusers#1003
|
Hey @vict0rsch, We can fix Could you maybe add a test that show-cases how this PR fixes something that currently doesn't work? |
|
We already allow to pass images at pytorch tensors I think so I'm wondering whether we need to take care of this here |
|
Linking this to #1128 as well -> We need a test for these changes, as they touch highly used pipelines. |
|
Hey sorry I got busy and forgot because I have a cloned and patched local version. I'm going to work on this |
|
@patrickvonplaten do you mean a new |
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. |
|
|
|
Actually I see tests are still not happy with But the tests expect something different, on files I have not touched... |
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. |
|
Couple remarks:
|
|
13 tests pass with |
|
Thanks @vict0rsch - cool that you added all these tests |
Co-authored-by: Elias Joseph <elias@nod-labs.com>
…repare_mask_and_masked_image` (huggingface#1003) * Handle batches and Tensors in `prepare_mask_and_masked_image` * `blackfy` upgrade `black` * handle mask as `np.array` * add docstring * revert `black` changes with smaller line length * missing ValueError in docstring * raise `TypeError` for image as tensor but not mask * typo in mask shape selection * check for batch dim * fix: wrong indentation * add tests Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
Addresses #1000
Not sure what your code conventions are, I've been quite verbose in comments