lkwq007 / stablediffusion-infinity

Outpainting with Stable Diffusion on an infinite canvas
Apache License 2.0
3.85k stars 303 forks source link

(suggestion) It is possible to compile patchmatch on windows without conda #27

Closed badcode6 closed 2 years ago

badcode6 commented 2 years ago

you can build PatchMatch into a DLL on windows w/ visual studio 2022 and modify the patch_match.py to allow it to work on any windows x64 machine

lkwq007 commented 2 years ago

I have tried this before. The compiled patchmatch library works on windows, but it still requires opencv_world460.dll, and ctypes.CDLL() has strange behaviors in terms of loading the compiled library. So it might be tricky to make it work reliably on other machines.

lkwq007 commented 2 years ago

the modifications that need to be made to the C code are https://github.com/badcode6/PyPatchMatchWin/tree/master/csrc here. you need to build this with Visual Studio, under a DLL project. you do need the entire opencv library as stated in #27 . https://docs.opencv.org/4.x/dd/d6e/tutorial_windows_visual_studio_opencv.html this link should help you with that

Thanks for sharing your code. I just recompiled the DLL and use absolute path to load the DLL. I think it works fine now. I have updated the submodule.

badcode6 commented 2 years ago

You are quite welcome.