Skip to main content

Generate & upload images with Leonardo AI, WordPress and Twitter

Workflow preview

Workflow preview
100%
Generate & upload images with Leonardo AI, WordPress and Twitter preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Prompt to Image Generator & WordPress Uploader (n8n Workflow) This workflow generates high quality AI images from text prompts using Leonardo AI , then automatically uploads the result to your Word...

Best for

  • Content Creation automation workflows
  • Multimodal AI automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.httprequest, n8n-nodes-base.wait, n8n-nodes-base.stickynote, n8n-nodes-base.manualtrigger, n8n-nodes-base.code, n8n-nodes-base.executeworkflowtrigger, n8n-nodes-base.merge, n8n-nodes-base.aggregate

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Jay Emp0.

Original n8n.io source

1.1 Workflow description

Title
Generate & upload images with Leonardo AI, WordPress and Twitter
Workflow name
Generate & upload images with Leonardo AI, WordPress and Twitter

Prompt-to-Image Generator & WordPress Uploader (n8n Workflow)

This workflow generates high-quality AI images from text prompts using Leonardo AI, then automatically uploads the result to your WordPress media library and returns the final image URL.

It functions as a Modular Content Production (MCP) tool - ideal for AI agents or workflows that need to dynamically generate and store visual assets on-demand.


⚙️ Features

  • 🧠 AI-Powered Generation
    Uses Leonardo AI to create 1472x832px images from any text prompt, with enhanced contrast and style UUID preset.

  • ☁️ WordPress Media Upload
    Uploads the image as an attachment to your connected WordPress site via REST API.

  • ☁️ Twitter Media Upload
    Uploads the image to twitter so that you can post the image later on to X.com using the media_id

  • 🔗 Returns Final URL
    Outputs the publicly accessible image URL for immediate use in websites, blogs, or social media posts.

  • 🔁 Workflow-Callable (MCP Compatible)
    Can be executed standalone or triggered by another workflow. Acts as an image-generation microservice for larger automation pipelines.


🧠 Use Cases

For AI Agents (MCP)

  • Plug this into multi-agent systems as the "image generation module"
  • Generate blog thumbnails, product mockups, or illustrations
  • Return a clean image_url for content embedding or post-publishing

For Marketers / Bloggers

  • Automate visual content creation for articles
  • Scale image generation for SEO blogs or landing pages
  • Supports media upload for twitter

For Developers / Creators

  • Integrate with other n8n workflows
  • Pass prompt and slug as inputs from any external trigger (e.g., webhook, Discord, Airtable, etc.)

📥 Inputs

Field Type Description
prompt string Text prompt for image generation
slug string Filename identifier (e.g. hero-image)

Example:

{
  "prompt": "A futuristic city skyline at night",
  "slug": "futuristic-city"
}

📤 Output

{
  "public_image_url" : "https://your.wordpress.com/img-id",
  "wordpress":{...obj},
  "twitter":{...obj}
}

🔄 Workflow Summary

  1. Receive Prompt & Slug Via manual trigger or parent workflow execution
  2. Generate Image POST to Leonardo AI's API with the prompt and config
  3. Wait & Poll Delays 1 minute, then fetches final image metadata
  4. Download Image GET request to retrieve generated image
  5. Upload to WordPress Uses WordPress REST API with proper headers
  6. Upload to Twitter Uses Twitter Media Upload API to get the media id incase you want to post the image to twitter
  7. Return Result Outputs a clean public_image_url JSON object along with wordpress and twitter media objects

🔐 Requirements

  • Leonardo AI account and API Key
  • WordPress site with API credentials (media write permission)
  • Twitter / x.com Oauth API (optional)
  • n8n instance (self-hosted or cloud)
  • This credential setup:
    • httpHeaderAuth for Leonardo headers
    • httpBearerAuth for Leonardo bearer token
    • wordpressApi for upload

🧩 Node Stack

  • Execute Workflow Trigger / Manual Trigger
  • Code (Input Parser)
  • HTTP Request → Leonardo image generation
  • Wait → 1 min delay
  • HTTP Request → Poll generation result
  • HTTP Request → Download image
  • HTTP Request → Upload to WordPress
  • Code → Return final image URL

🖼 Example Prompt

{
  "prompt": "Batman typing on a laptop",
  "slug": "batman-typing-on-a-laptop"
}

Will return:

{
"public_image_url": "https://articles.emp0.com/wp-content/uploads/2025/07/img-batman-typing-on-a-laptop.jpg"
}

🧠 Integrate with AI Agents

This workflow is MCP-compliant—plug it into:

  • Research-to-post pipelines
  • Blog generators
  • Carousel builders
  • Email visual asset creators

Trigger it from any parent AI agent that needs to generate an image based on a given idea, post, or instruction.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Upload image2

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 2 - HTTP Request1

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 3 - HTTP Request2

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 4 - Wait

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1.1

Block 5 - HTTP Request3

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 6 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 7 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 8 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 9 - When clicking ‘Execute workflow’

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 10 - Code

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 11 - When Executed by Another Workflow

Type / Role
n8n-nodes-base.executeWorkflowTrigger - executeWorkflowTrigger
Config choices
Version 1.1

Block 12 - Code1

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 13 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 14 - Merge

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.2

Block 15 - Upload Media (X)

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 16 - Aggregate

Type / Role
n8n-nodes-base.aggregate - aggregate
Config choices
Version 1

3. Summary Table

Workflow Generate & upload images with Leonardo AI, WordPress and Twitter
Complexity advanced
Nodes 16
Categories Content Creation, Multimodal AI
Author Jay Emp0
Published 24 Jul 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/6363/6363.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Generate & upload images with Leonardo AI, WordPress and Twitter do?

Prompt to Image Generator & WordPress Uploader (n8n Workflow) This workflow generates high quality AI images from text prompts using Leonardo AI , then automatically uploads the result to your Word...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Content Creation, Multimodal AI use case.