Skip to content

Instantly share code, notes, and snippets.

@jakericedesigns
Created September 5, 2022 00:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakericedesigns/6e8b10dd2912e3a36ba7051f4a39f4d7 to your computer and use it in GitHub Desktop.
Save jakericedesigns/6e8b10dd2912e3a36ba7051f4a39f4d7 to your computer and use it in GitHub Desktop.
Generates random stable diffusion outputs based off some random words I found on the internet
#Save this in the Stable Diffusions scripts folder
#and then to use it, from the stable diffusions root folder, run: python scripts/launch_random_text2img.py
import random
import subprocess as s
import os
nouns = ["race car","pirate ship","palm trees","tulips","pine cone","space ship","box of candy","sunflowers in a vase","koala bear","angry dog","candy corn","cupcake (with sprinkles!)","sleepy tiger","pizza","disco ninja","girl with really long hair","cookies","sad lady","snake charmer","hula girl","ice cream cone","bottle of poison","flamingo","football","fried egg","red haired man","zombie","mummy","popcorn","vampire","man with a scar","a sword fighter","duck","easter eggs","flaming skull","dolphin","sunflowers in a vase","panda","cobra","happy pig","oreos and milk","monkey in a hat","bunny","gnome","fairy","evil queen","diamond ring","birthday present","hot air balloon","cake with candles","Godzilla","guy with long nails","rooster","dragon","shamrocks","castle","log cabin","tee pee (or tipi)","igloo","octopus","bodybuilder","carousel horse","shooting star","toucan","flute","saxophone","violin","bird house","seal","Dachshund","football helmet","hockey stick","planets","Happy Clown","Scary Clown","train","dog in pants","mermaid","waffles","lady in an apron","bacon","cup of coffee","baseball player","ballerina","worm in an apple","kleenex","hamburger","girl with a cast","crying baby","angel","mean Santa","paintbrushes","fat man in plaid pants","police officer","red wagon","garbage can","dwarf","Zebra in colors (not black and white)","Gumball machine","Bush Baby"]
adjectives = "high detail, vibrant colors, concept art, surrealism, hyperrealism, ultrarealism, gigarealism, 8 k, octane render, unreal engine, digital painting, deviant art, by artgerm, pascal blanche, kait kybar, trending on artstation, greg rutkowski, young, attractive, highly detailed portrait, scifi, digital painting, artstation, concept art, smooth, sharp foccus ilustration, artstation hq, baroque oil painting anime key visual full body portrait, flowing blonde hair blue eyes, tight black leather military commander uniform, garter belt skirt, gap moe kuudere noble grimdark dictator, trending pixiv fanbox, by makoto shinkai takashi takeuchi studio ghibli jamie wyeth, wlop, ilya kuvshinov, artgerm, krenz cushart, greg rutkowski, hiroaki samura, range murata, james jean, katsuhiro otomo, erik jones, giger, zdzisław beksinski,half body, glowin eyes, d & d, fantasy, intricate, elegant, highly detailed, colorful, vivid color, digital painting, artstation, concept art, art by artgerm and alphonse mucha and ruan jia, simpsons character, realistic portrait, symmetrical, highly detailed, digital painting, artstation, concept art, smooth, sharp focus, illustration, cinematic lighting, art by artgerm and alphonse mucha, asymmetrical!! demon art, intricate, elegant, highly detailed, digital painting, artstation, biolusence, concept art, smooth, sharp focus, illustration, art by alphonse mucha, horizon zero dawn 8 k, concept art, studio ghibli, extremely high quality artwork, oil on canvas, gustave dore, zdzislaw beksinski, highly detailed painting by gaston bussiere, craig mullins, diffuse lighting, fantasy, intricate, highly detailed, lifelike, photorealistic, digital painting, artstation, illustration, concept art, smooth, sharp focus, art by john collier and albert aublet and krenz cushart"
adjectives = adjectives.split(",")
settings = ["Abandoned Mine", "Airplane", "Airport Check-in", "Alley", "Amusement Park", "Attic", "Bakery", "Bank", "Basement", "Bathroom", "Barn", "Beach", "Bedrooms", "Birthday Party", "Bonfire", "Bowling Alley", "Bridge", "Bookstore", "Cafeteria", "Casino", "Catacombs", "Cave", "Church", "City Park", "Classroom", "Closet", "Coffee House", "Courtroom", "Cruise Ship", "Cryogenic Sleep Chamber", "Daycare", "Desert", "Diner", "Dragon’s Lair", "Dungeon ", "Egyptian Pyramids", "Elevator", "Farms", "Forest", "Frozen Tundra", "Gallows", "Garage", "Garage Sale", "Garden", "Graveyard", "GLOBAL WARMING", "Grocery Store", "Halloween Party", "Haunted House", "Herbalist Shop", "High School Hallway", "Hospital", "Hotel Room", "House Fire", "House Party", "Kitchen", "Laboratory", "Laboratory ", "Lake", "Library", "Locker Room", "Meadow", "Medieval Castle Armory", "Medieval Marketplace", "Middle School Dance ", "Mountains", "Movie Theatre", "Night Club", "Nursery", "Ocean/Sea Bed", "Old Pick-Up Truck", "Pirate Ship", "Playground", "Pond", "Pool Hall", "Prison Cell", "Pub", "Public Pool", "Rainforest/Jungle", "Ranch", "Restaurant", "River", "School Bus", "School Office", "Shopping Mall", "Sleep-Away Camp", "Spaceport", "Spaceship", "Stands at a Sporting Event", "Storm Sewer", "Subway Station", "Swamp", "Taxi cab", "Teacher’s Lounge", "Toolshed", "Trailer", "Treehouse", "Tropical Island City", "Urban Street", "Video Arcade", "Waiting Room", "Waterfall", "Water Slide Park", "Wedding Ceremony", "Woods at Night", "Zoo"]
number_of_prompts_to_try = 50
for _ in range(0, number_of_prompts_to_try):
number_of_adjectives = random.randint(2,15)
actual_adjectives = random.choices(adjectives, k=number_of_adjectives)
actual_noun = random.choice(nouns)
actual_setting = ""
if random.randint(0,4) > 1:
actual_setting = " in a " + random.choice(settings)
final = actual_noun + actual_setting + ", " + ", ".join(actual_adjectives)
print(final)
s.call(["python", "scripts/txt2img.py", "--prompt", final, "--plms"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment