stable-diffusion-webui
stable-diffusion-webui copied to clipboard
Try dynamic thresholding
Adding dynamic thresholding by Birch-san: https://github.com/Birch-san/stable-diffusion/tree/dynamic-thresholding-6 Feature request here: https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/3268
Not ready to merge since settings are hardcoded right now. It'd be faster if someone else familiar with the UI could help with that, but I can probably do it.
Added UI to the main txt2img, img2img (not settings). The thresholding is not implemented for DDIM/PLMS samplers.
Weird horizontal lines appear during generation which makes me think something's not right.
Any update on this?
The generated images don't have artifacts, but during generation there are horizontal stripes of the same color which seem to be affecting the output. It's especially apparent when the actual CFG and mimic CFG are far apart. I'm not sure if this is inherent to the method or a bug introduced when I added it to this repository, but I don't have time to debug it.
Why closed? Was really looking forward to this feature.
I don't have time for it, and it's better not to leave hope. Maybe someone else will pick it up.
I made some time and fixed the horizontal line issue, moved "threshold percentile" into settings, made it compatible with prompt combination (AND, OR), and fixed the "paste previous prompt" button not working. There should be no issues now.
Clicking the "paste previous prompt" button twice erases the negative prompt and hides the rows, but that seems like a seaprate issue.
For those curious about what the horizontal line thing was, the shape of "cond" was incorrect, so it wasn't being flattened properly.
Wow, looks exciting!
~~But so far it didn't do anything on my end. How do I enable this mode? I noticed that threshold_enable
is False? Maybe that's the case? I also don't see "threshold percentile" in my Settings. Thank you~~
Update: Nevermind! I found it, it's called "Latent fix" :-)
Update2: Works pretty cool on my end btw, no more "image overheating" on high CFG scales.
I haven't been able to get good results with this. For example, this is image generated with CFG 20:
CFG 20 with latent fix mimic scale 5:
Just CFG 5:
Other params are in pnginfo.
I haven't been able to get good results with this. For example, this is image generated with CFG 20:
CFG 20 with latent fix mimic scale 5:
Just CFG 5:
Other params are in pnginfo.
I am getting incredible results from this . Using my own mix https://huggingface.co/faisalhr1997/sd_1.6/resolve/main/sd%201.6%20dream%20remix.ckpt
Parameters should be in the png info. And cfg 30 mimic 6.5.
I haven't been able to get good results with this. For example, this is image generated with CFG 20: ...
I'm not sure why it gets so washed out. Maybe the difference between actual CFG and mimic CFG cannot be too big.
I tried redoing it but with mimic scale 11 and it looks decent, (7ab762a7 anything-v3 pruned fp16, plus vae):
Looking at the code, most of the work is done in _dynthresh
function. I added combine_denoised(self, x_out, conds_list, uncond, cond_scale)
function to the CFGDenoiser
, so this should make it quite a lot easier to override the current functionality with what this PR does. As it modifies the UI, I'd prefer if it was added as an extension so that people who want it can enable it.
Yeah, I can work on making it an extension.
I'm also looking forward to this extension, because it would help a lot to generate better images
@dtan3847 any progress?
@dtan3847 any progress?
No progress, life and covid got in the way
As the original author of this PR is unable to continue work, I went ahead myself to build an extension based on it: https://github.com/mcmonkeyprojects/sd-dynamic-thresholding
@mcmonkey4eva this turned out great! What would be nice is to have the parameters embedded in the image and TXT for reproduction - if it can be done.
This is the best setup I've found so far, the faces are nicely done without any restoration!
I hope @AUTOMATIC1111 will add it to the extension list.
Update your webui, you're very far behind. For further issues post @ https://github.com/mcmonkeyprojects/sd-dynamic-thresholding/issues