Image Preview
For big batches, if something went wrong - we are losing all generated images. I want to get images as they a sampled. This way I can save content to disk and/or show preview as it get done.
Its also a step to #354, we can just call a sd_result_cb with additional parameters. This will take time to modify each sample method in sample_k_diffusion() so i do plan to make it as separate PR (if i can get it working).
What do you think about this changes? This PR is not breaking, just replacing functionality if callback is set.
Well, i added a callback for a sampling steps.
Its inefficient, with steps callback:
txt2img completed in 64.58s
Without:
txt2img completed in 18.03s
(Euler A, 32 steps)
Can look something like this:
Well, i added a callback for a sampling steps. Its inefficient, with steps callback:
txt2img completed in 64.58sWithout:txt2img completed in 18.03s(Euler A, 32 steps)Can look something like this:
Does the 64.58s include saving the images to disk?
@amblamps images are saved in this time, but impact is minimal. I will try to test different approaches to minimize times, but most of the time is decode_first_stage call.
After testing I can confirm that with right callback function, with will not stop execution - everything else is 0 second, except decode_first_stage. It gives 0.8s to 1.0s compute time on my setup, most of the time its 0.82s to 0.86s. This is per decode, mean per step.
Replaced by https://github.com/leejet/stable-diffusion.cpp/pull/522. However, I still want to express my gratitude for your contribution.
