Skipping last few iterations #7077
-
Some checkpoints, especially over trained would butcher the last few steps. I created script using store_latent that will save the iteration at certain step. Is there any way to skip the last few steps (plugin/script/settings) just as I described? The script to save at certain step works, but it works only for txt2img since I just call sd_samplers.sample_to_image and images.save_image at certain step as per the wiki suggestion. |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 20 replies
-
I figured it out and wrote a script that will bail earlier (you set sampling steps ex. 20 and the system is going for that, but then it will bail at the number set by script f. ex 16 - which seems to produce good results for overtrained ckpts) but I'd still need some help to polish it. I'd like to talk to some developers before committing this anywhere) If you are interested, let me know and I'll post it on github after some clean up. If not - don't let me know. |
Beta Was this translation helpful? Give feedback.
-
Clip Skip A more detailed explanation: CLIP is a very advanced neural network that transforms your prompt text into a numerical representation. Neural networks work very well with this numerical representation and that's why devs of SD chose CLIP as one of 3 models involved in stable diffusion's method of producing images. As CLIP is a neural network, it means that it has a lot of layers. Your prompt is digitized in a simple way, and then fed through layers. You get numerical representation of the prompt after the 1st layer, you feed that into the second layer, you feed the result of that into third, etc, until you get to the last layer, and that's the output of CLIP that is used in stable diffusion. This is the slider value of 1. But you can stop early, and use the output of the next to last layer - that's slider value of 2. The earlier you stop, the less layers of neural network have worked on the prompt. Some models were trained with this kind of tweak, so setting this value helps produce better results on those models. https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Features#clip-skip |
Beta Was this translation helpful? Give feedback.
-
"Saving steps of the sampling process" |
Beta Was this translation helpful? Give feedback.
-
just a quick note, save at |
Beta Was this translation helpful? Give feedback.
-
I updated it from some of the ideas above - so now it shows multiple last steps in the interface and can also fully bail out - and I learned a bit more of python I'm going to rewrite it using @vladmandic suggestion, finally I actually understand what he meant and of course he is 100% right |
Beta Was this translation helpful? Give feedback.
-
I too am looking for this. Is there a new extension or something that does this? |
Beta Was this translation helpful? Give feedback.
-
For everyone that is still looking for a fix >>> It does the trick! (can also be installed directly from the "Available" List in the Extensions Tab) |
Beta Was this translation helpful? Give feedback.
I figured it out and wrote a script that will bail earlier (you set sampling steps ex. 20 and the system is going for that, but then it will bail at the number set by script f. ex 16 - which seems to produce good results for overtrained ckpts) but I'd still need some help to polish it. I'd like to talk to some developers before committing this anywhere)
If you are interested, let me know and I'll post it on github after some clean up.
If not - don't let me know.