Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add patchmatch #8852

Closed
wants to merge 2 commits into from
Closed

Conversation

catboxanon
Copy link
Collaborator

@catboxanon catboxanon commented Mar 24, 2023

Describe what this pull request is trying to achieve.

This implements patchmatch which should allow for much better inpainting (and more notably outpainting) results.

Closes #4681

Additional notes and description of your changes

Requires pypatchmatch to be installed. This is currently only available on Windows via pip. Further install instructions are here.

Mask blur must be set to 0, because blurring breaks the seams that patchmatch tries to recover. There's probably better ways to blend the final image but I'm not sure what the correct solution for this should be. If you want you can play around with the individual passes before the final composite with #8814.

I've also hardcoded the patch_size parameter to 4. Might want to expose this to the user, but increasing it also greatly increases computation time (the default is 15 which takes far too long to run for practical purposes).

Haven't tested with the openOutpaint extension yet but I'm hoping this addition could make big gains for that extension. Needs 4: "patch match" added after this line. I think the extension does not currently expose the denoise parameter either, which probably needs to be done to yield good results.

Opening as a PR for now since the installation process should be smoothed out before merging, and to see if it even works well in practice. Feedback appreciated.

Environment this was tested in

  • OS: Windows
  • Browser: Firefox
  • Graphics card: NVIDIA RTX 3090

@catboxanon
Copy link
Collaborator Author

In my tests this never really introduced substantial improvements for outpainting. If someone has to say otherwise then leave a comment and I can re-open this PR.

@catboxanon catboxanon closed this May 21, 2023
@catboxanon catboxanon deleted the patchmatch branch March 4, 2024 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request]: PatchMatch init mode for inpainting / outpainting
1 participant