diff --git a/README.md b/README.md index 4718d61c17..1c7ccef2ce 100644 --- a/README.md +++ b/README.md @@ -377,6 +377,74 @@ repository and associated paper for details and limitations. - v1.02 (21 August 2022) - A copy of the prompt and all of its switches and options is now stored in the corresponding +======= + * v1.12 (28 August 2022) + * Improved file handling, including ability to read prompts from standard input. + (kudos to [Yunsaki](https://github.com/yunsaki) + + * v1.11 (26 August 2022) + * NEW FEATURE: Support upscaling and face enhancement using the GFPGAN module. (kudos to [Oceanswave](https://github.com/Oceanswave) + * You now can specify a seed of -1 to use the previous image's seed, -2 to use the seed for the image generated before that, etc. + Seed memory only extends back to the previous command, but will work on all images generated with the -n# switch. + * Variant generation support temporarily disabled pending more general solution. + * Created a feature branch named **yunsaki-morphing-dream** which adds experimental support for + iteratively modifying the prompt and its parameters. Please see[ Pull Request #86](https://github.com/lstein/stable-diffusion/pull/86) + for a synopsis of how this works. Note that when this feature is eventually added to the main branch, it will may be modified + significantly. + +* v1.10 (25 August 2022) + * A barebones but fully functional interactive web server for online generation of txt2img and img2img. + +* v1.09 (24 August 2022) + * A new -v option allows you to generate multiple variants of an initial image + in img2img mode. (kudos to [Oceanswave](https://github.com/Oceanswave). [ + See this discussion in the PR for examples and details on use](https://github.com/lstein/stable-diffusion/pull/71#issuecomment-1226700810)) + * Added ability to personalize text to image generation (kudos to [Oceanswave](https://github.com/Oceanswave) and [nicolai256](https://github.com/nicolai256)) + * Enabled all of the samplers from k_diffusion + +* v1.08 (24 August 2022) + * Escape single quotes on the dream> command before trying to parse. This avoids + parse errors. + * Removed instruction to get Python3.8 as first step in Windows install. + Anaconda3 does it for you. + * Added bounds checks for numeric arguments that could cause crashes. + * Cleaned up the copyright and license agreement files. + +* v1.07 (23 August 2022) + * Image filenames will now never fill gaps in the sequence, but will be assigned the + next higher name in the chosen directory. This ensures that the alphabetic and chronological + sort orders are the same. + +* v1.06 (23 August 2022) + * Added weighted prompt support contributed by [xraxra](https://github.com/xraxra) + * Example of using weighted prompts to tweak a demonic figure contributed by [bmaltais](https://github.com/bmaltais) + +* v1.05 (22 August 2022 - after the drop) + * Filenames now use the following formats: + 000010.95183149.png -- Two files produced by the same command (e.g. -n2), + 000010.26742632.png -- distinguished by a different seed. + + 000011.455191342.01.png -- Two files produced by the same command using + 000011.455191342.02.png -- a batch size>1 (e.g. -b2). They have the same seed. + + 000011.4160627868.grid#1-4.png -- a grid of four images (-g); the whole grid can + be regenerated with the indicated key + + * It should no longer be possible for one image to overwrite another + * You can use the "cd" and "pwd" commands at the dream> prompt to set and retrieve + the path of the output directory. (NOTE: Removed in v1.12) + +* v1.04 (22 August 2022 - after the drop) + * Updated README to reflect installation of the released weights. + * Suppressed very noisy and inconsequential warning when loading the frozen CLIP + tokenizer. + +* v1.03 (22 August 2022) + * The original txt2img and img2img scripts from the CompViz repository have been moved into + a subfolder named "orig_scripts", to reduce confusion. + +* v1.02 (21 August 2022) + * A copy of the prompt and all of its switches and options is now stored in the corresponding image in a tEXt metadata field named "Dream". You can read the prompt using scripts/images2prompt.py, or an image editor that allows you to explore the full metadata. **Please run "conda env update -f environment.yaml" to load the k_lms dependencies!!** diff --git a/scripts/dream.py b/scripts/dream.py index 922f9fffbf..3fb6724e2a 100755 --- a/scripts/dream.py +++ b/scripts/dream.py @@ -81,7 +81,7 @@ def main(): if not infile: print( - "\n* Initialization done! Awaiting your command (-h for help, 'q' to quit, 'cd' to change output dir, 'pwd' to print output dir)..." + "\n* Initialization done! Awaiting your command (-h for help, 'q' to quit)" ) log_path = os.path.join(opt.outdir, 'dream_log.txt') @@ -122,18 +122,6 @@ def main_loop(t2i, outdir, parser, log_path, infile): done = True break - if elements[0] == 'cd' and len(elements) > 1: - if os.path.exists(elements[1]): - print(f'setting image output directory to {elements[1]}') - outdir = elements[1] - else: - print(f'directory {elements[1]} does not exist') - continue - - if elements[0] == 'pwd': - print(f'current output directory is {outdir}') - continue - if elements[0].startswith( '!dream' ): # in case a stored prompt still contains the !dream command @@ -171,12 +159,18 @@ def main_loop(t2i, outdir, parser, log_path, infile): normalized_prompt = PromptFormatter(t2i, opt).normalize_prompt() individual_images = not opt.grid + if opt.outdir: + if not os.path.exists(opt.outdir): + os.makedirs(opt.outdir) + current_outdir = opt.outdir + else: + current_outdir = outdir # Here is where the images are actually generated! try: - file_writer = PngWriter(outdir, normalized_prompt, opt.batch_size) - callback = file_writer.write_image if individual_images else None - image_list = t2i.prompt2image(image_callback=callback, **vars(opt)) + file_writer = PngWriter(current_outdir, normalized_prompt, opt.batch_size) + callback = file_writer.write_image if individual_images else None + image_list = t2i.prompt2image(image_callback=callback, **vars(opt)) results = ( file_writer.files_written if individual_images else image_list ) @@ -394,6 +388,13 @@ def create_cmd_parser(): parser.add_argument( '-g', '--grid', action='store_true', help='generate a grid' ) + parser.add_argument( + '--outdir', + '-o', + type=str, + default=None, + help='directory in which to place generated images and a log of prompts and seeds (outputs/img-samples', + ) parser.add_argument( '-i', '--individual',