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

Controllable inpainting Gaussian blur sigma value #1813

Merged
merged 1 commit into from
Jul 21, 2023

Conversation

catboxanon
Copy link
Contributor

@catboxanon catboxanon commented Jul 21, 2023

Closes #1811

This exposes the Gaussian blur sigma value used for inpainting (currently hardcoded at an arbitrary value of 7), which can allow for a more smoother transition in some cases, especially for txt2img outpainting. The default value remains at 7.

You can see a before/after comparison here: https://imgsli.com/MTkzMzYw
(image from #1597 (comment))


I believe this could still be improved but I'm not sure the best way to go about implementing a proper fix. An additional final pass in img2img + manual feathering may be the only way to 100% resolve it for the time being.

cc @wywywywy if you would like to test this out as well.

@huchenlei
Copy link
Collaborator

LGTM on moving hard-coded number 7 to config. 👍

@huchenlei huchenlei merged commit 8063252 into Mikubill:main Jul 21, 2023
1 check passed
@wywywywy
Copy link

Just tested it, and this works very well. Thank you so much.

Value of 30+ seems optimal for outpainting, while for actual inpainting 10 is pretty good.

So what would make it even better, is for this to become a generation parameter in my opinion.

image

@catboxanon
Copy link
Contributor Author

I consider the parameter a bit more experimental to control and also not 100% a proper fix, so I didn't want to make it a generation parameter. If a proper fix were implemented at some point then it could certainly live there imo.

tiangles pushed a commit to diffus-me/sd-webui-controlnet that referenced this pull request Aug 18, 2023
@aulerius
Copy link

aulerius commented Mar 16, 2024

Is it possible to experiment and overwrite this parameter through API calls?
I'm always having visible seams when outpointing via API manually using inpaint_only.

layout1
From left to right: ControlNet input, mask, and output.

@catboxanon
Copy link
Contributor Author

Passing it into the override settings of the API call like this should work.

"override_settings": {
	"control_net_inpaint_blur_sigma": 14
}

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]: txt2img outpainting feathering/mask blur
4 participants