In this video, we will explore how to generate dynamic images in bulk using the Stable Fusion API. We will use Make, Airtable, and Stable Fusion tools to create images for almost 200 items, which will end being used on dynamic web pages. The aim is to generate 200 dynamic web pages for each item using target keywords to create images. We will use the city name coming from the Airtable record and other settings to create a prompt dynamically, which will be used as input configuration in Make.
To start, we need to experiment with the prompt that we want to use to get an acceptable image output. Once we have the desired prompt, we will take the text image prompt and use it as an input configuration in Make. We will then load images for almost 200 items on our website.
The first step is to search records individually that don't yet have an image in Airtable. We will make a request to the Stable Fusion API with the prompt we created earlier. The API will return the image while the execution is still running. To handle this, we will put a router in place. If the file is ready, we will deliver it immediately, update it in the Airtable record, and move to the next record. If not, we will put a sleep delay in and set the timing based on the ETA that the stable fusion API request has returned to us. We will add a 30-second buffer and then hit the fetch URL, which is given to us during the initial request. Once the image is requested, we will take the output, which is the URL of the image, and insert it back into Airtable.
The process has two routes - if the image is ready, or if the API is under high demand and it takes up to a minute, we put a sleep timer in place. We can run this process once or schedule it so that anytime we create new content, it automatically generates an image for us. The generated images can be rendered as URLs or can be created as attachments.
To summarize, we have explored how to generate dynamic images in bulk using Stable Fusion API, Make, and Airtable. By using a prompt dynamically created based on the city name coming from the Airtable record and other settings, we can generate an image that can be used for hero image content. This process can be automated to generate images for new content automatically.
Comments