pypatchmatch is a Python module for inpainting images. It is not needed to run InvokeAI, but it greatly improves the quality of inpainting and outpainting and is recommended.
Unfortunately, it is a C++ optimized module and installation can be somewhat challenging. This guide leads you through the steps.
You're in luck! On Windows platforms PyPatchMatch will install automatically on Windows systems with no extra intervention.
You need to have opencv installed so that pypatchmatch can be built:
The next time you start
invoke, after successfully installing opencv, pypatchmatch will be built.
Prior to installing PyPatchMatch, you need to take the following steps:
Debian Based Distros#
Activate the environment you use for invokeai, either with
condaor with a virtual environment.
Confirm that pypatchmatch is installed. At the command-line prompt enter
python, and then at the
from patchmatch import patch_match: It should look like the following:
Python 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from patchmatch import patch_match Compiling and loading c extensions from "/home/lstein/Projects/InvokeAI/.invokeai-env/src/pypatchmatch/patchmatch". rm -rf build/obj libpatchmatch.so mkdir: created directory 'build/obj' mkdir: created directory 'build/obj/csrc/' [dep] csrc/masked_image.cpp ... [dep] csrc/nnf.cpp ... [dep] csrc/inpaint.cpp ... [dep] csrc/pyinterface.cpp ... [CC] csrc/pyinterface.cpp ... [CC] csrc/inpaint.cpp ... [CC] csrc/nnf.cpp ... [CC] csrc/masked_image.cpp ... [link] libpatchmatch.so ...
Arch Based Distros#
or for CUDA support
Fix the naming of the
opencvpackage configuration file:
If you see no errors you're ready to go!
Created: December 1, 2022