🎬 Generate images with Replicate and Flux

⚑ 1,584 views · 🎬 Content Creation & Video

Description

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.

Links:


πŸ“₯ Inputs

FieldTypeDescription
promptstringText description for the image
slugstringFilename slug for WP media
modelstringOne 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:


πŸ’° Pricing Comparison (per image)

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

Flux ModelReplicateLeonardo 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/ModelImagesPrice per ImageTotal
Leonardo flux-dev300$0.0180$5.40
Replicate flux-schnell700$0.0030$2.10
Total Monthly Spend1000β€”$7.50

πŸ’΅ If using Leonardo for both:

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


πŸ“Œ Notes

πŸ”— Nodes Used

HTTP Request, Execute Workflow Trigger

πŸ“₯ Import

Download workflow.json and import into n8n: Workflow menu β†’ Import from File

πŸ“– Importing guide Β· πŸ”‘ Credential setup