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

[Feature Request]: Implement callbacks for UniPC sampler

Open vladmandic opened this issue 1 year ago • 3 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues and checked the recent builds/commits

What would your feature do ?

Currently UniPC sampler implements custom callbacks that cannot be used by the rest of WebUI (specifically, after_update in models/diffusion/uni_pc/uni_pc.py:UniPC class)

The rest of the models in WebUI use callback property which triggers callback_state as implemented in modules/sd_samplers_kdiffusion.py:KDiffusionSampler

The function is to:

  • Provide preview image (which means that each step should do denoising which UniPC currently does not do)
  • Allow scripts/extensions a hook to do any additional per-step processing

Proposed workflow

N/A

Additional information

No response

vladmandic avatar Mar 13 '23 16:03 vladmandic

So the compvis samplers should have a similar method to callback_state like the k-diffusion samplers?

space-nuko avatar Mar 13 '23 23:03 space-nuko

Ideally. Implementation does have to be same, but functional so both previews and per-step callbacks can be accomplished.

Callbacks should be simple, I just wasn't sure about denoiser with UniPC, so I created feature request instead of fumbling around for a day :)

vladmandic avatar Mar 14 '23 00:03 vladmandic

Yes! Please! for DDIM too (screw PLMS, right?).

muerrilla avatar Mar 15 '23 10:03 muerrilla

https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/8285a149d8c488ae6c7a566eb85fb5e825145464

catboxanon avatar Aug 12 '23 03:08 catboxanon