Skip to content

Allow saving intermediate Steps to separate image files during generation #1026

@aleksusklim

Description

@aleksusklim

Under the Setting tab there is an option called User interface → Show progressbar: "Show show (typo?) image creation progress every N sampling steps. Set 0 to disable."

I had set it to "1" and then I'm able to see all intermediate images at all lower steps during generation! (Yes, I'm aware that it could slightly hurt performance). But these images aren't saved anywhere, are they?

I'm running at 4GB VRAM, so each step takes a considerable amount of time (20 sec or so at default), so I don't want to repeat the whole process if I saw something interesting in intermediate image. Also it's not confinement to just sit there during generation to watch as image emerges – I would rather leave it for some time, then return to see how it’s going and whether I want to Interrupt it or continue.

I thought Grid mode will put each image on lower steps to separate cell, but apparently it regenerates the whole image each time, even if it's just Step count that changed.

Last question: as I'm new to Stable Diffusion, it is not clear for me whether applying "img2img" to intermediate result is the same as just letting it continue to next steps? In other words, if I make 15 steps and then save .png (along with all generation parameters) – how can I "continue from here" f.e. to step 30, without regeneration from the start?

If the lone resulting image is not enough to "continue", can we save something more like a "state" of the model – to load it later and continue stepping (possible with changed prompt, as you even have the special syntax to do this automatically!) at will?

So, to conclude:

  1. At bare minimum – an option to anyhow save all intermediate images during generation steps.
  2. Just as optimization for Grid: if any axis depends on Step – then generate just one image with highest number of steps, but save intermediate images at provided steps to correct cells.
  3. A mode with "infinite" number of steps, that can be interrupted/paused anytime (but it should count as success and save the image correctly) and then continued from here with an ability to alter every parameter that can be reasonably altered that way (for example, the prompt text but not the image resolution of course).
  4. Save those "states" (with all parameters) at each specified step, to be able to continue exactly from here. One good application I see is generation a lot samples at low step count, then cherry-picking good ones manually to continue them to mid step count, and then choosing the best ones to further continue to high steps. But, if each such state is technically will be very large (for example as large as the model itself, several gigabytes) – then this method will become unfeasible, comparing to direct regeneration of interested images from scratch. In that case, it is not really worth implementing.

Basically, everything is coming from the fact that I don't want to spend time to generate something that was already been generated but not saved ))
Sorry and thank you for --lowvram option!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions