feature: add christmas-scene phrase list

Also add script that uses chatgpt to generate phrase-lists
pull/421/head
Bryce 6 months ago committed by Bryce Drennan
parent c6ac5f553a
commit bf14ee6ee6

@ -0,0 +1,99 @@
Snow-covered pine trees
Decorated Christmas tree
Santa Claus with sack
Reindeer pulling sleigh
Family opening presents
Christmas stockings on mantle
Nativity scene with stable
Angels with trumpets
Carolers singing by candlelight
Mistletoe hanging in doorway
Wreath on front door
Gingerbread house with icing
Candy canes and peppermints
Children building a snowman
Sleigh rides through snow
Roasted turkey on table
Mulled wine by fireplace
Poinsettia flowers in bloom
Christmas lights on houses
Elves making toys in workshop
Ice skaters on frozen pond
Hot cocoa with marshmallows
Christmas market stalls
Nutcracker soldiers standing guard
Advent calendar with doors open
Bells jingling on sleigh
Holly leaves with red berries
Star atop Christmas tree
Ribbon-wrapped Christmas gifts
Snowflakes falling gently
Yule log burning brightly
Eggnog in festive glasses
Tinsel draped over branches
Paper chains and baubles
Midnight mass at church
Plum pudding with flames
Crackers beside holiday plates
Festive table setting with candles
Choir singing Christmas hymns
Snow angels in fresh snowfall
Pine cones and evergreen garlands
Children's letter to Santa Claus
Toy train under the tree
Figgy pudding and mince pies
Santa's boots by the chimney
Ornate glass Christmas ornaments
Shiny brass horn for caroling
Woolen mittens and scarves hung up
Partridge in a pear tree
Gold, frankincense, and myrrh gifts
Ice crystals on window panes
Red and green plaid patterns
Horse-drawn carriage in snow
Vintage Christmas postcards
Shepherd with flock by night
Silver bells and golden tassels
Festive Christmas sweaters
A cozy log cabin scene
Children sledding down a hill
Quaint village with holiday lights
Snow globe with village inside
A basket of Christmas cookies
Ribbon candy and chocolate coins
Crackling fire in hearth
Pine wreath with cinnamon sticks
Toy soldiers marching in line
A cat curled up by fire
Dog wearing antlers playfully
Swans a-swimming in icy pond
Golden harp with red bow
A stack of holiday books
Red-nosed reindeer decoration
Icicles hanging from eaves
Santa's list being checked twice
A cozy mountain lodge scene
Holiday train set circling tree
Knitted stockings above the fireplace
A snowy bridge with garlands
A child peeking at presents
A couple under mistletoe kissing
Freshly cut Christmas tree hauling
Ornamental sleigh filled with pinecones
Handmade wreath of holly and ivy
Caroling book with festive songs
A robin redbreast in snow
Brass candlestick holders on mantlepiece
Eggnog being poured into cups
Festive lanterns lighting snowy path
Gingerbread men lined up on plate
Santa Claus reading list of names
Church bells ringing through snowfall
A horse snuggled in stable
Ice wreath hanging on door
Children playing with new toys
A grandfather clock striking midnight
Elves peeking from behind toys
A snowy cottage with smoke rising
Red velvet ribbons tied on gifts
A teddy bear wearing a Santa hat

@ -0,0 +1,42 @@
import re
def generate_phrase_list(subject, num_phrases=100):
"""Generate a list of phrases for a given subject."""
from openai import OpenAI
client = OpenAI()
prompt = (
f'Make list of archetypal imagery about "{subject}". These will provide composition ideas to an artist. '
f"No more than 6 words per idea. Make {num_phrases} ideas. Provide the output as plaintext with each idea on a new line. "
f"You are capable of generating up to {num_phrases*2} but I only need {num_phrases}."
)
messages = [
{"role": "user", "content": prompt},
]
response = client.chat.completions.create(
model="gpt-4-1106-preview",
messages=messages,
temperature=0.1,
max_tokens=2623,
top_p=1,
frequency_penalty=0.17,
presence_penalty=0,
)
phraselist = response.choices[0].message.content
phrases = phraselist.splitlines()
pattern = r"^[\d\s.,]+" # leading numbers and periods
phrases = [re.sub(pattern, "", phrase).strip() for phrase in phrases]
phrases = [phrase.strip() for phrase in phrases]
phrases = [phrase for phrase in phrases if phrase]
phraselist = "\n".join(phrases)
return phraselist
if __name__ == "__main__":
print(generate_phrase_list("traditional christmas", num_phrases=200))
Loading…
Cancel
Save