diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fd20fdd --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ + +*.pyc diff --git a/build_dynamic_prompt.py b/build_dynamic_prompt.py index b641d44..df7c083 100644 --- a/build_dynamic_prompt.py +++ b/build_dynamic_prompt.py @@ -14,6 +14,7 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artistmode = " completeprompt = " " + isphoto = 0 othertype = 0 humanspecial = 0 wereanimaladded = 0 @@ -134,16 +135,18 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artistmode = " if(mainchooser in ["object", "animal", "humanoid", "concept"] and othertype == 0 and "portait" not in completeprompt): completeprompt = add_from_csv(completeprompt, "shotsizes", 0, ""," of a ") elif("portait" in completeprompt): - completeprompt += " of a " + completeprompt += " ,close up of a " # Multiple subjects doesnt really work, need to think of other way to do multiple subjects. Maybe AND in the prompt? # if(subjectchooser in ["object", "animal", "humanoid"] and rare_dist(insanitylevel)): # completeprompt = completeprompt[:-2] # remove a from # completeprompt = add_from_csv(completeprompt, "amounts", 0, "","") + + # Common to have 1 description, uncommon to have 2 if(common_dist(insanitylevel)): completeprompt = add_from_csv(completeprompt, "descriptors", 0, "","") - if(normal_dist(insanitylevel)): + if(uncommon_dist(insanitylevel)): completeprompt = add_from_csv(completeprompt, "descriptors", 0, "","") if(subjectchooser in ["animal as human,","human", "job", "fictional", "non fictional", "humanoid"] and normal_dist(insanitylevel)): @@ -271,7 +274,7 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artistmode = " # riding an animal, holding an object or driving a vehicle, rare if(subjectchooser in ["animal as human,","human","fictional", "non fictional", "humanoid"] and rare_dist(insanitylevel)): humanspecial = 1 - speciallist = ["riding a -animal- ", "holding a -object- ", "driving a -vehicle-", "visiting a -building-"] + speciallist = [" riding a -animal- ", "holding a -object- ", " driving a -vehicle-", " visiting a -building-"] completeprompt += random.choice(speciallist) # SD understands emoji's. Can be used to manipulate facial expressions. @@ -324,16 +327,33 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artistmode = " if(subjectchooser in ["animal as human,","human","fictional", "non fictional", "humanoid"] and normal_dist(insanitylevel)): completeprompt = add_from_csv(completeprompt, "accessories", 1, "","") + # Sometimes get 2 + if(uncommon_dist(insanitylevel)): + completeprompt = add_from_csv(completeprompt, "accessories", 1, "","") - if(subjectchooser not in ["landscape", "concept"] and normal_dist(insanitylevel)): - completeprompt = add_from_csv(completeprompt, "locations", 1, " background is ","") + if(subjectchooser not in ["landscape", "concept"] and humanspecial != 1 and normal_dist(insanitylevel)): + backgroundtype = ["landscape", "buildingbackground", "insidebuilding"] + match random.choice(backgroundtype): + case "landscape": + completeprompt = add_from_csv(completeprompt, "locations", 1, " background is ","") + case "buildingbackground": + completeprompt = ",background is " + if(uncommon_dist(insanitylevel)): + completeprompt = add_from_csv(completeprompt, "descriptors", 0, "","") + completeprompt = add_from_csv(completeprompt, "buildings", 0, "","") + case "insidebuilding": + completeprompt = ",inside a " + if(uncommon_dist(insanitylevel)): + completeprompt = add_from_csv(completeprompt, "descriptors", 0, "","") + completeprompt = add_from_csv(completeprompt, "buildings", 0, "","") - if(normal_dist(insanitylevel)): + # landscapes it is nice to always have a time period + if(normal_dist(insanitylevel) or subjectchooser=="landscape"): completeprompt = add_from_csv(completeprompt, "timeperiods", 1, "","") if(mainchooser not in ["landscape"] and normal_dist(insanitylevel)): @@ -352,7 +372,16 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artistmode = " if(normal_dist(insanitylevel)): completeprompt = add_from_csv(completeprompt, "lighting", 1, "","") - if(normal_dist(insanitylevel)): + # determine wether we have a photo or not + if("hoto" in completeprompt): + isphoto = 1 + if(common_dist(insanitylevel)): + completeprompt += ", film grain" + + if(isphoto == 1): + completeprompt = add_from_csv(completeprompt, "cameras", 1, "","") + + if(normal_dist(insanitylevel) or isphoto == 1): completeprompt = add_from_csv(completeprompt, "lenses", 1, "","") if(normal_dist(insanitylevel)): diff --git a/csvfiles/accessories.csv b/csvfiles/accessories.csv index 38d2778..1b3dc06 100644 --- a/csvfiles/accessories.csv +++ b/csvfiles/accessories.csv @@ -88,4 +88,9 @@ Freckles Medallion Crown Tiara -Mask made out of -material- \ No newline at end of file +Mask made out of -material- +angelic halo +wrinkles +pores +Makeup +No makeup \ No newline at end of file diff --git a/csvfiles/buildings.csv b/csvfiles/buildings.csv index fb8aaef..45b4631 100644 --- a/csvfiles/buildings.csv +++ b/csvfiles/buildings.csv @@ -30,7 +30,7 @@ Skyscraper Tower Shopping mall Department store -Supermarket +Market Grocery store Convenience store Restaurant diff --git a/csvfiles/cameras.csv b/csvfiles/cameras.csv new file mode 100644 index 0000000..18e7abd --- /dev/null +++ b/csvfiles/cameras.csv @@ -0,0 +1,22 @@ +Fujifilm XT3 +Canon 5d mark 4 +Nikon d3300 +Canon eos 5d mark 4 +Sony A7 +Nikon d850 +Phase One XF IQ4 150MP +Nikon Z9 +Iphone X +Samsung Galaxy +compact camera +film camera +Polaroid +Kodak portra 400 +Kodak portra 800 +Canon RF +Canon EF +Canon R5 +Hasselblad +Kodak gold 200 +Nikon d850 +Sony A9 II \ No newline at end of file diff --git a/csvfiles/colors.csv b/csvfiles/colors.csv index 442cb4e..a9bd2ac 100644 --- a/csvfiles/colors.csv +++ b/csvfiles/colors.csv @@ -32,6 +32,7 @@ Colorful Colorless Vivid Vibrant +Neutral Iridescent Neon Lime green \ No newline at end of file diff --git a/csvfiles/colorscheme.csv b/csvfiles/colorscheme.csv index 1089eb1..f3f4887 100644 --- a/csvfiles/colorscheme.csv +++ b/csvfiles/colorscheme.csv @@ -55,4 +55,5 @@ Vivid colors -color- neon hue -color- and -color- hue -color- and -color- neon hue --color- color grading \ No newline at end of file +-color- color grading +psychedelic colors \ No newline at end of file diff --git a/csvfiles/descriptors.csv b/csvfiles/descriptors.csv index 3b231b4..6209272 100644 --- a/csvfiles/descriptors.csv +++ b/csvfiles/descriptors.csv @@ -323,4 +323,9 @@ Cartoony 1800's 1700's 1600's -Luminescent \ No newline at end of file +Luminescent +Floating +Shiny +Chibi +Anime +Verdant \ No newline at end of file diff --git a/csvfiles/haircolors.csv b/csvfiles/haircolors.csv index e7cd336..e6df183 100644 --- a/csvfiles/haircolors.csv +++ b/csvfiles/haircolors.csv @@ -8,4 +8,5 @@ Caramel Honey Platinum Gray +Bald -color- \ No newline at end of file diff --git a/csvfiles/imagetypes.csv b/csvfiles/imagetypes.csv index a4f88e1..7278b2c 100644 --- a/csvfiles/imagetypes.csv +++ b/csvfiles/imagetypes.csv @@ -1,7 +1,5 @@ RAW photo Photograph -Polaroid -Fujifilm Color splash Digital artwork Digital art @@ -33,4 +31,5 @@ Unreal Engine VRay Abstract Fractal -Portait \ No newline at end of file +Portait +Raw digital photo \ No newline at end of file diff --git a/csvfiles/jobs.csv b/csvfiles/jobs.csv index ab315ad..cdd87ba 100644 --- a/csvfiles/jobs.csv +++ b/csvfiles/jobs.csv @@ -353,4 +353,6 @@ Count Countess Baron Baroness -Nobleman \ No newline at end of file +Nobleman +Vizier +Sultan \ No newline at end of file diff --git a/csvfiles/lenses.csv b/csvfiles/lenses.csv index c994dae..824f96f 100644 --- a/csvfiles/lenses.csv +++ b/csvfiles/lenses.csv @@ -1,7 +1,9 @@ -overhead angle Zoom lens Depth of field 100mm Depth of field 270mm +80mm +50mm +35mm F/1.8 F/2.8 F/5 @@ -13,4 +15,5 @@ Selective focus Fish-eye Lens telephoto lens 800mm lens -macro lens \ No newline at end of file +macro lens +L USM \ No newline at end of file diff --git a/csvfiles/locations.csv b/csvfiles/locations.csv index f42b904..cff11b0 100644 --- a/csvfiles/locations.csv +++ b/csvfiles/locations.csv @@ -653,4 +653,6 @@ Riften Stormwind Orgrimmar Ironforge -Tristram \ No newline at end of file +Tristram +cityscape +paradise \ No newline at end of file diff --git a/csvfiles/materials.csv b/csvfiles/materials.csv index 3759e28..a7b6846 100644 --- a/csvfiles/materials.csv +++ b/csvfiles/materials.csv @@ -103,4 +103,7 @@ Titanium Brass Gems Crystal -Emerald \ No newline at end of file +Emerald +Wires +Plating +Fabric \ No newline at end of file diff --git a/csvfiles/nonfictional characters.csv b/csvfiles/nonfictional characters.csv index 783e273..2f6e6a3 100644 --- a/csvfiles/nonfictional characters.csv +++ b/csvfiles/nonfictional characters.csv @@ -115,6 +115,7 @@ Anne Hathaway Natalie Portman Mila Kunis Emma Stone +Anya Taylor-Joy Keira Knightley Julianne Moore Viola Davis diff --git a/csvfiles/objects.csv b/csvfiles/objects.csv index f93f227..23b02f1 100644 --- a/csvfiles/objects.csv +++ b/csvfiles/objects.csv @@ -377,4 +377,5 @@ Marigolds -object- in a bottle Cup of Coffee Cup of Tea -Faberge egg \ No newline at end of file +Faberge egg +Quilt \ No newline at end of file diff --git a/csvfiles/othertypes.csv b/csvfiles/othertypes.csv index 77ccd4d..da2bcf1 100644 --- a/csvfiles/othertypes.csv +++ b/csvfiles/othertypes.csv @@ -68,4 +68,9 @@ Playing card Fantasy concept art Cartoon Mixed media -Cover Art \ No newline at end of file +Cover Art +Historical Photo +Associated press photo +editorial illustration +digital sculpture made of -material- +Fashion shoot \ No newline at end of file diff --git a/csvfiles/outfits.csv b/csvfiles/outfits.csv index 1a31702..2972261 100644 --- a/csvfiles/outfits.csv +++ b/csvfiles/outfits.csv @@ -90,14 +90,14 @@ Athletic shorts Bermudas High-waisted shorts Low-waisted shorts -Playsuits -Overalls -Blazers -Cardigans -Hoodies -Sweatshirts -T-shirts -Tank tops +Playsuit +Overall +Blazer +Cardigan +Hoodie +Sweatshirt +T-shirt +Tank top High-waisted pants and crop top Maxi skirt and tank top Blazer and jeans @@ -194,6 +194,7 @@ Nightshirt and leggings Satin or silk chemise Babydoll Kimono +Wedding dress Sari Hanbok Dirndl diff --git a/csvfiles/quality.csv b/csvfiles/quality.csv index 0a88a00..eb75550 100644 --- a/csvfiles/quality.csv +++ b/csvfiles/quality.csv @@ -24,4 +24,6 @@ octane engine ultra high res masterpiece lots of details -dslr \ No newline at end of file +dslr +photolab +adobe lightroom \ No newline at end of file diff --git a/csvfiles/shotsizes.csv b/csvfiles/shotsizes.csv index e97c38c..564f443 100644 --- a/csvfiles/shotsizes.csv +++ b/csvfiles/shotsizes.csv @@ -32,4 +32,6 @@ over the shoulder shot selfie shot angle High exposure Aerial View -cinematic shot \ No newline at end of file +cinematic shot +overhead angle +Sharp focus \ No newline at end of file diff --git a/csvfiles/timeperiods.csv b/csvfiles/timeperiods.csv index 2681487..76780d3 100644 --- a/csvfiles/timeperiods.csv +++ b/csvfiles/timeperiods.csv @@ -21,4 +21,6 @@ Snowing Raining Clear skies Sunny -Bathed in shadows \ No newline at end of file +Bathed in shadows +Thunderstorm +Foggy \ No newline at end of file diff --git a/csvfiles/vomit.csv b/csvfiles/vomit.csv index 60b850f..da595c8 100644 --- a/csvfiles/vomit.csv +++ b/csvfiles/vomit.csv @@ -1,5 +1,6 @@ Golden ratio Rule of Thirds +dynamic composition -color- outlines Paint splotches Light streaks @@ -11,7 +12,7 @@ made of -material- -color- and -color- dust particles inticrate details behance -geometric pattern +geometric patterns raytraced reflections delicate opulent @@ -25,4 +26,12 @@ Swirling Ribbons Spirals -color- explosions -Folded -material- \ No newline at end of file +Folded -material- +-color- lightning bolts +under water +halation +bloom +caustics +Swirling -material- +vignette +Instagram \ No newline at end of file diff --git a/main.py b/main.py index 612e043..62b9ed9 100644 --- a/main.py +++ b/main.py @@ -19,7 +19,7 @@ steps = 0 while steps < loops: # build prompt - randomprompt = build_dynamic_prompt(5,"all","all","all") + randomprompt = build_dynamic_prompt(7,"all","all","all") # prompt + size diff --git a/scripts/onebuttonprompt.py b/scripts/onebuttonprompt.py index ea4eab0..5e2118d 100644 --- a/scripts/onebuttonprompt.py +++ b/scripts/onebuttonprompt.py @@ -25,7 +25,7 @@ class Script(scripts.Script): def ui(self, is_img2img): with gr.Tab("Main"): with gr.Row(): - insanitylevel = gr.Slider(1, 10, value=5, step=1, label="Higher levels increases complexity and randomness of generated prompt") + insanitylevel = gr.Slider(1, 10, value=7, step=1, label="Higher levels increases complexity and randomness of generated prompt") with gr.Row(): with gr.Column(): subject = gr.Dropdown(