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

Allow saving "before-highres-fix." Collect three related settings into one setting.

Open timntorres opened this issue 3 years ago • 1 comments

This pull request consists of two parts.

1) Addresses #4028. Allows user to save a copy of image/images before highres fix is applied.

Saving "-before-highres-fix" is tested and works with... ✅Batch count 1, Batch size 1 ✅Batch count 1, Batch size 2 ✅Batch count 2, Batch size 1 ✅Batch count 2, Batch size 2

2) To reduce clutter, instead of adding yet another option save_images_before_highres_fix, I combined three very similar settings -- "save_images_before_face_restoration", "save_images_before_color_correction", and this new one -- into one setting, "save_intermediates," described as "Save copies before doing face restoration, color correction, highres fix."

I believe there are two types of users: those who want a bunch of intermediate copies, and those who only care about the final result. This new setting reflects that and begins to make room for other more important settings.

The new setting is tested and works with... ✅Face restoration. ✅Color correction. ✅Highres fix. ✅Face restoration AND Highres fix (txt2img). ✅Face restoration AND Color correction (img2img). ⚠️New setting still needs translations.

timntorres avatar Oct 31 '22 08:10 timntorres

epic quick work

regtable avatar Oct 31 '22 12:10 regtable

what about people who want to only save one kind of pictures

AUTOMATIC1111 avatar Nov 01 '22 12:11 AUTOMATIC1111

@AUTOMATIC1111 Very well. I reverted to the old settings and added a third, "save_images_before_highres_fix".

timntorres avatar Nov 01 '22 19:11 timntorres

possibly instead of as you say cluttering the settings area could it be better for when either option is selected it adds a second check box "save intermittent step" or something like it in here image

regtable avatar Nov 01 '22 23:11 regtable

does this break img2mg

AUTOMATIC1111 avatar Nov 02 '22 04:11 AUTOMATIC1111

does this break img2mg

Thank you for checking. This won't happen again.

Since StableDiffusionProcessingTxt2Img and StableDiffusionProcessingImg2Img both inherit from StableDiffusionProcessing, and only the first subclass's sample function needs that extra argument n, my solution is to check the type of p before sample is called.

Another option that keeps the sample functions' parameters identical is to have sample(...) return a tuple (samples before and after highres fix), but that seemed even less clear.

timntorres avatar Nov 02 '22 05:11 timntorres