thundaga / SD-webui-txt2img-script

Stable diffusion webui script to batch process images within the txt2img section
41 stars 5 forks source link

Trivial Bug: "LORA hashes" bleeding into metadata #9

Closed altoiddealer closed 1 year ago

altoiddealer commented 1 year ago

Hello, thank you again for making this excellent script.

I just noticed that when the script uses a LORA for an image, every image generated afterwards will include the same "LORA Hash" in the metadata for all further images in the batch - until it processes an image that has a different LORA. Then, the bug repeats until there is a different LORA... and so on, and so on.

This doesn't seem to actually have any bearing on the image. It's just mildly annoying that, if you process thousands of images and one of them has a LORA, then majority of the images will have LORA in the metadata.

thundaga commented 1 year ago

Got it I'll look into it by tomorrow 👍.

altoiddealer commented 1 year ago

If its any help, I also want to add that I repeated the same without --xformers and have the same result.

I also noticed just how much of an effect --xformers has on batches like this... yikes! It really has a dramatic effect. I was about to report another bug, but it's just xformers.

OPCOXE commented 1 year ago

Didn't had issues with xformers for me exept the image was different everytime and it was horrible for me since I generate non-Hires fix images then Hires fix then in a batch ...

Anyways, I'm assuming this come from the fact that the script doesn't reset everything between each image. It shouldn't change the output images as I didn't noticed it (I also use different Loras).

altoiddealer commented 1 year ago

Indeed, I'm shocked about xformers. It's really not too bad if generating a bunch of images using the same prompt, but when it goes from one prompt to a different one it has quite a significant effect.

I, too, am using the same process as you now that I've discovered this script and the img2img script

thundaga commented 1 year ago

@altoiddealer have you tried this on the most recent version of the extension, because the latest commit over a week ago should have fixed the extra generation parameters such as a Lora hash in the infoText since its dictionary information is reset after each image.

altoiddealer commented 1 year ago

I am definitely on the most recent version of the extension, and it definitely occurs as I described.

Should be pretty easy to reproduce, so long as you have a LORA file... just put 2 images in a folder and make sure the first one had LORA in the prompt. The second image will have the LORA hash in its metadata

thundaga commented 1 year ago

Hmm strange I'm not able to reproduce this, the Lora hashes disappear on the second image for me. can you verify that the extension has this line of code around line 176 "p.extra_generation_params = {}", since I can reproduce your issue when that line is gone but unable to when it's there. also can you try it on the original sd webui.

altoiddealer commented 1 year ago

Welp, I apologize for wasting your time with this one.

It turns out that I did not have the most recent version in my scripts folder. I think I updated the extension 2 weeks ago but failed to copy it over.

...I just retested and there is no issue!

thundaga commented 1 year ago

ok awesome 👍