Automate DALL-E/GPT image generation using an n8n workflow. Store files in Google Drive and log prompts, links, and estimated costs in Google Sheets. Get started with n8n templates.
Download this n8n workflow template and start using it instantly.
This advanced n8n workflow solves the challenge of automating image generation while simultaneously ensuring robust logging and cost oversight. Using a simple chat prompt as an n8n trigger, it calls the OpenAI API (GPT-image-1 model), processes the resulting base64 image data, stores the generated assets in Google Drive for centralized access, and meticulously records the transaction details—including estimated costs—in Google Sheets. This is a crucial n8n workflow for maintaining transparency and control over cloud AI expenditures and serves as an excellent example of functional n8n templates.
When chat message received (a Chat Trigger n8n node), initiates the entire n8n workflow upon receiving a prompt.HTTP Request n8n node sends the prompt ($json.chatInput) to the OpenAI API, requesting image generation using the gpt-image-1 model. This is the core function of the n8n workflow.Split Out n8n node handles the API response, isolating the image data array. The Loop Over Items n8n node ensures each generated image is processed individually.Edit Fields-file_name n8n node to assign a unique, timestamp-based filename and prepare the base64 content. The Convert to File n8n node then transforms the base64 string into a binary file, ready for cloud storage.Google Drive n8n node uploads the binary image file to the designated cloud folder.Edit Fields1 n8n node extracts the newly created file links (web link, thumbnail link) from the Google Drive response. The first Google Sheets n8n node logs the prompt and the resulting image links, creating a visual catalog in the spreadsheet.Aggregate n8n node collects the initial response data for global logging. The second Google Sheets1 n8n node records the prompt, datetime, input/output tokens, and a calculated estimated price, offering essential cost transparency for this sophisticated n8n template.HTTP Request n8n node. This needs access to the image generation endpoint.Google Drive n8n node and update the Folder ID parameter to point to your desired storage location.Google Sheets n8n nodes. You must link the nodes to your specific target spreadsheet document ID and ensure the sheet names (工作表1 and usage in the example) match your desired logging tabs. When chat message received (@n8n/n8n-nodes-langchain.chatTrigger): This serves as the primary n8n trigger, initiating the automation when a message containing the desired prompt is received.
HTTP Request (n8n node): Configured to connect to the OpenAI Image Generation API using the gpt-image-1 model. It injects the prompt dynamically from the upstream trigger data.
Split Out & Loop Over Items (n8n node): Flow control nodes used to reliably iterate over the array of generated images (even if only one is requested), crucial for handling API responses within this n8n workflow.
Convert to File (n8n node): Handles the conversion of the base64 encoded image data (b64json) received from the OpenAI API into a binary object for storage.
Google Drive (n8n node): Manages the file upload operation, storing the generated image in the cloud. It uses dynamic naming based on timestamps.
Google Sheets (Image Log) (n8n node): Appends a row containing the original prompt and the newly generated image links (WebView and Thumbnail) to a designated sheet.
inputtokens, output_tokens) and calculating estimated total costs based on predefined rates, providing excellent operational transparency.Use this powerful n8n workflow to generate custom AI content using the Settyan Flash V2.0.0 Beta.10 model on Replicate. Set up API keys and handle long-running predictions easily in n8n.

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.

Use this advanced n8n workflow to generate high-quality images using the IBM Granite Vision 3.3 2B model via Replicate. Easily set up these powerful n8n templates for automated AI art generation.

Automate asynchronous AI content generation using the Izzaanel Betia model on Replicate. This n8n workflow template uses an HTTP request n8n node to handle prediction polling.

Martech Engineer with automation. here is my website: https://www.darrelltw.com/







































