https://github.com/haoming02/sd-webui-resharpen
An Extension for Automatic1111 Webui that increases/decreases the details of images
https://github.com/haoming02/sd-webui-resharpen
stable-diffusion-webui stable-diffusion-webui-plugin
Last synced: 7 months ago
JSON representation
An Extension for Automatic1111 Webui that increases/decreases the details of images
- Host: GitHub
- URL: https://github.com/haoming02/sd-webui-resharpen
- Owner: Haoming02
- License: mit
- Created: 2023-11-14T02:39:02.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-02T04:05:44.000Z (about 1 year ago)
- Last Synced: 2025-02-28T14:25:17.198Z (8 months ago)
- Topics: stable-diffusion-webui, stable-diffusion-webui-plugin
- Language: Python
- Homepage:
- Size: 747 KB
- Stars: 82
- Watchers: 1
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SD Webui ReSharpen
This is an Extension for the [Automatic1111 Webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui), which allows you to increase or decrease the amount of *details* of the generation during the Stable Diffusion pipeline.> **ie.** This is not just a postprocessing filter
## How to Use
There is simply a slider that controls the "sharpness" of the images, defaulting to 0.
- **Positive** values cause the images to be **noisy**
- **Negative** values cause the images to be **blurry**> Though, don't actually use values too close 1 or -1 as it will become distorted
For `txt2img`, there is also a second slider for the `Hires. Fix` pass.
You can set positive for the normal pass and negative for the hr pass, or vice versa, for some interesting effects.There is also now a scaling setting, allowing you to adjust the strength throughout the process *(**eg.** lower the sharpness towards the end)*.
> This Extension is disabled during the [ADetailer](https://github.com/Bing-su/adetailer) phase
**Note:** `Ancestral` samplers *(**eg.** `Euler a`)* do **not** work. Tested and confirmed to work for both `Euler` and `DPM++ 2M Karras`.
## Samples
Sharpness
-0.5
-0.25
0.0
0.25
0.5
Result
![]()
![]()
![]()
![]()
![]()
![]()
## How does it work?
I initially wrote this Extension to try speeding up the Diffusion process.
Since the latent noises gradually converges to around 0,
I tried to see if I can just add the delta between the current step and the previous step, perhaps multipled by a scaler,
to the current Tensor, in order to help it reaches 0 faster.
However, after fiddling around for a week, I still couldn't get it to consistently produce an actually better result.
So I gave up on the original idea.Though in the process, I also found out this "sharpening" interaction. If I had to guess,
since the Diffusion is a denoising process, if I add the delta again, then it will overly denoise to create a blurry image;
if I subtract the delta, then it will basically add the noise back to create a noisy image.## To Do
- [X] Generation InfoText
- [X] Pasting InfoText Support
- [X] X/Y/Z Plot Support
- [X] Scaling Support