Greater than fiction
Patrick Hyatt
Posted on April 7, 2024
This is a submission for the Cloudflare AI Challenge.
What I Built
I built an application which given a set of animals, and fictional universes, generates an image.
The functionality is simple, but is split between a Page for the front-end, and a Worker for the AI generated content.
Demo
Upon submitting....
The famed, Dune hamster, Sallakis, destroyer of lettuce
My Code
The main heart of this is the Worker, which is a fancy API wrapping the AI functionality. POST
the following two FormData parameters to the Worker
-
animal
, the animal you wish to put in a universe,cat
lets say -
universe
, the fictional body of work's universe name,star trek
for example
The Worker's response will respond with a PNG image that AI thought was a good fit for your combination.
Give it a try yourself
curl -d "animal=rat&universe=dc comics" https://pico.patrickhyatt.workers.dev --output C:\test.png
Meet Rex Ratham, DC's newest villain
Journey
I had a few hours after a long day and the announcement of this challenge has stuck in my head for a few days, so I decided to dive in head first, no look, and no 360.
My initial thought was just to create a Worker that took in a Star Trek character, and generated a cat image in that character's style.
However after seeing how limiting that was, it seemed better to take in some input and be a tad more dynamic, thus fictional universes. At that point, why limit it to cats?
This all required a front end which a Worker is not. So, a Page was also created to handle the display/input to the worker, thus yielding the two repositories listed.
Future thoughts
I believe I could make a single Page with a Function to accomplish the same behaviors in a single repository, but while the wheels were spinning, I did not want to clog the air intake (or basically slow myself down).
Multiple Models and/or Triple Task Types
I had big hopes to incorporate multiple models and/or 3+ task types, but with limited time comes snap decisions.
Edits: Add link to site... Add more details on how Worker serves as AI frontman
Posted on April 7, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
April 4, 2024