Fix patchmatch-docs (#2111)

* use `uname -m` instead of `arch`
addressing #2105

* fix install patchmatch formating

* fix 2 broken links

* remove instruction to do develop install of patchmatch

Co-authored-by: Lincoln Stein <lincoln.stein@gmail.com>
This commit is contained in:
Matthias Wild 2023-01-01 21:52:05 +01:00 committed by GitHub
parent c3f82d4481
commit 34f8117241
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 71 additions and 74 deletions

View File

@ -94,7 +94,7 @@ the desired release's zip file, which you can find by clicking on the green
This point release removes references to the binary installer from the This point release removes references to the binary installer from the
installation guide. The binary installer is not stable at the current installation guide. The binary installer is not stable at the current
time. First time users are encouraged to use the "source" installer as time. First time users are encouraged to use the "source" installer as
described in [Installing InvokeAI with the Source Installer](installation/INSTALL_SOURCE.md) described in [Installing InvokeAI with the Source Installer](installation/deprecated_documentation/INSTALL_SOURCE.md)
With InvokeAI 2.2, this project now provides enthusiasts and professionals a With InvokeAI 2.2, this project now provides enthusiasts and professionals a
robust workflow solution for creating AI-generated and human facilitated robust workflow solution for creating AI-generated and human facilitated

View File

@ -2,114 +2,111 @@
title: Installing PyPatchMatch title: Installing PyPatchMatch
--- ---
# :octicons-paintbrush-16: Installing PyPatchMatch # :material-image-size-select-large: Installing PyPatchMatch
pypatchmatch is a Python module for inpainting images. It is not pypatchmatch is a Python module for inpainting images. It is not needed to run
needed to run InvokeAI, but it greatly improves the quality of InvokeAI, but it greatly improves the quality of inpainting and outpainting and
inpainting and outpainting and is recommended. is recommended.
Unfortunately, it is a C++ optimized module and installation Unfortunately, it is a C++ optimized module and installation can be somewhat
can be somewhat challenging. This guide leads you through the steps. challenging. This guide leads you through the steps.
## Windows ## Windows
You're in luck! On Windows platforms PyPatchMatch will install You're in luck! On Windows platforms PyPatchMatch will install automatically on
automatically on Windows systems with no extra intervention. Windows systems with no extra intervention.
## Macintosh ## Macintosh
PyPatchMatch is not currently supported, but the team is working on PyPatchMatch is not currently supported, but the team is working on it.
it.
## Linux ## Linux
Prior to installing PyPatchMatch, you need to take the following Prior to installing PyPatchMatch, you need to take the following steps:
steps:
### Debian Based Distros ### Debian Based Distros
1. Install the `build-essential` tools: 1. Install the `build-essential` tools:
``` ```sh
sudo apt update sudo apt update
sudo apt install build-essential sudo apt install build-essential
``` ```
2. Install `opencv`: 2. Install `opencv`:
``` ```sh
sudo apt install python3-opencv libopencv-dev sudo apt install python3-opencv libopencv-dev
``` ```
3. Fix the naming of the `opencv` package configuration file: 3. Fix the naming of the `opencv` package configuration file:
``` ```sh
cd /usr/lib/x86_64-linux-gnu/pkgconfig/ cd /usr/lib/x86_64-linux-gnu/pkgconfig/
ln -sf opencv4.pc opencv.pc ln -sf opencv4.pc opencv.pc
``` ```
4. Activate the environment you use for invokeai, either with 4. Activate the environment you use for invokeai, either with `conda` or with a
`conda` or with a virtual environment. virtual environment.
5. Do a "develop" install of pypatchmatch: 5. Install pypatchmatch:
``` ```sh
pip install "git+https://github.com/invoke-ai/PyPatchMatch@0.1.3#egg=pypatchmatch" pip install "git+https://github.com/invoke-ai/PyPatchMatch@0.1.3#egg=pypatchmatch"
``` ```
6. Confirm that pypatchmatch is installed. 6. Confirm that pypatchmatch is installed. At the command-line prompt enter
At the command-line prompt enter `python`, and `python`, and then at the `>>>` line type
then at the `>>>` line type `from patchmatch import patch_match`: `from patchmatch import patch_match`: It should look like the follwing:
It should look like the follwing:
```
Python 3.9.5 (default, Nov 23 2021, 15:27:38)
[GCC 9.3.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 ...
```
```py
Python 3.9.5 (default, Nov 23 2021, 15:27:38)
[GCC 9.3.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 ### Arch Based Distros
1. Install the `base-devel` package: 1. Install the `base-devel` package:
```
sudo pacman -Syu ```sh
sudo pacman -S --needed base-devel sudo pacman -Syu
``` sudo pacman -S --needed base-devel
```
2. Install `opencv`: 2. Install `opencv`:
```
sudo pacman -S opencv ```sh
``` sudo pacman -S opencv
or for CUDA support ```
```
sudo pacman -S opencv-cuda or for CUDA support
```
```sh
sudo pacman -S opencv-cuda
```
3. Fix the naming of the `opencv` package configuration file: 3. Fix the naming of the `opencv` package configuration file:
```
cd /usr/lib/pkgconfig/
ln -sf opencv4.pc opencv.pc
```
**Next, Follow Steps 4-6 from the Debian Section above** ```sh
cd /usr/lib/pkgconfig/
ln -sf opencv4.pc opencv.pc
```
[**Next, Follow Steps 4-6 from the Debian Section above**](#linux)
If you see no errors, then you're ready to go! If you see no errors, then you're ready to go!

View File

@ -152,7 +152,7 @@ command-line completion.
If you have already downloaded the weights file(s) for another Stable If you have already downloaded the weights file(s) for another Stable
Diffusion distribution, you may skip this step (by selecting "skip" when Diffusion distribution, you may skip this step (by selecting "skip" when
prompted) and configure InvokeAI to use the previously-downloaded files. The prompted) and configure InvokeAI to use the previously-downloaded files. The
process for this is described in [here](INSTALLING_MODELS.md). process for this is described in [here](050_INSTALLING_MODELS.md).
```bash ```bash
python scripts/configure_invokeai.py python scripts/configure_invokeai.py