Generating Midjourney images using Make.com

The (unofficial) Midjourney API by ImagineAPI
19 Jul 202370:55

TLDRIn this tutorial, Gizm from imagineapi.dev demonstrates how to integrate the Imagine API with Make.com to create image generations without coding. The process involves setting up a Typeform to collect prompts and emails, triggering the API with Make.com, and handling API responses to send the generated images via email. Despite initial challenges with authentication and request errors, the video successfully shows the workflow, encouraging viewers to try the demo account for image generation.

Takeaways

  • 😀 The video is a tutorial on integrating the Imagine API with Make.com to create image generations without coding.
  • 🔍 The presenter, gizm, is using Typeform to create a form called 'Freaky Friday' to collect user prompts and emails.
  • 📝 The form prompts users to enter a short text and their email to receive the generated image results.
  • 🤖 A trigger is set up in Make.com to initiate a process when a new response is submitted on the Typeform.
  • 🔗 The video demonstrates connecting Make.com to Typeform and setting up the necessary parameters for the integration.
  • 📡 The Imagine API is utilized to send a POST request with the user's prompt and authentication details.
  • 🛠️ The process involves troubleshooting and correcting errors such as incorrect API endpoints and authentication issues.
  • 🔄 The presenter explains the steps to set up a repeater module to check the status of the image generation periodically.
  • 📧 Once the image is generated, an email is sent to the user with the image source included in the email content.
  • 🔍 The video highlights the importance of error handling and the need for a more efficient method to check the image generation status.
  • 🎉 The final result is an email with the generated image sent to the user, showcasing the successful integration of the Imagine API with Make.com.

Q & A

  • What is the main purpose of the video?

    -The main purpose of the video is to demonstrate how to integrate the Imagine API with Make.com to create image generations without any coding.

  • Who is the presenter in the video?

    -The presenter in the video is Gizm from imagineapi.dev.

  • What tool is used to create the form for image generation?

    -Typeform is used to create the form for image generation.

  • What is the name of the form created in the video?

    -The form created in the video is named 'Freaky Friday'.

  • What is the purpose of collecting the email address in the form?

    -The email address is collected so that users can receive the results of the image generation.

  • What API is the presenter trying to use for image generation?

    -The presenter is trying to use the Imagine API for image generation.

  • What is the process for setting up the trigger in Make.com?

    -The process involves creating a trigger from a Typeform response, setting up a connection to Typeform, and specifying the form and fields to watch for responses.

  • What type of request is used to send data to the Imagine API?

    -A POST request is used to send data to the Imagine API.

  • What is the issue encountered when the presenter tries to run the module for the first time?

    -The issue encountered is a 404 error, indicating that the resource does not exist, likely due to incorrect URL or endpoint.

  • How does the presenter handle the authentication for the API request?

    -The presenter uses an API key with a Bearer token for authentication in the API request.

  • What is the strategy for checking the status of the image generation?

    -The strategy involves making a GET request using the image ID to check the status, and repeating this process with a delay until the image generation is complete.

  • What is the final step after the image generation is complete?

    -The final step is to send an email with the generated image to the user's provided email address.

Outlines

00:00

😀 Introducing Imagine API Integration

The speaker, gizm from imagineapi.dev, introduces a project to integrate the Imagine API with make.com for creating image generations without coding. The process begins with setting up a form using Typeform to collect user prompts and emails. The introductory page of the form, titled 'Freaky Friday,' explains that the form will generate the opposite image of what the user asks.

05:02

🔧 Setting Up the Typeform Trigger

The speaker details the process of creating a trigger in Make.com that activates when a new response is submitted to the Typeform. They go through the steps of connecting to Typeform, specifying the form name 'Freaky Friday,' and setting up the trigger to watch only completed responses. The speaker also renames the form items to 'prompt' and 'email' for clarity.

10:08

📡 Sending Data to Imagine API

The speaker describes the next step of sending the collected data to the Imagine API using a POST request. They navigate through Make.com's interface to find the appropriate module for an HTTP request with API key authentication. The URL for the demo server is provided, and the speaker explains the process of adding headers for authentication using a Bearer token.

15:09

🚀 Testing the API Request

The speaker tests the API request by inputting a prompt, such as 'yellow cat,' and observing the response. They encounter a 404 error, indicating that the request was not successful. The speaker then checks the request content and input/output status, realizing the need to correct the URL path for the POST request.

20:10

🔄 Adjusting Authentication and Retrying

After realizing an issue with the authentication headers, the speaker corrects the header value from 'token' to 'Bearer token' and retests the API request with a new prompt, 'blue cat.' The corrected authentication leads to a successful response, and the speaker notes the importance of checking the history for successful API calls.

25:24

🔄 Creating a Repeating Mechanism

The speaker aims to create a mechanism to repeatedly check the status of the image generation using a delay and a repeat function. They explore Make.com's tools to find a suitable module for this purpose, eventually deciding on using a 'sleep' function combined with a repeater module to check the image status at intervals.

30:26

📧 Sending an Email with the Image

