Generating Midjourney images using Make.com
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
😀 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.
📬 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.
🚀 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.
🔍 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.
🔄 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.
📧 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.
🔍 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.
🔁 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.
⏱️ 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.
📧 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.
🎬 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
Make.com
Typeform
REST request
API key
JSON
Authentication
HTTP status codes
Trigger
Email notification
Error handling
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.