stable-diffusion-webui
stable-diffusion-webui copied to clipboard
Make sure folder exists before saving image
Solves an issue where output image preview stops working after user accidentally deletes the temporary folder.
Use os.makedirs(dir, exist_ok=True) then you don't need 5 lines of code and it will work when intermediate-level directories are missing
I am aware of os.makedirs but chose to use os.mkdir in case the function receives a bad path so it doesn't create a bunch of unwanted folders somewhere on the users pc.
when would it receive a bad path