Designing Christmas Cards with Generative AI
Get notified about new posts on MatthewHall.com
Powered by Publish Perks
This year, I decided I wanted to send out Christmas cards to all my family and friends. Something simple with a nice note in each of them. I’ve been travelling a lot this year and want to show that I still value people in my life, even when I don’t get to spend time with them in person.
I started off shopping on Etsy to find a mixed pack of cards that I liked. I looked for a while, but couldn’t find anything that I loved that had a enough variety of different styles of cards. Eventually, I realized this was a great excuse to use Generative AI to create some cards myself!
For my last experiment with generative AI, I used DALL-E 2 from OpenAI. It worked well, but decided to experiment with Stable Diffusion for this project. It’s open source and easy to run directly on my Mac via DiffusionBee.
Generation
Definitely the most time-consuming part of this project, coming up with the images themselves! I generated well over 1,000 images to end up with the final 50 cards I ordered. I spent a lot of time going through Lexica to get inspiration of generation prompts to use and put a festive twist on.
For some people in my life, I went in with a very specific prompt in mind – usually that was just people’s pets with Santa hats on them. Others, I was trying to see what sort of artistic designs I could come up with. Mostly involving Christmas tree or cabins surrounded by snow and lights.
I really enjoy both watercolor and line drawing Christmas cards and spent a lot of time trying to generate those, but it was always a failure. Now that a new 2.0 model of Stable Diffusion has been released, I’ll have to revisit and see what I can create!
Ordering
One of the downsides of current generative AI models is that they are designed to create square images. Of course, most Christmas cards aren’t squares, they’re rectangles. I originally played with getting things generated in a different aspect ratio, but the results were always underwhelming compared to a square image.
I went hunting for a printing API that allowed me to order square cards and discovered Prodigi. Their cards look great and are on nice paper stock. The only downside was that they were shipping from Europe, but they were the best option available.
The printing process allowed me to provide one layout file that had images for all parts of the card. Of course, I didn’t want to go through and manually make these files over 50 times in Photoshop, so I turned to code!
I wrote a quick command line tool using Laravel Zero and image processing with Intervention Image. I took each of my images I generated, formatted them on a layout, and added some text to the back of the card. Furthermore, I uploaded them to the internet and created an order for that card to be shipped to my house, all at the same time.
Results
They look fantastic! I am incredibly happy with them and I hope all my friends and family enjoy them too.
I misaligned my print layout by about 5px, so there is a little slice of white on the right side of the images – I updated my layout for the future if I ever need to re-order them. Thankfully, I don’t think they’re too noticeable.
The most painful part of this whole process was writing in the cards themselves. I probably write manually once per month at most these days, so this was a lot of writing by my standards. Every few cards, I’d have to take a break before my wrist was able to write again.
Future
I was originally hoping to build a simple web application that let anyone design their own Christmas cards and then order them, but sadly ran out of time to make that happen this month.
I was envisioning a flow where you would land on the website, pick a general style of card such as a pet, house, Christmas tree, then be able to add your own extra prompts – with a few suggestions available. Then utilize the Stable Diffusion API to generate a few previews that let you add a card to your cart and order the ones you like!
If you are interested in some bespoke AI-generated Christmas cards, please reach out. I really love the results of this card and can’t wait to make some more for friends next year.
Part of my 2022 Year of Projects
This post is part of my 2022 Year of Projects! You can read about the project, my takeways, or check out the other posts below.- January - A Crypto Skeptic makes an NFT
- February - Building a Ski Resort API
- March - Prototyping a Disc Golf Pannier Bag
- April - Unlimited Sparkling Water from the Tap
- May - Scraping Last Minute Film Festival Tickets
- June - Adding YouTube Subscriptions to Plex
- July - Adding Post Thumbnails and Having Fun with DALL-E 2
- August - BCFlights - A Regional Flight Search Engine for British Columbia
- September - Manufacturing a Disc Golf Pannier Bag
- October - Disc Dispatch — Disc Golf Event Newsletter
- November - Designing Christmas Cards with Generative AI
- December - Publish Perks - Super Powers for your Jamstack Blog
Get notified about new posts on MatthewHall.com
Powered by Publish Perks