stable-diffusion-webui
stable-diffusion-webui copied to clipboard
add callback after image is saved
Add script callback after modules.images.save_image is called. Looking to support doing additional things to the files saved. For example: https://github.com/tsngo/stable-diffusion-webui-aesthetic-image-scorer
If we're adding a callback here, I think it would make a lot more sense to call it just before the image is saved, and make it possible for script user to alter the image (ie if user's callback returns an image, use that for saving, if None - use original).
Do you want your extension added to wiki?
Ok I'll look at it later today. Would be great to add my extension to wiki when this is done.
Maybe one callback before saving and another one after saving would be best? After saving is also useful for sending the new image to other systems or making a better ui.
Yeah that's probably what I need to do. One before and after as I can't figure out a way to do what I need on my extension before the file is saved
getting this error after update

Failed to run
Error loading script: image_scorer.py
Traceback (most recent call last):
File "F:\ProgramData\StableDiffusion\stable-diffusion-webui\modules\scripts.py", line 159, in load_scripts
exec(compiled, module.dict)
File "F:\ProgramData\StableDiffusion\stable-diffusion-webui\extensions\aesthetic-image-scorer\scripts\image_scorer.py", line 130, in
getting this error after update
same error