In this short guide, we'll generate images for a list of blog posts in Airtable using AI. We'll use the free Data Fetcher extension and OpenAI's DALL·E image generation model. This tutorial is 100% no-code!
Create a Blog posts table in Airtable with the following fields:
CONCATENATE("Create a grayscale cover image for a blog post about: ",Name,". Please keep the entire illustration in grayscale shades. There is no text on the image.")
You can adjust this prompt depending on the type of image you want.
Create a new Grid view called Needs image with the following filters:
Next, add Data Fetcher to your Airtable base from the Airtable marketplace.
Once Data Fetcher has been added to your base, create a new account or sign in to your existing one by clicking Have an account?.
On the Data Fetcher home screen, click create your first request. Requests are used to import data into Airtable.
For Application, select OpenAI. You can see a full list of Data Fetcher's Airtable integrations here.
Next, you'll need an API key from OpenAI. If you don't already have an account with OpenAI, you can sign up for one here. Then generate an OpenAI API here.
Under Authorization in Data Fetcher, paste in your OpenAI API key.
For the Endpoint, select Create image from a prompt.
Rename your request to Create blog post images, then click Save & Continue.
For the Prompt, we want to add a reference to our Prompt field in Airtable. Click the + button on the right-hand side of the input.
On the modal that opens, select Blog posts for the Table, Prompt for the Field and Needs image for Run for every record in view. Then click Confirm.
The Prompt field should now contain a reference to the output table.
Change the Model to DALL·E 3. This generally generates higher quality images than DALL·E 2.
Change the Size to 1792x1024, so that we generate landscape images for our blog.
Click Save & Run in the bottom right-hand corner.
The first time you run this request, you need to set up the Response Field Mapping. This is how the fields from OpenAI map to our output table. We just need to map the Image field to our Image field in the Blog posts table. Then click Save & Run.
Data Fetcher will now generate blog post images for all the blog posts in our Airtable using Ai!
You'll need to manually run the request each time you want to create new AI images in Airtable. You can also set it up to run automatically whenever a new record enters the "Needs description" view using the Triggers feature.
Triggers are a paid Data Fetcher feature, so you'll first need to upgrade your account. Scroll to the Schedule / Trigger / Webhook URL tabs and click on the Upgrade button underneath.
Select a plan to suit you and enter your payment details.
In Data Fetcher, click I've done this.
Next, select the Trigger tab and underneath, click + Authorize.
Accept the prompt I understand, let's Authorize.
Click + Add a base.
By selecting All current and future bases in all current and future workspaces, we'll avoid the need to re-authorize access for individual bases in the future.
Click on Grant access.
Back in Data Fetcher, select the Trigger tab is selected. For this tutorial, we'll use the trigger type of Record created. Also select the Blog posts table and the Needs image view.
Finally, click Save. The request will now run automatically whenever a record is created in the Needs image view and create the blog post image using AI.
Jul 25, 2024
•Zayyad Muhammad Sani
•OpenAIJul 18, 2024
•Zayyad Muhammad Sani
•OpenAIPDFJul 5, 2024
•Andy Cloke
•OpenAI