Adamantiamable Lumi AI Image Generation with Replicate Polling - n8n Workflow

Automate AI image generation using the Adamantiamable Lumi model on Replicate. This powerful n8n workflow template includes status polling, custom headers, and dynamic credential handling.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

AI content creators needing automated image generation pipelines.
Developers looking for advanced n8n templates featuring complex API polling logic.
Users wanting to integrate Replicate's models into their existing n8n workflow.
Technical users configuring custom HTTP requests and flow control within n8n.

Overview

This comprehensive n8n workflow provides a robust solution for initiating and managing asynchronous AI generation tasks using the Replicate platform's adamantiamable/lumi model. Because AI image generation often requires time, a simple request/response flow is insufficient. This n8n workflow template solves that challenge by implementing a reliable wait-and-check polling loop using core n8n node functionality.

By utilizing the manual n8n trigger, users can easily test and configure their input prompts before deploying this n8n workflow into a production environment. The core value of this n8n workflow is the seamless integration of setting credentials, initiating the prediction, extracting the prediction ID using a Code n8n node, and continuously polling the status until the image generation is complete. This advanced use of the n8n node structure ensures reliability and minimal manual intervention.

How it Works

The automation begins with the "On clicking 'execute'" manual n8n trigger, designed for immediate testing or scheduled integration.


  1. API Setup: The "Set API Key" n8n node securely stores the Replicate API key, which is later retrieved dynamically using an n8n expression.

  2. Initiate Generation: The "Create Prediction" n8n node sends a POST request to Replicate to kick off the image generation using the specified model version and prompt.

  3. ID Extraction: The "Extract Prediction ID" n8n node (a Code n8n node) parses the initial response to capture the unique predictionId and construct the precise polling URL needed for the next steps in the n8n workflow.

  4. Polling Start: The workflow enters the polling loop, starting with the "Wait" n8n node, which pauses execution for 2 seconds to prevent excessive API calls while the job runs.

  5. Status Check: The "Check Prediction Status" n8n node uses the dynamically retrieved prediction URL to query the current status of the job.

  6. Conditional Flow: The "Check If Complete" n8n node evaluates the job status. If the status is 'succeeded', the n8n workflow proceeds to the final processing step. If the status is anything else, the flow loops back to the "Wait" n8n node, continuing the polling cycle. This loop is the heart of the asynchronous n8n workflow pattern.

  7. Final Output: Once successful, the "Process Result" n8n node formats the final generated image URLs and related metadata into a clean JSON output.

Installation Guide


  1. Import the n8n workflow: Copy the provided JSON code and paste it into your n8n instance using the 'New' button and 'Import from JSON'.

  2. Set Credentials: Open the "Set API Key" n8n node. In the assignment list, replace YOURREPLICATEAPI_KEY with your actual Replicate API key.

  3. Configure Prompts: Locate the "Create Prediction" n8n node. Modify the jsonBody parameter to define your desired generation prompt and model inputs like width, height, and seed.

  4. Activate and Test: Set the n8n workflow to 'Active' and execute the n8n trigger manually. This n8n workflow template is now configured to handle AI generation jobs.

Node Details

On clicking 'execute' (Manual Trigger n8n node): Serves as the start of the n8n workflow, allowing manual execution and testing.
Set API Key (Set n8n node): A configuration n8n node used to securely define the Replicate API key as a variable, ensuring separation of credentials from the core HTTP requests.
Create Prediction (HTTP Request n8n node): Initiates the long-running AI generation job using a POST request to the Replicate API, configuring the model inputs and authentication header using the key set in the previous n8n node.
Extract Prediction ID (Code n8n node): Uses custom JavaScript to parse the initial response, extracting the crucial id needed for subsequent polling requests. This is a vital part of the polling logic within this n8n workflow.
Wait (Wait n8n node): Pauses the execution of the n8n workflow for 2 seconds, regulating the speed of the polling loop.
Check Prediction Status (HTTP Request n8n node): Polls the Replicate API to check the current status of the prediction job, using the dynamically generated URL.
Check If Complete (If n8n node): A flow control n8n node that checks if the status field equals 'succeeded'. If not, the n8n workflow redirects back to the Wait n8n node to continue polling.
Process Result (Code n8n node): The final custom code scripting n8n node that restructures the output data, focusing on the resulting image URLs and completion metadata.

Related n8n Workflows

Free

Nodes: 7 Nodes
Updated: December 26 2025
View all
Created by

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

Featured*