Prompt variation generation, descriptive filenames, flags to disable filters#233
Open
StuartRiffle wants to merge 1 commit intoCompVis:mainfrom
Open
Prompt variation generation, descriptive filenames, flags to disable filters#233StuartRiffle wants to merge 1 commit intoCompVis:mainfrom
StuartRiffle wants to merge 1 commit intoCompVis:mainfrom
Conversation
…t filter and watermark
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(1) I added an option
--generate_prompts, which lets you use curly braces to generate variations of a prompt, so that they can all be processed in one run without reloading the model, as if they were supplied in a text file.The prompt
"A {red, really big blue, } {dog, cat}"will generate six outputs:Note that the first set of curly braces has an empty entry at the end, which is replaced by nothing in the prompt.
This is good for trying different combinations of magic style words at the end of your prompt ("35mm", "oil painting", etc). I will often just type everything I can think of, then let it crunch away in the background while I do other stuff.
(2) I also added some flags to allow for more descriptive filenames for the output images:
--prompt_in_nameputs the user's prompt (sanitized for illegal characters) into the filename--meta_in_nameappends the number of iterations, the seed, and a few other values into the filename--skip_numberingmeans to not put a five digit index at the start of the filenameFor example, the prompt "A red cat" with
--prompt_in_nameand--meta_in_name, produces something like:And if you use
--skip_numberingyou just get:A problem with doing this is that depending on the prompt, the filename can be too long for the filesystem and fail to write. This PR handles that by just falling back to the five digit number, and outputting a warning. This is especially likely to happen if the metadata is also on. Maybe that part should be shorter?
(3) I added command line switches to disable the content filter and the watermark to save GPU memory when processing large batches. This allowed me to bump up my local image resolution a little bit (and also keep surprise rickrolls out of batch output).
--skip_safetydisables detection and filtering of objectionable content--skip_watermarkdisables the watermark to flag images as computer generated(4) The command line option
--seedinterprets a special seed of zero to mean "random". The batch will start with a random seed, and subsequent images use that seed +1, +2, etc.