Once the image generation is confirmed to be complete, the speaker sets up an email module to send the image to the user's email address provided in the Typeform. They detail the process of inserting the image URL into an HTML email template and configuring the email module to use the upscaled image URL.

35:30

🔍 Implementing Conditional Routing

The speaker discusses the need for conditional routing based on the image generation status. They explore Make.com's flow control tools to set up a filter that routes the process differently depending on whether the image status is 'completed.' The speaker also mentions the fallback route for unsuccessful attempts.

40:31

🔧 Fine-Tuning the Repeater and Error Handling

The speaker refines the repeater module settings, adjusting the interval between checks to 60 seconds and attaching an error handler to manage failed requests. They also discuss the use of directives like 'rollback' and the importance of handling incomplete executions in the scenario.

46:41

🕒 Adjusting Timing for Image Check

The speaker acknowledges the need for a more efficient timing mechanism instead of waiting for 60 seconds between checks. They attempt to adjust the sleep duration and explore the possibility of setting up a timer to check the image status more frequently.

51:43

📸 Finalizing the Email Delivery

The speaker demonstrates the final step of the process by running the entire workflow, which includes waiting for the image to be generated and then sending an email with the image to the user. They express a desire for improvements, such as automatic running without manual 'run once' intervention and better error handling.

56:43

📢 Conclusion and Call to Action

In conclusion, the speaker summarizes the workflow and invites viewers to get a demo account to try out the Imagine API for generating images. They provide an email address for interested users to contact and thank the viewers for watching the tutorial.

Mindmap

Keywords

💡imagineapi.dev

Imagineapi.dev is a platform that provides an API for image generation. In the video, the speaker is using this API to create images without coding. It is central to the video's theme of demonstrating how to integrate the Imagine API with make.com for generating images based on user prompts.

💡Make.com

Make.com is a platform that allows users to create workflows without coding. The video script discusses integrating Make.com with the Imagine API, showing the process of setting up a workflow to generate images based on user input, which is a key part of the video's demonstration.

💡Typeform

Typeform is a tool used to create forms and collect responses. In the video, the speaker uses Typeform to create a form called 'Freaky Friday' where users can submit prompts and email addresses to receive the generated images. It is an essential part of the workflow depicted in the video.

💡Prompt

In the context of the video, a 'prompt' is a short text input provided by the user that serves as a basis for the image generation. The script describes collecting this prompt through the Typeform and using it to inform the Imagine API what kind of image to generate.

💡REST API

A REST API, or Representational State Transfer API, is a set of rules for structuring URLs and HTTP methods to perform operations on resources. The video script includes a step where the speaker sends a POST request to the Imagine API using REST principles, which is a crucial technical aspect of the process.

💡JSON

JSON, or JavaScript Object Notation, is a lightweight data interchange format that is often used in APIs for sending and receiving data. The video script mentions sending a POST request with a JSON body to the Imagine API, which is how the user's prompt is communicated to the API.

💡Authentication

Authentication in the video refers to the process of verifying the identity of the API user. The script describes setting up an authentication header with a Bearer token to access the Imagine API, which is a common security practice in API interactions.

💡HTTP Status Codes

HTTP status codes are standardized responses from a server to indicate whether an HTTP request was successful or if there was an error. The video script mentions receiving a 404 and 403 status code, which indicate 'Not Found' and 'Forbidden' errors, respectively, in the API request process.

💡Repeater Module

A repeater module, as discussed in the video, is a tool within Make.com that allows a process to be repeated a certain number of times or until a condition is met. The speaker uses a repeater module to check the status of the image generation process.

💡Error Handling

Error handling is the process of responding to the occurrence of an error within a program. The video script includes attempts to handle errors that occur during the API request, such as incorrect authentication or unsuccessful image generation.

💡On-Demand

In the context of the video, 'on-demand' refers to running the workflow process as needed, triggered by a specific event, such as a new form submission. The speaker expresses confusion about why the process doesn't run automatically as expected in an on-demand scenario.

Highlights

Introduction of a new integration project between Imagine API and Make.com.

The goal is to allow users to create mid-journey image generations without coding.

Using Typeform to create a form called 'Freaky Friday' for user input.

The form collects a prompt and user's email to send the results.

Setting up a trigger in Make.com for when a new Typeform response is submitted.

Creating a connection to Typeform to receive responses from the 'Freaky Friday' form.

Instructions on renaming items in the form response for clarity.

Testing the trigger to ensure data is received from Typeform correctly.

Sending a POST request to Imagine API using the collected prompt from Typeform.

Mistakes and learning moments while setting up the API request in Make.com.

Correcting API authentication errors by adjusting the headers.

Using a repeater module to check the status of the image generation.

Implementing a sleep function to delay the check for image generation completion.

Filtering the response to route only successful image generation results.

Setting up an email notification to send the generated image to the user.

Handling errors and repeating the request if the image generation fails.

Final demonstration of the process resulting in an email with the generated image.

Reflection on the need for improvements in the process, such as more frequent checks and better error handling.