Learn how to automate image generation using Leonardo AI and Google Sheets with Pabbly Connect. Save images directly to Google Drive seamlessly. Learn to create powerful connections between your critical applications without requiring specialized programming knowledge or extensive technical background.

Watch Step By Step Video Tutorial Below


1. Setting Up Pabbly Connect for Automation

To generate images using Leonardo AI from Google Sheets, first, you need to set up Pabbly Connect. This platform allows seamless integration between various applications, including Google Sheets and Leonardo AI. Start by signing up for a free account on Pabbly Connect.

Once you are logged into your Pabbly Connect dashboard, create a new workflow. Click on the ‘Create Workflow’ button, give it a name, and select the folder where you want to save it. This workflow will connect Google Sheets with Leonardo AI and Google Drive.


2. Triggering the Workflow with Google Sheets

The next step involves connecting Google Sheets to Pabbly Connect. This allows the automation to trigger whenever a new row is added. In the trigger window, search for Google Sheets and select it as the app.

  • Select ‘New or Updated Spreadsheet Row’ as the trigger event.
  • Copy the webhook URL provided by Pabbly Connect.
  • In your Google Sheet, install the ‘Pabbly Connect Webhooks’ add-on and paste the webhook URL in the initial setup.

After setting up the trigger, every time you add a new image prompt in Google Sheets, it will automatically send this data to Pabbly Connect. This initiates the workflow for generating images.


3. Connecting to Leonardo AI for Image Generation

After successfully setting up the trigger, the next step is to connect to Leonardo AI through Pabbly Connect. Search for Leonardo AI in the action step and select it. Choose ‘Create Image’ as the action event to generate images based on the prompts received from Google Sheets.

To connect your Leonardo AI account, you will need to provide your API key. You can find this key in the API access section of your Leonardo AI account. Copy the API key and paste it into Pabbly Connect to establish the connection.

  • Map the prompt received from Google Sheets to the prompt field in Leonardo AI.
  • Select the model ID and configure other optional parameters as needed.
  • Click ‘Save and Send Test Request’ to verify the connection and generate an image.

Once the image is generated, you will receive a generation ID, which will be used to retrieve the image in the next steps.


4. Saving the Generated Image to Google Drive

After generating the image, the next step is to upload it to Google Drive using Pabbly Connect. Search for Google Drive in the action step and select ‘Upload File’ as the action event. Connect your Google Drive account to Pabbly Connect.

In this step, you will need to map the image URL received from Leonardo AI to the upload file action. Specify the folder ID where you want to save the image in Google Drive. You can find this ID in the URL of the folder you created for this purpose.

Map the file name from Google Sheets to the file name field in Google Drive. Specify the file extension (e.g., .jpg) as needed. Click ‘Save and Send Test Request’ to upload the image.

Once the image is uploaded, you will receive a response confirming the successful upload to Google Drive.


The final step in this automation is updating your Google Sheets with the link to the uploaded image. Use Pabbly Connect to connect back to Google Sheets and select ‘Update Cell Value’ as the action event. This will allow you to update the specific cell in your spreadsheet with the image link.

In this step, you will need to specify the spreadsheet, select the sheet, and provide the range where the image URL should be updated. Make sure to use the row index obtained from the trigger step to dynamically update the correct row.

Map the web view link of the uploaded image to the value field. Click ‘Save and Send Test Request’ to finalize the update.

After executing this step, the link to the generated image will be automatically added to your Google Sheets, completing the workflow.


Conclusion

This tutorial demonstrates how to use Pabbly Connect to automate the process of generating images with Leonardo AI from Google Sheets and saving them to Google Drive. By following these steps, you can streamline your workflow and enhance productivity.

Ensure you check out Pabbly Connect to create business automation workflows and reduce manual tasks. Pabbly Connect currently offer integration with 2,000+ applications.