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

feat: add --output filename option

Open code-distortion opened this issue 1 year ago • 0 comments

Hi @fboulnois. I hope you don't mind me making this pull request. I wanted to give this a go to see if I could do it, and thought you might find it useful as well.

Synopsis

This pull request adds a new --output xxx option, to allow the user to specify a filename to output to.

I wanted to let the caller specify this. This way, when programmatically calling ./build.sh run, the calling script knows exactly which output file to look for.

Usage

./build.sh run 'a person riding a bicycle on a bridge' --output my_file.png

Notes

  • the user is only allowed to specify .png filenames (an exception is raised otherwise)
  • a default name is still generated when needed
  • small differences to the existing behaviour:
    • the output filename/s are shown for the user to see. e.g. output file: my_file.png
    • the iteration is still added to the filename (i.e. __n_1, __n_2, etc) regardless of whether the user specified their own filename or not, but only when creating more than one image (i.e. --iters > 1 or --samples > 1)
  • README.md has been updated

code-distortion avatar Jul 21 '23 18:07 code-distortion