Learn how to integrate Telegram and Leonardo AI using Pabbly Connect to generate images from prompts. Follow this step-by-step tutorial for seamless automation. This comprehensive guide reveals exactly how to connect your applications and automate repetitive tasks — accessible for professionals of all technical backgrounds.
Watch Step By Step Video Tutorial Below
Creating a Telegram Bot for Pabbly Connect Integration
To generate images using Leonardo AI from Telegram, we first need to create a Telegram bot. This bot will act as the interface for receiving prompts and sending images. Start by searching for ‘BotFather’ in your Telegram account.
Once you find it, click on ‘Start’ and enter /newbot. You will be prompted to provide a name for your new bot. For example, you can name it ‘PC AI Image Gen’. After that, you will also need to set a username that ends with ‘bot’. For instance, you can use ‘PCImageGen_bot’. After creating the bot, you will receive an API token which is crucial for connecting your Telegram bot with Pabbly Connect.
Connecting Telegram Bot with Pabbly Connect
Next, we will connect the Telegram bot to Pabbly Connect. To do this, log in to your Pabbly Connect account and create a new workflow. Name it something like ‘Telegram to Leonardo AI’. This will help you track the automation process.
In the workflow, you will see a trigger window and an action window. For the trigger, select ‘Telegram Bot’ and choose the event ‘Set Webhook for New Updates’. Click on ‘Connect’ and add a new connection using the API token from your Telegram bot. Once connected, click on Save and Send Test Request to ensure that everything is working properly.
Generating Images with Leonardo AI Using Pabbly Connect
After setting up the trigger, we will use Pabbly Connect to send the received prompt to Leonardo AI. In the action step, search for ‘Leonardo AI’ and select the action event ‘Create Image’. Connect your Leonardo AI account by entering the API key found in your Leonardo AI account settings.
Now, map the prompt received from the Telegram bot to the prompt field in Leonardo AI. You can also specify additional parameters like model ID, height, and width for the image. For example, if you want to generate an image based on the prompt ‘Rose Garden in the middle of mountains covered with snow’, enter this in the prompt field. After configuring these settings, click on Save and Send Test Request to generate the image.
- Select the model ID from Leonardo AI.
- Specify the height and width for the image if needed.
- Click on Save and Send Test Request.
After this step, you will receive a generation ID which indicates that the image is being processed. To ensure the image is generated, add a delay of one minute in your workflow. This will allow Leonardo AI enough time to create the image.
Sending the Generated Image Back to Telegram
Once the image is generated, we need to send it back to the user on Telegram. In Pabbly Connect, add another action step and select ‘Telegram Bot’ again. This time, choose the action event ‘Send a Photo’. You will be able to use the existing connection you created earlier.
In this step, map the chat ID from the trigger response to ensure that the image is sent back to the correct user. Also, map the image URL received from the Leonardo AI response. Finally, add a caption using the original prompt sent by the user. After configuring these settings, click on Save and Send Test Request to complete the process.
- Map the chat ID from the trigger response.
- Map the image URL from the Leonardo AI response.
- Add a caption using the original prompt.
After clicking on Save and Send Test Request, you should see a positive response indicating that the image has been successfully sent to the user on Telegram.
Conclusion
In this tutorial, we explored how to generate images using Leonardo AI from Telegram with the help of Pabbly Connect. By following these steps, you can create a seamless automation that enhances user interaction through AI-generated images.
Ensure you check out Pabbly Connect to create business automation workflows and reduce manual tasks. Pabbly Connect currently offer integration with 2,000+ applications.
- Check out Pabbly Connect – Automate your business workflows effortlessly!
- Sign Up Free – Start your journey with ease!
- 10,000+ Video Tutorials – Learn step by step!
- Join Pabbly Facebook Group – Connect with 21,000+ like minded people!