Use this robust n8n workflow to generate high-quality, photorealistic images using the black-forest-labs/flux-krea-dev model on Replicate. Features automated polling and error handling.
Download this n8n workflow template and start using it instantly.
Creative Agencies & Marketers: Rapidly prototype visuals for campaigns using AI.
Developers & Integrators: Users looking for production-ready n8n templates integrating external AI APIs.
This comprehensive n8n workflow provides a robust solution for integrating powerful AI image generation capabilities—specifically the highly acclaimed black-forest-labs/flux-krea-dev model—into any business process. Since AI generation is an asynchronous task, a major challenge is waiting for the result. This n8n workflow solves this through intelligent, automated polling logic using the HTTP Request n8n node.
By leveraging this pre-built n8n template, users can initiate an image request, automatically handle the waiting period, check the status repeatedly, and cleanly route the process to a success path (returning the image URL) or an error path (returning failure details). This structured approach makes the n8n workflow production-ready, featuring full parameter configuration and logging via dedicated n8n node steps.
This n8n workflow is initiated by a Manual Trigger n8n trigger for immediate testing and execution.
Set API Token n8n node and crucial generation parameters (like prompt, aspect_ratio, and guidance) in the Set Image Parameters n8n node.Create Image Prediction n8n node (an HTTP Request node) sends the generation parameters to the Replicate API, starting the background process and receiving a Prediction ID.Code n8n node, then pauses for 5 seconds using the Wait 5s n8n node.Check Status n8n node polls Replicate using the Prediction ID to fetch the current status.Is Complete? n8n node checks if the status is succeeded. Success Response n8n node, which formats the final output, including the generated image URL.Has Failed? n8n node checks for a failed status. If Failed, it routes to the Error Response n8n node. Wait 10s n8n node, which pauses execution before looping back to the Check Status n8n node, continuing the polling cycle until completion.Display Result n8n node, presenting the outcome in a clean, structured JSON format.To deploy this powerful n8n workflow and start generating images, follow these steps:
Set API Token n8n node (Position: -608,-80). Replace the placeholder value YOURREPLICATEAPITOKEN with your actual Replicate API key.Set Image Parameters n8n node (Position: -288,-128). Here, you can change the prompt, aspectratio, num_outputs, and other model settings. Manual Trigger (n8n trigger): The starting point for this specific n8n workflow. Used here for manual testing and demonstration.
Set API Token (n8n node): A Set n8n node used to securely store and pass the Replicate Bearer Token into subsequent HTTP Request nodes.
Set Image Parameters (n8n node): Defines all input parameters for the AI model, including the text prompt, seed, guidance, and required technical settings like aspectratio and outputformat.
Create Image Prediction (HTTP Request n8n node): Sends the initial POST request to the Replicate API. Key configuration: Uses POST method, sends the generation inputs in the JSON body, and includes the Authorization: Bearer {{ $json.api_token }} header.
Check Status (HTTP Request n8n node): Used within the polling loop. Sends a GET request to the specific prediction ID endpoint to retrieve the current status (starting, processing, succeeded, or failed).
Is Complete? (If n8n node): The core flow control mechanism. Checks if the status equals succeeded. This n8n node routes the workflow either to success or continues the polling.
Wait n8n node ensures efficient resource management within the overall n8n workflow structure.Use this powerful n8n workflow to automatically generate personalized HTML reports for survey respondents (Jotform) and weekly aggregate statistical summaries using Google Gemini AI.

Generate dynamic, analyzed weather reports, calculate comfort levels, and use an AI agent (GPT-4.1-mini) to draft personalized, engaging emails. Deploy this advanced n8n workflow template today.

Generate dynamic, personalized travel itineraries using a local Llama AI model (Ollama). This n8n workflow features dual n8n triggers for email and WhatsApp input, ensuring cross-channel automation.

Use this advanced n8n workflow to dynamically generate, approve, and publish platform-optimized social media content for X, Instagram, Facebook, and LinkedIn using GPT-4o agents and external configuration.

A comprehensive n8n workflow that automates social media content generation. It uses a Google Sheets n8n trigger, Tavily for real-time research, and ChatGPT agents to create platform-specific posts for LinkedIn, X, and Instagram.

Building AI Agents and Automations | Growth Marketer | Entrepreneur | Book Author & Podcast Host If you need any help with Automations, feel free to reach out via linkedin: https://www.linkedin.com/in/yaronbeen/ And check out my Youtube channel: https://www.youtube.com/@YaronBeen/videos







































