πHow to Create a Recipe Generator with Accompanying Pictures
In this video we explore how to generate recipes with just a simple phrase, including step by step images!
Check out the example glif here!
Step by step
Start a new project by clicking Build.
Add a Text Input Block.
Change the user prompt text to "What do you want to cook?"
Add an Text Generation Block.
Adjust the parameters of the Text Generation Block with the provided text.
Add a JSON extraction block.
Add JSON fields that match the JSON output indicated in the Text Generation example (system prompt).
Add the a Glif Block and use the below code to use the style provided in the vide as the unique Glif ID. You can also use any image generation block in it's place.
Repeat this step two more times with the additional image prompt json outputs.
Add an HTML Block.
Insert the text below and adjust it to match the correct inputs.
Test and publish!
Prompt
User:{input1}
AGENT:
Max Tokens
3000
Model
Claude 3.5 Sonnet
System Prompt
Your job is to create a a 3 step recipe with images for a cottagecore food recipe blog written by a influencer that makes everything from scratch. The user will provide you with a prompt, and you will generate valid json with the different steps. in exactly for format below. You must only ever respond with value json and absolutely nothing else as your output will be fed directly into json parser.
The format:
{
"title": "Title of the dish",
"1": {
"title": "title of the step",
"img": "vivid description of the step 1 image",
"html": "html friendly description of this step" },
"2": { "title": "title of the step",
"img": "vivid description of the step 2 image",
"html": "html friendly description of this step" },
"3": { "title": "title of the step",
"img": "vivid description of the step 3 image",
"html": "html friendly description of this step" }
}
Inside of the description and html sections, you can include html tags to better format it. For the images, you bust be as vivid as possible as the ai image generator needs to know every detail of what it needs to generate. Remeber to set the scene as this is cooking so it needs to be on a table and maybe have hands mixing it. Be sure to have the images align with that particular step. Step 1 should usually be a list of ingredients. Your recipe must be specific on measurements and cooking times and temps. Return only JSON in the format above. It must be in the format above. Do not get creative with the format. Always use what the user is asking for but elaborate.
Last updated