From da402e9067a39252c6a7aa4aeb2a0621a01e2a25 Mon Sep 17 00:00:00 2001 From: AIrjen Date: Mon, 10 Apr 2023 15:58:46 +0200 Subject: [PATCH] Fix for branches --- build_dynamic_prompt.py | 12 +++++++++++- csvfiles/accessories.csv | 6 +++++- csvfiles/animals.csv | 6 +++++- csvfiles/buildings.csv | 4 +++- csvfiles/colors.csv | 3 ++- csvfiles/concept_prefix.csv | 4 +++- csvfiles/concept_suffix.csv | 5 ++++- csvfiles/descriptors.csv | 20 +++++++++++++++++++- csvfiles/fictional characters.csv | 4 +++- csvfiles/humanoids.csv | 29 ++++++++++++++++++++++++++++- csvfiles/locations.csv | 17 ++++++++++++++++- csvfiles/materials.csv | 2 +- csvfiles/objects.csv | 5 ++++- csvfiles/othertypes.csv | 5 ++++- csvfiles/vomit.csv | 5 ++++- main.py | 2 +- scripts/onebuttonprompt.py | 24 +++++++++++++++++------- 17 files changed, 130 insertions(+), 23 deletions(-) diff --git a/build_dynamic_prompt.py b/build_dynamic_prompt.py index aaa6b76..b641d44 100644 --- a/build_dynamic_prompt.py +++ b/build_dynamic_prompt.py @@ -292,7 +292,7 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artistmode = " completeprompt = add_from_csv(completeprompt, "human_activities", 1, "","") if(subjectchooser in ["animal as human","human","job", "fictional", "non fictional", "humanoid"] and legendary_dist(insanitylevel)): - completeprompt += " with -color- skin, " + completeprompt += ", with -color- skin, " # outfit builder if(subjectchooser in ["animal as human","human","fictional", "non fictional", "humanoid"] and normal_dist(insanitylevel)): @@ -418,7 +418,17 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artistmode = " while "-animal-" in completeprompt: completeprompt = completeprompt.replace('-animal-', random.choice(animallist),1) + completeprompt = re.sub('\[ ', '[', completeprompt) + completeprompt = re.sub(' \]', ']', completeprompt) + completeprompt = re.sub(' \|', '|', completeprompt) + completeprompt = re.sub(' \"', '\"', completeprompt) + completeprompt = re.sub('\" ', '\"', completeprompt) + completeprompt = re.sub('\( ', '(', completeprompt) + completeprompt = re.sub(' \(', '(', completeprompt) + completeprompt = re.sub('\) ', ')', completeprompt) + completeprompt = re.sub(' \)', ')', completeprompt) + completeprompt = re.sub(',,', ',', completeprompt) completeprompt = re.sub(', ,', ',', completeprompt) completeprompt = re.sub(' , ', ',', completeprompt) completeprompt = re.sub(' +', ' ', completeprompt[2:]) # remove first character, that is always a comma. Remove any excess spaces diff --git a/csvfiles/accessories.csv b/csvfiles/accessories.csv index c509f6e..64c24db 100644 --- a/csvfiles/accessories.csv +++ b/csvfiles/accessories.csv @@ -81,4 +81,8 @@ Cat Ears Tail Tattoos Scars -large -color- eyes \ No newline at end of file +large -color- eyes +glowing -color- eyes +Horns +Freckles +Medallion \ No newline at end of file diff --git a/csvfiles/animals.csv b/csvfiles/animals.csv index e01f9ae..ac8ad05 100644 --- a/csvfiles/animals.csv +++ b/csvfiles/animals.csv @@ -1,3 +1,7 @@ +animal +creature +Fish +bird puppy dog cat badger @@ -44,6 +48,7 @@ Shrimp Clam Oyster Snail +Ladybird Slug Ant Bee @@ -145,7 +150,6 @@ Giant bee Giant wasp Giant bat Roc -Thunderbird Yeti Sasquatch Bigfoot diff --git a/csvfiles/buildings.csv b/csvfiles/buildings.csv index a7e77c9..fb8aaef 100644 --- a/csvfiles/buildings.csv +++ b/csvfiles/buildings.csv @@ -12,6 +12,7 @@ Palace Cathedral Church Temple +Shrine Mosque Synagogue Library @@ -148,4 +149,5 @@ Quarry Wind turbine Nuclear missile silo Dungeon -Gate \ No newline at end of file +Gate +Botanical Garden \ No newline at end of file diff --git a/csvfiles/colors.csv b/csvfiles/colors.csv index e1f340e..442cb4e 100644 --- a/csvfiles/colors.csv +++ b/csvfiles/colors.csv @@ -33,4 +33,5 @@ Colorless Vivid Vibrant Iridescent -Neon \ No newline at end of file +Neon +Lime green \ No newline at end of file diff --git a/csvfiles/concept_prefix.csv b/csvfiles/concept_prefix.csv index 060c224..259281a 100644 --- a/csvfiles/concept_prefix.csv +++ b/csvfiles/concept_prefix.csv @@ -80,4 +80,6 @@ Eye Father Mother Gates -Dungeon \ No newline at end of file +Dungeon +Conjurer +Garden \ No newline at end of file diff --git a/csvfiles/concept_suffix.csv b/csvfiles/concept_suffix.csv index 0fa7833..875786a 100644 --- a/csvfiles/concept_suffix.csv +++ b/csvfiles/concept_suffix.csv @@ -65,4 +65,7 @@ Ancients Longing Doom Heaven -Hell \ No newline at end of file +Hell +Elements +Earth +Bounty \ No newline at end of file diff --git a/csvfiles/descriptors.csv b/csvfiles/descriptors.csv index 95653b2..3b231b4 100644 --- a/csvfiles/descriptors.csv +++ b/csvfiles/descriptors.csv @@ -111,6 +111,7 @@ Foul Loathsome Abominable Horrid +Happy Horrifying Terrible Gruesome @@ -226,6 +227,8 @@ Victorian Viking Maximalist Bohemian +Glad +Folded Glam Chic Japandi @@ -305,4 +308,19 @@ Fluid Burning Flaming Feminine -Masculine \ No newline at end of file +Masculine +Cartoony +2000's +1990's +1980's +1970's +1960's +1950's +1940's +1940's +1920's +1900's +1800's +1700's +1600's +Luminescent \ No newline at end of file diff --git a/csvfiles/fictional characters.csv b/csvfiles/fictional characters.csv index ac6cc7b..2c3c3e7 100644 --- a/csvfiles/fictional characters.csv +++ b/csvfiles/fictional characters.csv @@ -513,4 +513,6 @@ Eevee Gyarados Dragonite John Wick -Captain -material-beard \ No newline at end of file +Captain -material-beard +-animal-man +Poison Ivy from Batman \ No newline at end of file diff --git a/csvfiles/humanoids.csv b/csvfiles/humanoids.csv index 59a0008..941da65 100644 --- a/csvfiles/humanoids.csv +++ b/csvfiles/humanoids.csv @@ -90,4 +90,31 @@ Werewolf Gorgon Centaur Satyr -Faun \ No newline at end of file +Faun +Nightelf +Drow +Dunmer +Altmer +High elf +Argonian +Bosmer +Khajit +Orsimer +Redguard +Dwemer +Falmer +Atronach +Daedra +Draugr +Fremen +Mentat +Bene Gesserit +Draenei +Worgen +Pandaren +Undead +Dracthyr +Tauren +Bloodelf +Voidelf +Zandalari \ No newline at end of file diff --git a/csvfiles/locations.csv b/csvfiles/locations.csv index 4e67699..b8d8104 100644 --- a/csvfiles/locations.csv +++ b/csvfiles/locations.csv @@ -637,4 +637,19 @@ Landfill Mountain Statue of Liberty Biosphere -Tropical Island \ No newline at end of file +Tropical Island +Elder scrolls +Whiterun +Tamriel +Cyrodiil +Morrowind +Oblivion +Skyrim +Hammerfell +Bruma +Balmora +Vivec City +Riften +Stormwind +Orgrimmar +Ironforge \ No newline at end of file diff --git a/csvfiles/materials.csv b/csvfiles/materials.csv index 76c3d31..3759e28 100644 --- a/csvfiles/materials.csv +++ b/csvfiles/materials.csv @@ -90,7 +90,7 @@ Donegal tweed Camel hair Kashmiri shawls Waxed cotton -Sashiko cloth +Cloth Gold Silver Iron diff --git a/csvfiles/objects.csv b/csvfiles/objects.csv index d472e64..f93f227 100644 --- a/csvfiles/objects.csv +++ b/csvfiles/objects.csv @@ -374,4 +374,7 @@ Poppies Hydrangeas Irises Marigolds --object- in a bottle \ No newline at end of file +-object- in a bottle +Cup of Coffee +Cup of Tea +Faberge egg \ No newline at end of file diff --git a/csvfiles/othertypes.csv b/csvfiles/othertypes.csv index 450b5c5..77ccd4d 100644 --- a/csvfiles/othertypes.csv +++ b/csvfiles/othertypes.csv @@ -65,4 +65,7 @@ Movie poster -material- Tarot card Playing card -Fantasy concept art \ No newline at end of file +Fantasy concept art +Cartoon +Mixed media +Cover Art \ No newline at end of file diff --git a/csvfiles/vomit.csv b/csvfiles/vomit.csv index 47256ed..60b850f 100644 --- a/csvfiles/vomit.csv +++ b/csvfiles/vomit.csv @@ -22,4 +22,7 @@ sunbeam Film grain crisp lines Swirling --color- explosions \ No newline at end of file +Ribbons +Spirals +-color- explosions +Folded -material- \ No newline at end of file diff --git a/main.py b/main.py index 24373f3..612e043 100644 --- a/main.py +++ b/main.py @@ -19,7 +19,7 @@ steps = 0 while steps < loops: # build prompt - randomprompt = build_dynamic_prompt(5,"animal","all","all") + randomprompt = build_dynamic_prompt(5,"all","all","all") # prompt + size diff --git a/scripts/onebuttonprompt.py b/scripts/onebuttonprompt.py index 94acd78..ea4eab0 100644 --- a/scripts/onebuttonprompt.py +++ b/scripts/onebuttonprompt.py @@ -102,21 +102,31 @@ class Script(scripts.Script): def run(self, p, insanitylevel, subject, artist, imagetype): images = [] + infotexts = [] if p.prompt != "": print("Prompt is not empty, adding current prompt to the end of the generated prompt") batches = p.n_iter - print(batches) + initialbatchsize = p.batch_size + batchsize = p.batch_size + p.n_iter = 1 + p.batch_size = 1 + - # todo: somehow it duplicates the batch when handling multiple batches. To fix! for i in range(batches): p.prompt = build_dynamic_prompt(insanitylevel,subject,artist, imagetype) + ", " + p.prompt # add existing prompt to the back? - print(i) - processed = process_images(p) - images += processed.images + for j in range(batchsize): + + processed = process_images(p) + images += processed.images + infotexts += processed.infotexts - # just return the prompt, and webui will do the rest + # Only move up a seed, when there are multiple batchsizes, and we had the first one done. + if(initialbatchsize != 1): + p.seed += 1 + + # just return all the things p.n_iter = 0 p.batch_size = 0 - return Processed(p=p, images_list=images) \ No newline at end of file + return Processed(p=p, images_list=images, info=infotexts[0], infotexts=infotexts) \ No newline at end of file