Inspiration
I enjoy watching the Daily Show and Last Week Tonight and wanted to see if I could create an AI pipeline to generate topical jokes using Sonar API and video models
What it does
- The user can input a joke prompt (e.g. Tell me a joke about a product announced at Google I/O in the style of Jon Stewart)
sonar-deep-researchis used to research the topic and generate 5 jokesgpt-4.1is used to select the "best" joke based on various criteriagpt-image-1is used to generate an image of a comedian telling the joke which will later be animatedgpt-4o-mini-ttsis used to generate a voice saying the joke- The image and the voice are used to generate a lip sync video using the
cjwbw/sadtalkermodel on replicate - Finally the
fictions-ai/autocaptionmodel is used to generate subtitles that highlight with the audio
How we built it
The initial app was generated with v0 using NextJS and Tailwind. Further edits were made using VSCode and copilot and old fashioned coding / debugging. I used models from Perplexity, OpenAI and replicate.
Challenges we ran into
The API calls to Sonar and the video generation models took too long to run on the free plan in Vercel so I couldn't host the video generation part of the project in the cloud and only use the basic sonar model there.
Some requests were failing when asking to generate an image of a person telling a joke "in the style of " due to OpenAI safety measures, so I had to add an indirect step to describe the celebrity before generating the image.
Accomplishments that we're proud of
Getting everything working in about 5 hours of work with a decent result. This was my first time heavily using AI to code and it worked pretty well.
What we learned
Learned a lot about how to string together multiple models to create a finished product and what the latest models from Sonar and OpenAI can do.
What's next for A1 LaughFactory
Add streaming or support for long running processes so I can finish deploying the final version to Vercel. I'd also like to experiment with changing the workflow to be agentic / tool based rather than procedurally calling each step of the pipeline. Ended up deploying it on render which allows longer running requests
Built With
- nextjs
- openai
- replicate
- sonar
- tailwind
- typescript
- v0
Log in or sign up for Devpost to join the conversation.