Generating Midjourney images using Make.com

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

TLDRIn this transcript, 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 form on Typeform called 'Freaky Friday' to collect prompts and email addresses from users. The system is designed to generate the opposite image of what is requested using the Imagine API. Gizm walks through the initial setup, including creating a trigger for Typeform responses and setting up a post request to the Imagine API with authentication. After several attempts and troubleshooting, including dealing with errors like 404 (not found) and 403 (permission denied), the process is refined. The final step involves using a repeater module to check the status of the image generation at set intervals and, upon completion, sending an email to the user with the generated image. The summary highlights the experimental and iterative nature of the process, emphasizing the learning experience and the potential for further refinement.

Takeaways

  • 🌐 The speaker, Gizm from imagineapi.dev, aims to integrate Imagine API with make.com to create image generations without coding.
  • 📝 A form is created using Typeform to collect user prompts and emails for generating images.
  • 🔄 The process involves setting up a trigger in Make.com to respond to new form submissions.
  • 📧 An email is requested from the user to send them the results of the image generation.
  • 🤖 Make.com is used to automate the process, including handling potential errors and retries.
  • 🏗️ The Imagine API is utilized to generate images based on the prompts received from the form.
  • 🔗 A RESTful POST request is made to the Imagine API, including authentication with a token.
  • 🕒 A delay is implemented to check the status of the image generation at intervals.
  • 🔍 The image generation status is checked, and upon completion, an email is sent to the user with the image.
  • 🔁 The process includes error handling and retries for failed requests.
  • 📈 The scenario demonstrates a workaround for the lack of a built-in repeater functionality in Make.com by using a combination of modules.
  • 📧 The final step is to send an email with the generated image to the user using the collected email address.

Q & A

  • What is the purpose of integrating Imagine API with make.com?

    -The purpose is to allow users to create image generations with mid-journey using Imagine API without the need for any coding.

  • How does Gizm plan to collect user inputs for image generation?

    -Gizm plans to use Typeform to create a form called 'Freaky Friday' where users can input a short text prompt and their email address.

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

    -A trigger is set up to respond when a new response is submitted on the Typeform. It is connected to Typeform and configured to watch only completed responses from the specific form.

  • How is the Imagine API called to generate an image?

    -A POST request is sent to the Imagine API's server with an authorization header and a JSON body containing the prompt from the user.

  • What is the significance of the token ID in the authorization header?

    -The token ID is used for API key authentication, granting access to use the Imagine API's services.

  • What happens if the image generation process takes longer than expected?

    -A repeater module is used to check the status of the image generation at set intervals, and an email is sent to the user once the image is ready.

  • How is the final image delivered to the user?

    -Once the image is generated, an email is sent to the user's provided email address with the image source attached.

  • What is the fallback mechanism if the image generation fails?

    -If the image generation fails, the system is set to repeat the request until it is successful or a maximum number of attempts is reached.

  • What is the main challenge faced during the integration process?

    -The main challenge is handling errors and ensuring the system checks for the image generation status at regular intervals instead of waiting for a fixed duration.

  • How can users get a demo account to try out the image generation?

    -Users can request a demo account by sending an email to [email protected].

  • What is the intended outcome of the 'Freaky Friday' form?

    -The intended outcome is to generate the opposite image of what the user asks for, providing a unique and engaging user experience.

  • Why is error handling important in this process?

    -Error handling is important to manage any issues that may arise during the image generation or API request process, ensuring a smooth user experience and timely resolution of issues.

Outlines

00:00

😀 Introduction to Imagine API Integration

The speaker, Gizm from imagineapi.dev, introduces the goal of integrating Imagine API with make.com to create image generations without coding. They plan to use Typeform to create a form called 'Freaky Friday' that will collect user prompts and emails. The process is experimental, and the speaker intends to share all the steps, including potential mistakes.

05:02

📬 Setting Up the Typeform and Trigger

The speaker creates a Typeform trigger that activates when a new response is submitted. They connect it to a specific form and set it to only watch completed responses. The form collects a 'prompt' and an email address from the user. The speaker then adds another app to send the collected data to the Imagine API.

10:08

🚀 Sending a POST Request to Imagine API

The speaker describes the process of sending a POST request to the Imagine API. They discuss adding a header for authentication using a Bearer token and constructing the JSON body with the prompt from the Typeform response. The speaker experiences some nervousness and uncertainty but remains committed to solving the task.

15:09

🔍 Checking the API Response and Errors

After sending the request, the speaker checks the API response and encounters a 404 error, indicating that the request failed. They go through the process of diagnosing the issue, checking the request content, and eventually identify that the problem lies in the URL structure. The speaker corrects the mistake and reruns the module.

20:10

🔄 Handling Authentication and Repeating Requests

