ThereforeGames / txt2img2img

Improve the editability of any Stability Diffusion subject while retaining a high degree of likeness
151 stars 22 forks source link

script fails if "do not show any images in results for web" is ticked in settings (fix included) #14

Open jmp909 opened 2 years ago

jmp909 commented 2 years ago

the new option to hide images from the results panel (to fix the big delay after generation) needs to be checked for because the array will be empty, giving an index out of range error otherwise

fix is on first line below:

if(opts.do_not_show_images == False): # need to apply this line
    # Get the image stored in the first index
    img2img_images = img2img_result[0]
    # Add the new image(s) to our main output
    processed.images.append(img2img_images[0])

you can see the cause of this here: https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/c8045c5ad4f99deb3a19add06e0457de1df62b05/modules/img2img.py#L134