How to Generate Blog Post Images in Airtable using AI

Jan 24, 2024Andy Cloke

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!

Set Up Blog Post Table

Create a Blog posts table in Airtable with the following fields:

  • Name field, with the type Single line text. This contains the blog post titles.
  • Prompt field, with type Formula. The formula should be:
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.

  • Image field, with the type Attachment. This will contain the AI-generated blog post images.
blog posts table.png

Create a new Grid view called Needs image with the following filters:

  1. Name field is not empty.
  2. Attachment field is empty.
needs image view.png

Add Data Fetcher to Airtable Base

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?.

Data Fetcher Sign Up

Create AI-Generated Images in Airtable

On the Data Fetcher home screen, click create your first request. Requests are used to import data into Airtable.

Create your first request in Data Fetcher

For Application, select OpenAI. You can see a full list of Data Fetcher's Airtable integrations here.

OpenAI-3.jpg

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.

OpenAI-4.jpg

For the Endpoint, select Create image from a prompt.

OpenAI-5.jpg

Rename your request to Create blog post images, then click Save & Continue.

create blog post images save & continue.png

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.

OpenAI-8.jpg

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.

prompt field reference.png

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.

save and run ai blog post images.png

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.

create blog post images field mapping save and run.png

Data Fetcher will now generate blog post images for all the blog posts in our Airtable using Ai!

AI generated blog post images.png

Automatically Create Blog Post Images in Airtable with 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.

upgrade.jpg

Select a plan to suit you and enter your payment details.

data fetcher upgrade pricing plans.png

In Data Fetcher, click I've done this.

Schedule Data Fetcher

Next, select the Trigger tab and underneath, click + Authorize.

Authorize.jpg

Accept the prompt I understand, let's Authorize.

Authorize2.jpg

Click + Add a base.

Authorize3.jpg

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.

Authorize4.jpg

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.

needs image trigger.png

Related Posts

How to Extract Data from Images in Airtable using AI

How to Extract Data from Images in Airtable using AI

Jul 25, 2024

Zayyad Muhammad Sani

OpenAI
Extract Data from PDFs to Airtable using OpenAI

Extract Data from PDFs to Airtable using OpenAI

Jul 18, 2024

Zayyad Muhammad Sani

OpenAIPDF
How to Use Airtable Generative AI

How to Use Airtable Generative AI

Jul 5, 2024

Andy Cloke

OpenAI