invoke-ai / InvokeAI

Invoke is a leading creative engine for Stable Diffusion models, empowering professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry leading WebUI, and serves as the foundation for multiple commercial products.
https://invoke-ai.github.io/InvokeAI/
Apache License 2.0
23.34k stars 2.4k forks source link

[bug]: #1695

Closed Lolagatorade closed 1 year ago

Lolagatorade commented 1 year ago

Is there an existing issue for this?

OS

Linux

GPU

cuda

VRAM

6gb

What happened?

All is loaded but stalls on system config request... multiple attempts to produce an image continues to say requesting config

additionally some settings wont stick, selected ddim for example and on terminal its showing k_heun, mismatch between GUI and terminal

Model loaded in 28.45s Max VRAM used to load the model: 2.17G Current VRAM usage:2.17G Current embedding manager terms: * Setting Sampler to k_heun

not sure if patchmatch is of importance went to the github install patchmatch link but error 404...

patchmatch.patch_match: INFO - Compiling and loading c extensions from "/home/helios/Documents/InvokeAI/src/pypatchmatch/patchmatch".

patchmatch.patch_match: WARNING - patchmatch failed to load or compile. patchmatch.patch_match: WARNING - Refer to https://github.com/invoke-ai/InvokeAI/blob/main/docs/installation/INSTALL_PATCHMATCH.md for installation instructions. Patchmatch not loaded (nonfatal)

additionally ive used stable diffusion before i went ahead and deleted LDM as it seemed invokeAI would install its own enviroment, although it wont allow me to activate manually like the past enviroments... i used the autoinstaller both the sourcecode one and the other zip available on the github zip files

image

Screenshots

image

image

Additional context

every time. used to work fine and could make images. i made the bounding box slightly too big in resolution for my vram i suspect the program stalled and config file was courrupted.. not sure how to rebuild it as i did a full reinstall but the cache still remains...

Contact Details

lolagatorade@gmail.com

kriptolix commented 1 year ago

Patchmatch is very important for the WEB interface, the github link is incorrect, the correct one is https://github.com/invoke-ai/InvokeAI/blob/main/docs/installation/060_INSTALL_PATCHMATCH.md

Try following the patchmatch installation instructions and see if that resolves the issue.

Lolagatorade commented 1 year ago

Yeah I tried that. I deleted LDM environment from conda. updated invoke ai, deleted and reinstalled, ect but never got patchmatch to work again. Closest I got was my current error "Version `GOMP_5.0' not found (required by /usr/lib/libvtkCommonCore.so.1))." But no resolution in sight to the issue. Seems broken in arch systems.

I must say the problem is not clear as no error is output when running the test at the end of the instructions on >>python. Error when running invoke AI wasn't very helpful either.

Patchmatch is very important for the WEB interface, the github link is incorrect, the correct one is https://github.com/invoke-ai/InvokeAI/blob/main/docs/installation/060_INSTALL_PATCHMATCH.md

Try following the patchmatch installation instructions and see if that resolves the issue.

sabino commented 1 year ago

I was having the same issue (regarding patchmatch not compiling, even with everything installed).

Here is what I did.

tl;dr

If running on Linux (Debian / Ubuntu - including WSL), set this env before running InvokeAI.

export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig/

Longer version

(my thought process)

