structure updates

This commit is contained in:
2024-05-01 12:28:44 -06:00
parent a689e58eea
commit aeba9bdb34
461 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
import csv
import random
def read_seeds(filename):
seeds = {}
with open(filename, newline='') as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
category = row['Category']
seed = row['Seed']
if category not in seeds:
seeds[category] = []
seeds[category].append(seed)
return seeds
def generate_prompt(seeds):
prompt_parts = [random.choice(seeds[category]) for category in seeds]
return f"A wallpaper with a {' '.join(prompt_parts)}."
# Reading seeds from a CSV file and generating a prompt
seeds = read_seeds('seeds.csv')
print(generate_prompt(seeds))