Skip to main content

Generate images with Replicate and Flux

Workflow preview

Workflow preview
100%
Generate images with Replicate and Flux preview
Open on n8n.io

Important notice

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

1. Workflow Overview

MCP Tool — Replicate (Flux) Image Generator → WordPress/Twitter Generates images via Replicate Flux models and uploads to WordPress (and optionally Twitter/X). Built to act as an MCP module that ot...

Best for

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

Tools used

n8n-nodes-base.httprequest, 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 images with Replicate and Flux
Workflow name
Generate images with Replicate and Flux

MCP Tool — Replicate (Flux) Image Generator → WordPress/Twitter

Generates images via Replicate Flux models and uploads to WordPress (and optionally Twitter/X). Built to act as an MCP module that other agents/workflows call for on-demand image creation.

  • Models configured in this workflow:
    black-forest-labs/flux-schnell, black-forest-labs/flux-dev, black-forest-labs/flux-1.1-pro
  • Switch rationale: lower cost 💰, broader model choice 🎯, full control of parameters ⚙️
  • Leonardo API credits cannot be used in the web UI 🙅‍♂️; separate spend for API vs UI

Links:


📥 Inputs

Field Type Description
prompt string Text description for the image
slug string Filename slug for WP media
model string One of the configured Flux models

Example:

{
	"prompt":"Joker watching a Batman movie on his laptop",
	"slug":"joker-watching-batman",
	"model":"black-forest-labs/flux-dev"
}

📤 Output

{
  "public_image_url": "https://your-wp.com/wp-content/uploads/2025/08/img-joker-watching-batman.webp",
  "wordpress": {...},
  "twitter": {...}
}

🔄 Flow

  1. Trigger with prompt, slug, model
  2. Build model payload (quality/steps/ratio/output format)
  3. Call Replicate: POST /v1/models/{model}/predictions (Prefer: wait)
  4. Download the generated image URL
  5. Upload to WordPress (returns public URL)
  6. Optional: upload to Twitter/X
  7. Return URL + metadata

🤖 MCP Use at Scale (emp0.com)

Operational pattern: I currently use this setup for my blog where i generate ~300 posts/month, each with 4 images (banner + 2 to 3 inline images) → ~1,000 images/month produced by this MCP.

💡 Hybrid Cost-Optimized Setup:

  • High-priority images (banners, main visuals): Generated using Flux Dev on Leonardo for slightly better prompt adherence.
  • Low-priority images (inline blog visuals): Generated using Flux Schnell on Replicate for maximum cost efficiency.

💰 Pricing Comparison (per image)

Leonardo per-image cost uses API Basic math: $9 / 3,500 credits = $0.0025714 per credit.

  • Flux Schnell (Leonardo) = 7 credits
  • Flux Dev (Leonardo) = 7 credits
  • Flux 1.1 Pro equivalent in Leonardo = Leonardo Phoenix based on my experience = 10 credits
Flux Model Replicate Leonardo API*
flux-schnell $0.0030 (=$3/1,000) $0.0180 (7 × $0.0025714)
flux-dev $0.0250 $0.0180 (7 × $0.0025714)
flux-1.1-pro / Phoenix $0.0400 $0.0257 (10 × $0.0025714)

Replicate pricing: https://replicate.com/pricing
Leonardo pricing: https://leonardo.ai/pricing/
Leonardo API usage: https://docs.leonardo.ai/docs/commonly-used-api-values


📊 Monthly Cost Example (1,000 images/month)

Mix: 300 ×flux-dev on Leonardo, 700 ×flux-schnell on Replicate.

Platform/Model Images Price per Image Total
Leonardo flux-dev 300 $0.0180 $5.40
Replicate flux-schnell 700 $0.0030 $2.10
Total Monthly Spend 1000 $7.50

💵 If using Leonardo for both:

  • 300 × $0.0180 = $5.40
  • 700 × $0.0180 = $12.60
  • Total = $18.00

Savings: $10.50/month (≈58% lower) with the hybrid setup.


📌 Notes

  • More Replicate models can be added in Code1 node.
  • Parameters tuned for aspect ratio, inference steps, quality, guidance.
  • Leonardo credit model is API-only; credits are not spendable in Leonardo's web UI.

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 - Sticky Note

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

Block 5 - Sticky Note1

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

Block 6 - Sticky Note2

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

Block 7 - When clicking ‘Execute workflow’

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

Block 8 - Code

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

Block 9 - When Executed by Another Workflow

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

Block 10 - Code1

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

Block 11 - Merge

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

Block 12 - Upload Media (X)

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

Block 13 - Aggregate

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

Block 14 - Sticky Note3

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

3. Summary Table

Workflow Generate images with Replicate and Flux
Complexity intermediate
Nodes 14
Categories Content Creation, Multimodal AI
Author Jay Emp0
Published 09 Aug 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/7192/7192.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 images with Replicate and Flux do?

MCP Tool — Replicate (Flux) Image Generator → WordPress/Twitter Generates images via Replicate Flux models and uploads to WordPress (and optionally Twitter/X). Built to act as an MCP module that ot...

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.