Last active
June 8, 2022 21:53
-
-
Save neuman/b13df2fcc4cabc0822e3dc16a00f9709 to your computer and use it in GitHub Desktop.
Disco Diffusion Prompt Generator.py
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
import random | |
hash_tag_string = "" | |
description_text_string = "" | |
# return bool(random.getrandbits(1)) | |
# [subject]}, [prepositional details]}, [setting]}, [meta modifiers and artist] | |
# a beautiful symmetrical painting of a lighthouse at sunset, overlooking a calm ocean, as seen from below, by thomas kinkade | |
#"FORMULA": ["MEDIA_TYPES","THINGS","PLACES","VIEWPOINTS","ARTISTS","MODIFIERS"], | |
CORPUS = { | |
"FORMULA": ["MEDIA_TYPES","THINGS","THINGS","ARTISTS", "ARTISTS","MODIFIERS"], | |
"MEDIA_TYPES":{ | |
"pre":" ", | |
"post":"", | |
"is_hashtag":False, | |
"weight":70, | |
"items":[ | |
{ | |
"text":"A beautiful painting of", | |
"hashtags":['painting','art', 'ai', 'discodiffusion'], | |
"weight":100 | |
}, | |
{ | |
"text":"A symmetrical portrait painting of", | |
"hashtags":["mirror", 'machineLearning','discodiffusion'], | |
"weight":100 | |
}, | |
{ | |
"text":"A beautiful illustration of", | |
"hashtags":['drawing', 'ml','discodiffusion'], | |
"weight":100 | |
}, | |
{ | |
"text":"A beautiful sketch of", | |
"hashtags":['sketching', 'ml','discodiffusion'], | |
"weight":100 | |
}, | |
{ | |
"text":"An 80's movie poster of", | |
"hashtags":['sketching', 'ml','discodiffusion'], | |
"weight":100 | |
} | |
] | |
}, | |
"THINGS":{ | |
"pre":" ", | |
"post":"", | |
"is_hashtag":False, | |
"weight":100, | |
"items":[ | |
{ | |
"text":"a teddy bear", | |
"hashtags":['cute'], | |
"weight":100 | |
}, | |
{ | |
"text":"an elephant", | |
"hashtags":["animals"], | |
"weight":100 | |
}, | |
{ | |
"text":"a submarine", | |
"hashtags":['vehicles'], | |
"weight":100 | |
}, | |
{ | |
"text":"a biodome", | |
"hashtags":['architecture'], | |
"weight":100 | |
}, | |
{ | |
"text":"a building", | |
"hashtags":['architecture'], | |
"weight":100 | |
}, | |
{ | |
"text":"a city", | |
"hashtags":['architecture', 'urban'], | |
"weight":100 | |
}, | |
{ | |
"text":"a crowd", | |
"hashtags":['people'], | |
"weight":100 | |
}, | |
{ | |
"text":"a car", | |
"hashtags":['vehicles', 'cars'], | |
"weight":100 | |
}, | |
{ | |
"text":"a fighter jet", | |
"hashtags":['vehicles', 'airplanes'], | |
"weight":100 | |
}, | |
{ | |
"text":"a rocketship", | |
"hashtags":['vehicles', 'space', 'spaceship'], | |
"weight":100 | |
}, | |
{ | |
"text":"a spaceship", | |
"hashtags":['vehicles', 'space', 'spaceship'], | |
"weight":100 | |
}, | |
{ | |
"text":"a robot", | |
"hashtags":['machines'], | |
"weight":100 | |
}, | |
{ | |
"text":"a monkey", | |
"hashtags":["animals"], | |
"weight":100 | |
}, | |
{ | |
"text":"a lion", | |
"hashtags":["animals"], | |
"weight":100 | |
}, | |
{ | |
"text":"an alligator", | |
"hashtags":["animals"], | |
"weight":100 | |
}, | |
{ | |
"text":"a bird", | |
"hashtags":["animals"], | |
"weight":100 | |
}, | |
{ | |
"text":"a fish", | |
"hashtags":["animals"], | |
"weight":100 | |
}, | |
{ | |
"text":"a squid", | |
"hashtags":["animals"], | |
"weight":100 | |
}, | |
{ | |
"text":"an octopus", | |
"hashtags":["animals"], | |
"weight":100 | |
}, | |
{ | |
"text":"a computer", | |
"hashtags":['machines'], | |
"weight":100 | |
}, | |
{ | |
"text":"a phone", | |
"hashtags":['tech'], | |
"weight":100 | |
}, | |
{ | |
"text":"a gadget", | |
"hashtags":['tech'], | |
"weight":100 | |
}, | |
{ | |
"text":"bugs bunny", | |
"hashtags":['cartoon', 'character'], | |
"weight":100 | |
}, | |
{ | |
"text":"mario", | |
"hashtags":['nintendo','gaming','retro','8bit'], | |
"weight":100 | |
}, | |
{ | |
"text":"sonic the hedgehog", | |
"hashtags":['videogame','sega','retro'], | |
"weight":100 | |
}, | |
{ | |
"text":"kermit the frog", | |
"hashtags":['muppets'], | |
"weight":100 | |
}, | |
{ | |
"text":"mickey mouse", | |
"hashtags":['cartoon', 'character'], | |
"weight":100 | |
}, | |
{ | |
"text":"homer simpson", | |
"hashtags":['cartoon', 'character'], | |
"weight":100 | |
}, | |
{ | |
"text":"steven universe", | |
"hashtags":['cartoon', 'character'], | |
"weight":100 | |
}, | |
{ | |
"text":"the owl house", | |
"hashtags":['cartoon', 'character'], | |
"weight":100 | |
}, | |
{ | |
"text":"star vs the forces of evil", | |
"hashtags":['cartoon', 'character'], | |
"weight":100 | |
}, | |
{ | |
"text":"darth vader", | |
"hashtags":['starwars'], | |
"weight":100 | |
}, | |
{ | |
"text":"luke skywalker", | |
"hashtags":['starwars'], | |
"weight":100 | |
}, | |
{ | |
"text":"han solo", | |
"hashtags":['starwars'], | |
"weight":100 | |
}, | |
{ | |
"text":"bowser", | |
"hashtags":['nintendo','mario','retro'], | |
"weight":100 | |
}, | |
{ | |
"text":"princess peach", | |
"hashtags":['nintendo','mario','retro'], | |
"weight":100 | |
}, | |
{ | |
"text":"totoro", | |
"hashtags":['gibli','animation'], | |
"weight":100 | |
}, | |
{ | |
"text":"chewbacca", | |
"hashtags":['starwars'], | |
"weight":100 | |
}, | |
{ | |
"text":"princess leia", | |
"hashtags":['starwars'], | |
"weight":100 | |
}, | |
{ | |
"text":"daffy duck", | |
"hashtags":['cartoon'], | |
"weight":100 | |
}, | |
{ | |
"text":"wolverine", | |
"hashtags":['mcu','xmen','comics'], | |
"weight":100 | |
}, | |
{ | |
"text":"cyclops", | |
"hashtags":['mcu','xmen','comics'], | |
"weight":100 | |
}, | |
{ | |
"text":"deadpool", | |
"hashtags":['mcu','xmen','comics'], | |
"weight":100 | |
}, | |
{ | |
"text":"harley quinn", | |
"hashtags":['dcu','batman','comics'], | |
"weight":100 | |
}, | |
{ | |
"text":"the mandolorian", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"doctor strange", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"captain america", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"loki", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"fin and jake", | |
"hashtags":['cartoon', 'character'], | |
"weight":100 | |
}, | |
{ | |
"text":"princess bubblegum", | |
"hashtags":['cartoon', 'character'], | |
"weight":100 | |
}, | |
{ | |
"text":"marceline", | |
"hashtags":['cartoon', 'character'], | |
"weight":100 | |
}, | |
{ | |
"text":"hope", | |
"hashtags":['emotion'], | |
"weight":100 | |
}, | |
{ | |
"text":"joy", | |
"hashtags":['emotion'], | |
"weight":100 | |
}, | |
{ | |
"text":"anger", | |
"hashtags":['emotion'], | |
"weight":100 | |
}, | |
{ | |
"text":"anxiety", | |
"hashtags":['emotion'], | |
"weight":100 | |
}, | |
{ | |
"text":"labrador", | |
"hashtags":['animals'], | |
"weight":100 | |
}, | |
{ | |
"text":"a golden retriever", | |
"hashtags":['animals'], | |
"weight":100 | |
}, | |
{ | |
"text":"a poodle", | |
"hashtags":['animals'], | |
"weight":100 | |
}, | |
{ | |
"text":"a pug", | |
"hashtags":["animals"], | |
"weight":100 | |
}, | |
{ | |
"text":"a bulldog", | |
"hashtags":["animals"], | |
"weight":100 | |
}, | |
{ | |
"text":"dogs", | |
"hashtags":["animals"], | |
"weight":100 | |
}, | |
{ | |
"text":"puppies", | |
"hashtags":["animals"], | |
"weight":100 | |
}, | |
{ | |
"text":"baby chicks", | |
"hashtags":["animals"], | |
"weight":100 | |
}, | |
{ | |
"text":"a cat", | |
"hashtags":["animals"], | |
"weight":100 | |
}, | |
{ | |
"text":"cats", | |
"hashtags":["animals"], | |
"weight":100 | |
}, | |
{ | |
"text":"the mona lisa", | |
"hashtags":['classic'], | |
"weight":100 | |
}, | |
{ | |
"text":"a rhinocerous", | |
"hashtags":["animals"], | |
"weight":100 | |
}, | |
{ | |
"text":"a giraffe", | |
"hashtags":["animals"], | |
"weight":100 | |
}, | |
{ | |
"text":"a house", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"an appartment building", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"a skyscraper", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"a pine tree", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"a duel", | |
"hashtags":['fighting', 'combat'], | |
"weight":100 | |
}, | |
{ | |
"text":"war", | |
"hashtags":['combat'], | |
"weight":100 | |
}, | |
{ | |
"text":"peace", | |
"hashtags":['serene'], | |
"weight":100 | |
}, | |
{ | |
"text":"calm", | |
"hashtags":['emotions'], | |
"weight":100 | |
}, | |
{ | |
"text":"sunshine", | |
"hashtags":['warm'], | |
"weight":100 | |
}, | |
{ | |
"text":"puddles", | |
"hashtags":['rainy'], | |
"weight":100 | |
}, | |
{ | |
"text":"an anime city", | |
"hashtags":['anime'], | |
"weight":100 | |
}, | |
{ | |
"text":"camping", | |
"hashtags":['outdoors'], | |
"weight":100 | |
}, | |
{ | |
"text":"hiking", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"skiing", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"soccer", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"football", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"dancing", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"mountain", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"working", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"train", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"subway", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"map", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"the brain", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"a dragon", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"the enterprise", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"space shuttle", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"a droid", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"a treaure chest", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"black panther", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"liono", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"michael jackson", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"indiana jones", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"minecraft steve", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"a pirate", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"a ninja", | |
"hashtags":[], | |
"weight":100 | |
} | |
] | |
}, | |
"ENVIRONMENTS":{ | |
"pre":" ", | |
"post":"", | |
"is_hashtag":False, | |
"weight":50, | |
"items":[ | |
{ | |
"text":"floating in the clouds", | |
"hashtags":["relaxing"], | |
"weight":100 | |
}, | |
{ | |
"text":"in a lush setting", | |
"hashtags":["nature"], | |
"weight":100 | |
}, | |
{ | |
"text":"in a serene setting", | |
"hashtags":["nature","peaceful"], | |
"weight":100 | |
}, | |
{ | |
"text":"in a chaotic setting", | |
"hashtags":["chaos"], | |
"weight":100 | |
}, | |
{ | |
"text":"in a peaceful setting", | |
"hashtags":["serene"], | |
"weight":100 | |
}, | |
{ | |
"text":"in a warm setting", | |
"hashtags":["sunny"], | |
"weight":100 | |
}, | |
{ | |
"text":"in a fantasy setting", | |
"hashtags":["fantasy"], | |
"weight":100 | |
}, | |
{ | |
"text":"in a scifi setting", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"in a futuristic setting", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"in a retro setting", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"underwater", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"in space", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"in a nebula", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"underwater", | |
"hashtags":['ocean'], | |
"weight":100 | |
}, | |
{ | |
"text":"in a forest", | |
"hashtags":['nature'], | |
"weight":100 | |
}, | |
{ | |
"text":"in a jungle", | |
"hashtags":['nature','rainforest'], | |
"weight":100 | |
}, | |
{ | |
"text":"on a lake", | |
"hashtags":['nature','water','beach'], | |
"weight":100 | |
}, | |
{ | |
"text":"in a frozen wasteland", | |
"hashtags":['nature','cold','arctic'], | |
"weight":100 | |
}, | |
{ | |
"text":"at the north pole", | |
"hashtags":['nature','cold','arctic'], | |
"weight":100 | |
}, | |
{ | |
"text":"on an iceberg", | |
"hashtags":['nature','cold','arctic'], | |
"weight":100 | |
}, | |
{ | |
"text":"on another planet", | |
"hashtags":['space','nasa','scifi'], | |
"weight":100 | |
}, | |
{ | |
"text":"on the moon", | |
"hashtags":['space','nasa','lunar'], | |
"weight":100 | |
}, | |
{ | |
"text":"in a landscape", | |
"hashtags":['vague'], | |
"weight":100 | |
}, | |
{ | |
"text":"in an urban center""in a vibrant city", | |
"hashtags":['specific','city','nyc'], | |
"weight":100 | |
}, | |
{ | |
"text":"on the beach", | |
"hashtags":['ocean','sunshine'], | |
"weight":100 | |
}, | |
{ | |
"text":"in an office", | |
"hashtags":['work','architecture','design'], | |
"weight":100 | |
}, | |
{ | |
"text":"in a grocery store", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"on a farm", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"in a verdant rainforest", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"in a sun baked desert""in minecraft", | |
"hashtags":[], | |
"weight":100 | |
} | |
] | |
}, | |
"PLACES":{ | |
"pre":" ", | |
"post":"", | |
"is_hashtag":False, | |
"weight":50, | |
"items":[ | |
{ | |
"text":"floating in the clouds", | |
"hashtags":["relaxing"], | |
"weight":100 | |
}, | |
{ | |
"text":"in a tree", | |
"hashtags":["nature"], | |
"weight":100 | |
}, | |
{ | |
"text":"in a lush setting", | |
"hashtags":["nature"], | |
"weight":100 | |
}, | |
{ | |
"text":"in a serene setting", | |
"hashtags":["nature","peaceful"], | |
"weight":100 | |
}, | |
{ | |
"text":"in a chaotic setting", | |
"hashtags":["chaos"], | |
"weight":100 | |
}, | |
{ | |
"text":"in a peaceful setting", | |
"hashtags":["serene"], | |
"weight":100 | |
}, | |
{ | |
"text":"in a warm setting", | |
"hashtags":["sunny"], | |
"weight":100 | |
}, | |
{ | |
"text":"in a fantasy setting", | |
"hashtags":["fantasy"], | |
"weight":100 | |
}, | |
{ | |
"text":"in a scifi setting", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"in a futuristic setting", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"in a retro setting", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"in the 70's", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"in the 80's", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"in the 90's", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"in the 2000's""at the bottom of the ocean", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"underwater", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"in space", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"in a nebula", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"underwater", | |
"hashtags":['ocean'], | |
"weight":100 | |
}, | |
{ | |
"text":"in a forest", | |
"hashtags":['nature'], | |
"weight":100 | |
}, | |
{ | |
"text":"in a jungle", | |
"hashtags":['nature','rainforest'], | |
"weight":100 | |
}, | |
{ | |
"text":"on a lake", | |
"hashtags":['nature','water','beach'], | |
"weight":100 | |
}, | |
{ | |
"text":"on legs", | |
"hashtags":['surreal'], | |
"weight":100 | |
}, | |
{ | |
"text":"on wings", | |
"hashtags":['surreal'], | |
"weight":100 | |
}, | |
{ | |
"text":"on ice", | |
"hashtags":['nature','cold','arctic'], | |
"weight":100 | |
}, | |
{ | |
"text":"at the north pole", | |
"hashtags":['nature','cold','arctic'], | |
"weight":100 | |
}, | |
{ | |
"text":"on an iceberg", | |
"hashtags":['nature','cold','arctic'], | |
"weight":100 | |
}, | |
{ | |
"text":"on another planet", | |
"hashtags":['space','nasa','scifi'], | |
"weight":100 | |
}, | |
{ | |
"text":"on the moon", | |
"hashtags":['space','nasa','lunar'], | |
"weight":100 | |
}, | |
{ | |
"text":"in flight", | |
"hashtags":['flying'], | |
"weight":100 | |
}, | |
{ | |
"text":"falling", | |
"hashtags":['surreal'], | |
"weight":100 | |
}, | |
{ | |
"text":"in a landscape", | |
"hashtags":['vague'], | |
"weight":100 | |
}, | |
{ | |
"text":"in an urban center""in a vibrant city", | |
"hashtags":['specific','city','nyc'], | |
"weight":100 | |
}, | |
{ | |
"text":"in a playground", | |
"hashtags":['fun','play'], | |
"weight":100 | |
}, | |
{ | |
"text":"on the beach", | |
"hashtags":['ocean','sunshine'], | |
"weight":100 | |
}, | |
{ | |
"text":"in an office", | |
"hashtags":['work','architecture','design'], | |
"weight":100 | |
}, | |
{ | |
"text":"in a grocery store", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"on a farm", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"in a verdant rainforest", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"in a sun baked desert""in minecraft", | |
"hashtags":[], | |
"weight":100 | |
} | |
] | |
}, | |
"TIMES":{ | |
"pre":" ", | |
"post":"", | |
"is_hashtag":False, | |
"weight":10, | |
"items":[ | |
{ | |
"text":"at nighttime", | |
"hashtags":["pov"], | |
"weight":100 | |
}, | |
{ | |
"text":"at sunrise", | |
"hashtags":["pov"], | |
"weight":100 | |
}, | |
{ | |
"text":"in the evening", | |
"hashtags":["pov"], | |
"weight":100 | |
}, | |
{ | |
"text":"in the 60's", | |
"hashtags":["pov"], | |
"weight":100 | |
}, | |
{ | |
"text":"in the 70's", | |
"hashtags":["pov"], | |
"weight":100 | |
}, | |
{ | |
"text":"in the 80's", | |
"hashtags":["pov"], | |
"weight":100 | |
}, | |
{ | |
"text":"in the 90's", | |
"hashtags":["pov"], | |
"weight":100 | |
}, | |
{ | |
"text":"in the middle ages", | |
"hashtags":["pov"], | |
"weight":100 | |
}, | |
{ | |
"text":"in the 1800's", | |
"hashtags":["pov"], | |
"weight":100 | |
} | |
] | |
}, | |
"VIEWPOINTS":{ | |
"pre":" ", | |
"post":"", | |
"is_hashtag":False, | |
"weight":10, | |
"items":[ | |
{ | |
"text":"as seen from below", | |
"hashtags":["pov"], | |
"weight":100 | |
}, | |
{ | |
"text":"as seen from above", | |
"hashtags":["pov"], | |
"weight":100 | |
}, | |
{ | |
"text":"from inside", | |
"hashtags":["pov"], | |
"weight":100 | |
} | |
] | |
}, | |
"ARTISTS":{ | |
"pre":" by ", | |
"post":"", | |
"is_hashtag":False, | |
"weight":60, | |
"items":[ | |
{ | |
"text":"geoff darrow", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"ralph mcquarrie", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"hilma af klint", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"Ivan Aivazovsky", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"Yoshitaka Amano", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"Wes Anderson", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"Giuseppe Arcimboldo", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"Karol Bak", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"banksy", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"Jean-Michel Basquiat", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"Beeple", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"John Berkey", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"Noah Bradley", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"Eyvind Earle", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"Bob Eggleton", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"Larry Elmore", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"Chris Foss", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"lisa frank", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"H. R. (Hans Ruedi) Giger", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"Jean Giraud", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"John Harris", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"Wassily Kandinsky", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"Paul Klee", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"Paul Lehr", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"Peter Max", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"Robert McCall", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"Syd Mead", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"Moebius", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"Dan Mumford", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"Ted Nasmith", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"Victo Ngai", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"Agnes Lawrence Pelton", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"Jackson Pollock", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"Norman Rockwell", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"Bob Ross", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"Simon Stalenhag", | |
"hashtags":[], | |
"weight":100 | |
} | |
] | |
}, | |
"MODIFIERS":{ | |
"pre":", ", | |
"post":"", | |
"weight":70, | |
"is_hashtag":True, | |
"items":[ | |
{ | |
"text":"cassette futurism", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"raypunk", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"atompunk", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"steampunk", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"Bauhaus", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"60s kitsch and psychedelia", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"abstract illusionism", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"chillwave", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"colored pencil art", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"fractalism", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"futuresynth", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"glitch art", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"graffiti", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"outrun", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"retrowave", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"street art", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"vaporwave", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"watercolor painting", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"2001: A Space Odyssey", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"bokeh", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"cubism", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"fisheye lens", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"Howl’s Moving Castle", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"Interstellar", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"star wars", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"Super Mario Bros", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"tilt-shift", | |
"hashtags":[], | |
"weight":100 | |
}, | |
{ | |
"text":"renaisance", | |
"hashtags":[], | |
"weight":100 | |
} | |
] | |
} | |
} | |
def dedupe(mylist): | |
return list(dict.fromkeys(mylist)) | |
class DiscoPrompt(object): | |
def __init__(self, text="", hashtags=[]): | |
self.text = text | |
self.hashtags = hashtags | |
def get_caption(self): | |
hashtag_string = "" | |
for h in dedupe(self.hashtags): | |
hashtag_string += "#"+h+" " | |
output = self.text+" "+hashtag_string | |
output = output.strip(" ")+". " | |
return output | |
def CoinFlip(picks=1, bag=2): | |
roll = random.randint(1, bag) | |
return roll <= picks | |
class FormulaComponent(object): | |
def __init__(self, json): | |
self.json = json | |
self.items = [] | |
self.weights = [] | |
self.weight = self.json["weight"] | |
self.pre = self.json["pre"] | |
self.post = self.json["post"] | |
self.is_hashtag = self.json["is_hashtag"] | |
for i in self.json["items"]: | |
self.items.append(i) | |
self.weights.append(i["weight"]) | |
def choose(self): | |
output = "" | |
if(CoinFlip(bag=100, picks=self.weight)): | |
return random.choices(self.items, weights=self.weights, k=1)[0] | |
else: | |
return None | |
def garnish(self, text): | |
output = "" | |
if(self.pre != None): | |
output += self.pre | |
output+=text | |
if(self.post != None): | |
output += self.post | |
return output | |
prepped = {} | |
def prep(): | |
for f in CORPUS["FORMULA"]: | |
prepped[f] = FormulaComponent(CORPUS[f]) | |
print(prepped) | |
def generate_prompt(): | |
output_text = "" | |
output_hashtags = [] | |
for f in CORPUS["FORMULA"]: | |
chosen = prepped[f].choose() | |
if chosen != None: | |
if prepped[f].is_hashtag == True: | |
output_hashtags += [chosen["text"].replace(" ","")] | |
output_text += prepped[f].garnish(chosen["text"]) | |
output_hashtags += chosen["hashtags"] | |
return DiscoPrompt(output_text, hashtags=output_hashtags) | |
prep() | |
generate_prompt() | |
prompt_queue = [] | |
for p in range(50): | |
prompt_queue.append(generate_prompt()) | |
image_prompts = { | |
# 0:['ImagePromptsWorkButArentVeryGood.png:2',]}, | |
} | |
for p in prompt_queue: | |
text_prompts = p | |
# print(text_prompts) | |
print(p.get_caption()) | |
#print(p[0][0].rsplit(' Trending on artstation.')[0]) | |
#{0: [generate_prompt()]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment