forked from dughogan/VQGAN_Prompts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrandom_prompt.py
54 lines (49 loc) · 1.88 KB
/
random_prompt.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import random
def make_random_prompt():
styles = open("styles").read().split()
index = random.randint(0, len(styles) - 1)
style = styles[index].capitalize()
prompt = style + " painting"
r = random.random()
places = open("places").read().splitlines()
things = open("things").read().splitlines()
shapes = open("shapes").read().splitlines()
colors = open("colors").read().splitlines()
artist = open("artists").read().splitlines()
if r < 1.0 / 3.0:
series = "shapes"
index = random.randint(0, len(shapes) - 1)
subject = " with " + shapes[index] + " in " + colors[index]
prompt += subject
elif r < 2.0 / 3.0:
series = "things"
index = random.randint(0, len(things) - 1)
subject = things[index]
prompt += " of " + subject + " in the color " + colors[index]
elif r < 3.0 / 4.0:
series = "shapes and colors"
index = random.randint(0, len(shapes) - 1)
subject = " of " + things[index] + " with " + shapes[index] + " in " + colors[index]
prompt += subject
elif r < 4.0 / 5.0:
series = "shapes"
index = random.randint(0, len(shapes) - 1)
subject = " with " + shapes[index] + " in " + colors[index] + " in the style of " + artist[index]
prompt += subject
elif r < 5.0 / 6.0:
series = "things"
index = random.randint(0, len(things) - 1)
subject = things[index]
prompt += " of " + subject + " in the color " + colors[index] + " in the style of " + artist[index]
elif r < 6.0 / 7.0:
series = "shapes and colors"
index = random.randint(0, len(shapes) - 1)
subject = " of " + things[index] + " with " + shapes[index] + " in " + colors[index] + " in the style of " + artist[index]
prompt += subject
else:
series = "places"
index = random.randint(0, len(places) - 1)
subject = places[index]
prompt += " of " + subject + " in the color " + colors[index]
print(prompt)
make_random_prompt()