-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathprompt_utils.py
More file actions
26 lines (22 loc) · 789 Bytes
/
Copy pathprompt_utils.py
File metadata and controls
26 lines (22 loc) · 789 Bytes
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
import random
def generate_prompt_variant(base_prompt: str, config: dict) -> str:
modifiers = [
"in the style of {}",
"with a {} color palette",
"during {} time of day",
"in a {} setting",
"with a {} mood",
]
modifier = random.choice(modifiers)
if "style" in modifier:
fill = random.choice(config['styles'])
elif "color palette" in modifier:
fill = random.choice(config['color_palettes'])
elif "time of day" in modifier:
fill = random.choice(config['times_of_day'])
elif "setting" in modifier:
fill = random.choice(config['settings'])
elif "mood" in modifier:
fill = random.choice(config['moods'])
variant = f"{base_prompt}, {modifier.format(fill)}"
return variant