Inspiration

So a lot of times we watch cooking videos on Youtube Shorts, TikTok etc. What if we want to customize, remix that recipe? What is we want to make that recipe low-fat, dairy-free, high protein? Customize a dish according to your creativity!

That's what Latent SpaceChef is all about! And for fun, it also makes Recipe Rap songs (based on the recipe) It also gives you tips on how to reuse the leftovers. wow!

What it does

It takes user input, which can be anything. You can type anything and it'll handle it nicely. It also has 3 other customizations: cuisine options, theme , dietary preferences.

All these 4 inputs are then sent to OpenAI, which then generates a Recipe. The recipe includes dishname (inspired from the theme), ingredients, instructions, ways to reuse leftovers (yeah!) and a "Recipe Rap" based on the recipe!!!

How we built it

I built this using Stable Diffusion, Streamlit, OpenAI GPT-3 and Replicate APIs. Getting the perfect responses required a ton of prompt engineering.

I used Streamlit to simplify frontend, backend work. All user inputs are sent to OpenAI, it then gives a string output which I convert to JSON later on. Then the dishname is turned into an image prompt which is sent to Replicate API to generate an image using Stable Diffusion!!

Challenges we ran into

I was generating outputs from gpt-3 in json format, encountered a lot of errors during that. required some prompting to get consistent JSON format as output.

Accomplishments that we're proud of

Getting all the formatting right, integrating Replicate and generating funny recipe rap songs!

What we learned

A lot about streamlit, getting good responses from gpt-3 etc.

What's next for Latent SpaceChef

I was going to make a Download Recipe PDF feature but couldn't do that. So that's next. Also, voice input!

Built With

  • diffusion
  • gpt3
  • openai
  • python
  • replicatestable
Share this project:

Updates