The speaker addresses an authentication error (403) and corrects the headers by adding the correct authorization token. They then discuss setting up a repeater module to check the status of the image generation periodically. The goal is to keep asking the API about the image's progress until it's generated.

25:24

📧 Sending an Email with the Generated Image

Once the image is confirmed to be generated, the speaker outlines the steps to send an email with the image to the user. They detail how to use the image ID to make a GET request to the Imagine API to retrieve the image and then use the email address from the form to send the image via email.

30:26

🔍 Debugging and Filtering Responses

The speaker encounters difficulties with setting up a filter to route the response correctly based on the status. They express frustration but eventually set up a filter that checks if the status is 'completed' before proceeding to send the email. If not, the process is set to repeat.

35:30

🔁 Using a Repeater Module for Automation

The speaker discusses using a repeater module to automate the process of checking the image generation status. They mention the need for error handling and the importance of repeating the request until the image is successfully generated. They also touch on the concept of rollback in case of errors.

40:31

⏱️ Adjusting the Timing for Image Generation Check

The speaker decides to adjust the timing of the repeater module to wait for 60 seconds before checking if the image has been generated. They acknowledge that ideally, the system should check every few seconds rather than waiting for a fixed duration.

46:41

📧 Finalizing the Email Notification Process

After the image is generated, the speaker demonstrates sending an email with the image attached. They mention encountering an error related to the email account but manage to resolve it. The speaker also discusses the need for further refinements in the process, such as implementing a timer for continuous checks and handling potential errors.

51:43

🎬 Conclusion and Next Steps

The speaker concludes the video by showing the successful outcome of their efforts, an email with the generated image. They highlight the need for further improvements, such as implementing a timer for continuous checks and error handling. The speaker invites viewers to get a demo account to try out the Imagine API by emailing the provided address.

Mindmap

Keywords

Imagine API

Imagine API is a service that allows users to generate images based on textual prompts. In the video, it is used to create image generations without the need for coding, which is central to the theme of simplifying the process of image creation for users.

Make.com

Make.com is a platform that enables users to create and automate workflows using a visual interface. In the context of the video, it is used to integrate with Imagine API to automate the process of generating images, showcasing the ease of use and automation capabilities of the platform.

Typeform

Typeform is an online form builder that allows for the creation of interactive forms. In the video, it is used to collect user inputs, specifically the textual prompt and email address, which are then used to generate images through Imagine API.

REST request

A REST (Representational State Transfer) request is a type of network request used to interact with web services. In the video, the presenter uses a REST POST request to send data to the Imagine API, which is a key step in the image generation process.

API key

An API key is a unique identifier used to authenticate a user, device, or application with an API. In the video, the presenter mentions using an API key for Imagine API, which is necessary to authorize the connection and ensure secure access to the service.

JSON

JSON (JavaScript Object Notation) is a lightweight data interchange format that is easy for humans to read and write, and easy for machines to parse and generate. In the video, JSON is used to structure the data sent in the REST request to Imagine API.

Authentication

Authentication is the process of verifying the identity of a user, device, or system. In the context of the video, the presenter discusses the importance of using an authorization header with a token ID for authentication when making a request to the Imagine API.

HTTP status codes

HTTP status codes are standard responses returned by a server to indicate the status of a request. In the video, the presenter encounters a 404 and 403 status code, which indicate an error in the request or a lack of permission, respectively.

Trigger

In the context of automation workflows, a trigger is an event or action that initiates a process. In the video, the presenter sets up a trigger to initiate the image generation process when a new response is submitted through Typeform.

Email notification

An email notification is a message sent to a user via email to inform them of an event or action. In the video, the presenter aims to send an email notification to users with the generated image, which is part of providing feedback to the user after the image generation process.

Error handling

Error handling refers to the process of responding to the occurrence of an error in a computer program. In the video, the presenter discusses the need for error handling to manage situations where requests to the API may fail or encounter issues.

Highlights

Integrating Imagine API with make.com to create image generations without coding.

Using Typeform to create a form for user input and email collection.

Creating a form named 'Freaky Friday' for generating opposite images.

Setting up a trigger for a new Typeform response submission.

Connecting the trigger to Typeform and specifying the form responses to monitor.

Authorizing the connection to access Typeform responses.

Using a POST request to send data to the Imagine API.

Adding authentication headers for the API request.

Handling API responses and errors, such as 404 and 403 status codes.

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

Implementing a delay to wait for the image generation process.

Constructing an email with the generated image for the user.

Facing challenges with the automation process and manually running modules.

Using a fallback route for handling unsuccessful image generation attempts.

Struggling with the setup of a repeater module and error handling.

Sending an email notification to the user upon successful image generation.

The process involves trial and error with the integration of various tools and APIs.

The importance of error handling and automation in creating a seamless user experience.

The need for a more efficient method to check the status of image generation.

Final successful demonstration of the image generation and email notification system.