stable-diffusion-webui
stable-diffusion-webui copied to clipboard
Allow saving of images generated via API
Allow generated images to be saved locally when triggered via txt2img
or img2img
API by passing do_not_save=False
This is a common request now that using scripts via API is supported.
Previously images were never saved and only returned via HTTP response. however, this does not work well when API is used with scripts that return multiple interim images (e.g. prompt travel, seed travel, steps travel, etc.).
To avoid runtime errors, images will be saved to opts.outdir_save
if not specified in API script request options.
Additionally, allows API requests to set do_not_send=True
so HTTP response will not include all generated images. Again, this is required for scripts that generate a large number of images which would overload HTTP response.
No changes to default behavior (which is not to save images).
Closes #3946 (long standing, lots of upvotes) Closes #8276 Closes #7315 Closes https://github.com/yownas/seed_travel/issues/30
This will also close longstanding issue #3946 as I'll be satisfied with this.
great but why the double-negative "do_not_save=False" and not "save=True"? :)
So this is working fine right now using:
"send_images": false/true
"save_images": false/true
But these parameters are not documented in the API documentation (openapi) and I haven't been able to figure out how to add changes myself (via pull request?). I think it would make sense to list them accordingly.