stable-diffusion icon indicating copy to clipboard operation
stable-diffusion copied to clipboard

Unable to specify save frequency

Open monsieurpooh opened this issue 1 year ago • 2 comments

In VQGAN there was a "save_every" arg where it would save the image to disk after each k iterations. There doesn't seem to be this feature here; I thought it was n_iter but that just starts new ones from scratch.

monsieurpooh avatar Oct 06 '22 08:10 monsieurpooh

https://github.com/AUTOMATIC1111/stable-diffusion-webui has the option to show the generation process. Just grep the code, tell us what it is, and close the issue. Thanks.

dagelf avatar Oct 06 '22 18:10 dagelf

I had implemented something before seeing this comment; it wasn't trivial but one can use the "image callback" argument in "sample". In the image callback, you can run the image-saving code conditioned on i (iterations) modded by the save interval. Only minor issue is the code that translates the existing tensor into the stuff that needs to go in the image seems to take longer than similar implementations of VQGAN-CLIP. It takes about 0.15-0.20 seconds each time you want to save the image and I couldn't get it any lower than that.

monsieurpooh avatar Oct 08 '22 19:10 monsieurpooh