Switch to patchmatch-cython from pypatchmatch due to default availability on more platforms#8788
Switch to patchmatch-cython from pypatchmatch due to default availability on more platforms#8788aleyan wants to merge 4 commits intoinvoke-ai:mainfrom
Conversation
|
OpenCV is still recommended for patchmatch-cython and is required for invisible-watermark. See also: launcher#81 |
Ok, based on that, I will keep the opencv bindings in the Dockerfiles. Are any other changes required? |
|
Seems to be working, about 3.1x faster than the pypatchmatch version, but I get significantly worse results with it. Outputs are choppy and frequently show horizontal black lines 1 pixel wide. Also, results are no longer deterministic. |
|
Looking at the PR code and the patchmatch-cython readme, it appears that |
|
@dunkeroni On determinism, patchmatch-cython can take a seed value. I will hard code that to 0, but we may consider passing in the seed from the workflow. |
|
I don't know how to test old patchmatch implementation because I could never get it to build (hence the motivation to get the cython one in). I have made the following changes:
@dunkeroni Can you please test it out again? @iwr-redmond I investigated this, patchmatch-cython will use opencv automatically, if |

Summary
pypatchmatch has a dependency on OpenCV, which is tricky to install and/or compile on many platforms. This replaces it for another patchmatch implementation with cython wheels prebuilt for most common platforms.
Related Issues / Discussions
Closes #8781
QA Instructions
Saw "patchmatch" option appear in canvas Compositing/Infill. Generates infill.
Merge Plan
Checklist
What's Newcopy (if doing a release after this PR)