1. When testing for `patchmatch`'s availability (run `python` and try to import: `from patchmatch import patch_match`) I got this: ``` ❯ python Python 3.10.6 (main, Sep 16 2022, 06:19:54) [GCC 9.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from patchmatch import patch_match >> patchmatch.patch_match: INFO - Compiling and loading c extensions from "/mnt/wsl/ext4/InvokeAI/invokeai/lib/python3.10/site-packages/patchmatch". >> patchmatch.patch_match: WARNING - patchmatch failed to load or compile. >> patchmatch.patch_match: WARNING - Refer to https://github.com/invoke-ai/InvokeAI/blob/main/docs/installation/INSTALL_PATCHMATCH.md for installation instructions. >>> exit() ``` 2. So I've explored a bit and found out the following that it is possible to set the env variable INVOKEAI_DEBUG_PATCHMATCH to see what the compiler is complaining about (I guess this could be added to the docs?). [Here is the code that checks for this]( https://github.com/invoke-ai/PyPatchMatch/blob/c9f05ffd31845c1eebb07867c337ae02b59f2dd3/patchmatch/patch_match.py#L153). ``` export INVOKEAI_DEBUG_PATCHMATCH=1 ``` 3. By doing so, I got this output mentioning a suggestion regarding the `PKG_CONFIG_PATH` env variable: ``` ❯ export INVOKEAI_DEBUG_PATCHMATCH=1 ❯ python Python 3.10.6 (main, Sep 16 2022, 06:19:54) [GCC 9.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from patchmatch import patch_match >> patchmatch.patch_match: INFO - Compiling and loading c extensions from "/mnt/wsl/ext4/InvokeAI/invokeai/lib/python3.10/site-packages/patchmatch". rm -rf build/obj libpatchmatch.so Package opencv was not found in the pkg-config search path. Perhaps you should add the directory containing `opencv.pc' to the PKG_CONFIG_PATH environment variable No package 'opencv' found mkdir: created directory 'build/obj' mkdir: created directory 'build/obj/csrc/' [dep] csrc/pyinterface.cpp ... Package opencv was not found in the pkg-config search path. Perhaps you should add the directory containing `opencv.pc' to the PKG_CONFIG_PATH environment variable No package 'opencv' found [dep] csrc/inpaint.cpp ... Package opencv was not found in the pkg-config search path. Perhaps you should add the directory containing `opencv.pc' to the PKG_CONFIG_PATH environment variable No package 'opencv' found [dep] csrc/masked_image.cpp ... Package opencv was not found in the pkg-config search path. Perhaps you should add the directory containing `opencv.pc' to the PKG_CONFIG_PATH environment variable No package 'opencv' found [dep] csrc/nnf.cpp ... Package opencv was not found in the pkg-config search path. Perhaps you should add the directory containing `opencv.pc' to the PKG_CONFIG_PATH environment variable No package 'opencv' found [CC] csrc/nnf.cpp ... In file included from csrc/nnf.cpp:5: csrc/masked_image.h:3:10: fatal error: opencv2/core.hpp: No such file or directory 3 | #include | ^~~~~~~~~~~~~~~~~~ compilation terminated. make: *** [Makefile:33: build/obj/csrc/nnf.o] Error 1 >> patchmatch.patch_match: WARNING - patchmatch failed to load or compile. >> patchmatch.patch_match: WARNING - Refer to https://github.com/invoke-ai/InvokeAI/blob/main/docs/installation/INSTALL_PATCHMATCH.md for installation instructions. >>> exit() ``` 4. Then I went to the directory where it was trying to compile and ran `make` manually. The output was the same, I just did this to make it easier to iterate. ``` ❯ cd /mnt/wsl/ext4/InvokeAI/invokeai/lib/python3.10/site-packages/patchmatch ❯ make clean && make rm -rf build/obj libpatchmatch.so Package opencv was not found in the pkg-config search path. Perhaps you should add the directory containing `opencv.pc' to the PKG_CONFIG_PATH environment variable No package 'opencv' found mkdir: created directory 'build/obj' mkdir: created directory 'build/obj/csrc/' [dep] csrc/pyinterface.cpp ... Package opencv was not found in the pkg-config search path. Perhaps you should add the directory containing `opencv.pc' to the PKG_CONFIG_PATH environment variable No package 'opencv' found [dep] csrc/inpaint.cpp ... Package opencv was not found in the pkg-config search path. Perhaps you should add the directory containing `opencv.pc' to the PKG_CONFIG_PATH environment variable No package 'opencv' found [dep] csrc/masked_image.cpp ... Package opencv was not found in the pkg-config search path. Perhaps you should add the directory containing `opencv.pc' to the PKG_CONFIG_PATH environment variable No package 'opencv' found [dep] csrc/nnf.cpp ... Package opencv was not found in the pkg-config search path. Perhaps you should add the directory containing `opencv.pc' to the PKG_CONFIG_PATH environment variable No package 'opencv' found [CC] csrc/nnf.cpp ... In file included from csrc/nnf.cpp:5: csrc/masked_image.h:3:10: fatal error: opencv2/core.hpp: No such file or directory 3 | #include | ^~~~~~~~~~~~~~~~~~ compilation terminated. make: *** [Makefile:33: build/obj/csrc/nnf.o] Error 1 ``` 5. So I decided to follow the `PKG_CONFIG_PATH` variable suggested here. There is actually another way to check if `opencv4` package is available: ``` ❯ pkg-config --cflags --libs opencv4 Package opencv4 was not found in the pkg-config search path. Perhaps you should add the directory containing `opencv4.pc' to the PKG_CONFIG_PATH environment variable No package 'opencv4' found ``` 6. The documentation says to [create a symbolic link](https://invoke-ai.github.io/InvokeAI/installation/060_INSTALL_PATCHMATCH/?h=patchma#debian-based-distros:~:text=opencv%20libopencv%2Ddev-,Fix%20the%20naming%20of%20the%20opencv%20package%20configuration%20file%3A,-cd%20/usr/lib) from `opencv4.pc` to `opencv.pc`. So what was actually missing was for the compiler to know where the packages are, in this case: `/usr/lib/x86_64-linux-gnu/pkgconfig/`. 7. Then I set the `PKG_CONFIG_PATH` with the required path, and ran just to test and see if the compiler can see the `opencv4` package: ``` ❯ PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig/ pkg-config --cflags --libs opencv4 -I/usr/include/opencv4/opencv -I/usr/include/opencv4 -L/usr/lib/x86_64-linux-gnu -lopencv_stitching -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dnn_objdetect -lopencv_dnn_superres -lopencv_dpm -lopencv_highgui -lopencv_face -lopencv_freetype -lopencv_fuzzy -lopencv_hdf -lopencv_hfs -lopencv_img_hash -lopencv_line_descriptor -lopencv_quality -lopencv_reg -lopencv_rgbd -lopencv_saliency -lopencv_shape -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_superres -lopencv_optflow -lopencv_surface_matching -lopencv_tracking -lopencv_datasets -lopencv_text -lopencv_dnn -lopencv_plot -lopencv_ml -lopencv_videostab -lopencv_videoio -lopencv_viz -lopencv_ximgproc -lopencv_video -lopencv_xobjdetect -lopencv_objdetect -lopencv_calib3d -lopencv_imgcodecs -lopencv_features2d -lopencv_flann -lopencv_xphoto -lopencv_photo -lopencv_imgproc -lopencv_core ``` 8. It worked, so all I had to do was compile `patchmatch` with the right path: ``` ❯ PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig/ make mkdir: created directory 'build/obj' mkdir: created directory 'build/obj/csrc/' [dep] csrc/pyinterface.cpp ... [dep] csrc/inpaint.cpp ... [dep] csrc/masked_image.cpp ... [dep] csrc/nnf.cpp ... [CC] csrc/nnf.cpp ... [CC] csrc/masked_image.cpp ... [CC] csrc/inpaint.cpp ... [CC] csrc/pyinterface.cpp ... [link] libpatchmatch.so ... ```
Lolagatorade commented 1 year ago

Thank you for your contribution. Ille give it a try but ime not sure if it will work. Ime not too advanced in terms of understanding Linux file system and I know Debian and Arch have different file structures

All other issues seem to have been fixed with prior releases.

I was having the same issue (regarding patchmatch not compiling, even with everything installed).

Here is what I did.

tl;dr

If running on Linux (Debian / Ubuntu - including WSL), set this env before running InvokeAI.


export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig/

Longer version

(my thought process)

1. When testing for `patchmatch`'s availability (run `python` and try to import: `from patchmatch import patch_match`) I got this: ``` ❯ python Python 3.10.6 (main, Sep 16 2022, 06:19:54) [GCC 9.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from patchmatch import patch_match >> patchmatch.patch_match: INFO - Compiling and loading c extensions from "/mnt/wsl/ext4/InvokeAI/invokeai/lib/python3.10/site-packages/patchmatch". >> patchmatch.patch_match: WARNING - patchmatch failed to load or compile. >> patchmatch.patch_match: WARNING - Refer to https://github.com/invoke-ai/InvokeAI/blob/main/docs/installation/INSTALL_PATCHMATCH.md for installation instructions. >>> exit() ``` 2. So I've explored a bit and found out the following that it is possible to set the env variable INVOKEAI_DEBUG_PATCHMATCH to see what the compiler is complaining about (I guess this could be added to the docs?). [Here is the code that checks for this]( https://github.com/invoke-ai/PyPatchMatch/blob/c9f05ffd31845c1eebb07867c337ae02b59f2dd3/patchmatch/patch_match.py#L153). ``` export INVOKEAI_DEBUG_PATCHMATCH=1 ``` 3. By doing so, I got this output mentioning a suggestion regarding the `PKG_CONFIG_PATH` env variable: ``` ❯ export INVOKEAI_DEBUG_PATCHMATCH=1 ❯ python Python 3.10.6 (main, Sep 16 2022, 06:19:54) [GCC 9.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from patchmatch import patch_match >> patchmatch.patch_match: INFO - Compiling and loading c extensions from "/mnt/wsl/ext4/InvokeAI/invokeai/lib/python3.10/site-packages/patchmatch". rm -rf build/obj libpatchmatch.so Package opencv was not found in the pkg-config search path. Perhaps you should add the directory containing `opencv.pc' to the PKG_CONFIG_PATH environment variable No package 'opencv' found mkdir: created directory 'build/obj' mkdir: created directory 'build/obj/csrc/' [dep] csrc/pyinterface.cpp ... Package opencv was not found in the pkg-config search path. Perhaps you should add the directory containing `opencv.pc' to the PKG_CONFIG_PATH environment variable No package 'opencv' found [dep] csrc/inpaint.cpp ... Package opencv was not found in the pkg-config search path. Perhaps you should add the directory containing `opencv.pc' to the PKG_CONFIG_PATH environment variable No package 'opencv' found [dep] csrc/masked_image.cpp ... Package opencv was not found in the pkg-config search path. Perhaps you should add the directory containing `opencv.pc' to the PKG_CONFIG_PATH environment variable No package 'opencv' found [dep] csrc/nnf.cpp ... Package opencv was not found in the pkg-config search path. Perhaps you should add the directory containing `opencv.pc' to the PKG_CONFIG_PATH environment variable No package 'opencv' found [CC] csrc/nnf.cpp ... In file included from csrc/nnf.cpp:5: csrc/masked_image.h:3:10: fatal error: opencv2/core.hpp: No such file or directory 3 | #include | ^~~~~~~~~~~~~~~~~~ compilation terminated. make: *** [Makefile:33: build/obj/csrc/nnf.o] Error 1 >> patchmatch.patch_match: WARNING - patchmatch failed to load or compile. >> patchmatch.patch_match: WARNING - Refer to https://github.com/invoke-ai/InvokeAI/blob/main/docs/installation/INSTALL_PATCHMATCH.md for installation instructions. >>> exit() ``` 4. Then I went to the directory where it was trying to compile and ran `make` manually. The output was the same, I just did this to make it easier to iterate. ``` ❯ cd /mnt/wsl/ext4/InvokeAI/invokeai/lib/python3.10/site-packages/patchmatch ❯ make clean && make rm -rf build/obj libpatchmatch.so Package opencv was not found in the pkg-config search path. Perhaps you should add the directory containing `opencv.pc' to the PKG_CONFIG_PATH environment variable No package 'opencv' found mkdir: created directory 'build/obj' mkdir: created directory 'build/obj/csrc/' [dep] csrc/pyinterface.cpp ... Package opencv was not found in the pkg-config search path. Perhaps you should add the directory containing `opencv.pc' to the PKG_CONFIG_PATH environment variable No package 'opencv' found [dep] csrc/inpaint.cpp ... Package opencv was not found in the pkg-config search path. Perhaps you should add the directory containing `opencv.pc' to the PKG_CONFIG_PATH environment variable No package 'opencv' found [dep] csrc/masked_image.cpp ... Package opencv was not found in the pkg-config search path. Perhaps you should add the directory containing `opencv.pc' to the PKG_CONFIG_PATH environment variable No package 'opencv' found [dep] csrc/nnf.cpp ... Package opencv was not found in the pkg-config search path. Perhaps you should add the directory containing `opencv.pc' to the PKG_CONFIG_PATH environment variable No package 'opencv' found [CC] csrc/nnf.cpp ... In file included from csrc/nnf.cpp:5: csrc/masked_image.h:3:10: fatal error: opencv2/core.hpp: No such file or directory 3 | #include | ^~~~~~~~~~~~~~~~~~ compilation terminated. make: *** [Makefile:33: build/obj/csrc/nnf.o] Error 1 ``` 5. So I decided to follow the `PKG_CONFIG_PATH` variable suggested here. There is actually another way to check if `opencv4` package is available: ``` ❯ pkg-config --cflags --libs opencv4 Package opencv4 was not found in the pkg-config search path. Perhaps you should add the directory containing `opencv4.pc' to the PKG_CONFIG_PATH environment variable No package 'opencv4' found ``` 6. The documentation says to [create a symbolic link](https://invoke-ai.github.io/InvokeAI/installation/060_INSTALL_PATCHMATCH/?h=patchma#debian-based-distros:~:text=opencv%20libopencv%2Ddev-,Fix%20the%20naming%20of%20the%20opencv%20package%20configuration%20file%3A,-cd%20/usr/lib) from `opencv4.pc` to `opencv.pc`. So what was actually missing was for the compiler to know where the packages are, in this case: `/usr/lib/x86_64-linux-gnu/pkgconfig/`. 7. Then I set the `PKG_CONFIG_PATH` with the required path, and ran just to test and see if the compiler can see the `opencv4` package: ``` ❯ PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig/ pkg-config --cflags --libs opencv4 -I/usr/include/opencv4/opencv -I/usr/include/opencv4 -L/usr/lib/x86_64-linux-gnu -lopencv_stitching -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dnn_objdetect -lopencv_dnn_superres -lopencv_dpm -lopencv_highgui -lopencv_face -lopencv_freetype -lopencv_fuzzy -lopencv_hdf -lopencv_hfs -lopencv_img_hash -lopencv_line_descriptor -lopencv_quality -lopencv_reg -lopencv_rgbd -lopencv_saliency -lopencv_shape -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_superres -lopencv_optflow -lopencv_surface_matching -lopencv_tracking -lopencv_datasets -lopencv_text -lopencv_dnn -lopencv_plot -lopencv_ml -lopencv_videostab -lopencv_videoio -lopencv_viz -lopencv_ximgproc -lopencv_video -lopencv_xobjdetect -lopencv_objdetect -lopencv_calib3d -lopencv_imgcodecs -lopencv_features2d -lopencv_flann -lopencv_xphoto -lopencv_photo -lopencv_imgproc -lopencv_core ``` 8. It worked, so all I had to do was compile `patchmatch` with the right path: ``` ❯ PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig/ make mkdir: created directory 'build/obj' mkdir: created directory 'build/obj/csrc/' [dep] csrc/pyinterface.cpp ... [dep] csrc/inpaint.cpp ... [dep] csrc/masked_image.cpp ... [dep] csrc/nnf.cpp ... [CC] csrc/nnf.cpp ... [CC] csrc/masked_image.cpp ... [CC] csrc/inpaint.cpp ... [CC] csrc/pyinterface.cpp ... [link] libpatchmatch.so ... ```
mienaiteki commented 1 year ago

I have the same problem (pathmatch refusing to load) but on M1 Mac. Can someone give me a command line to fix this?

Lolagatorade commented 1 year ago

I have the same problem (pathmatch refusing to load) but on M1 Mac. Can someone give me a command line to fix this?

Been almost half a year patchmatch still broken.