AutomationFlowsGeneral › Batch Image Generation with Multiple Prompts

Batch Image Generation with Multiple Prompts

Batch Image Generation with Multiple Prompts. Uses n8n-nodes-sogni. Event-driven trigger; 6 nodes.

Event trigger★★★★☆ complexity6 nodesN8N Nodes Sogni
General Trigger: Event Nodes: 6 Complexity: ★★★★☆ Added:

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "name": "Batch Image Generation with Multiple Prompts",
  "nodes": [
    {
      "parameters": {
        "content": "## Batch Image Generation\n\nGenerate multiple images from a list of prompts in a single workflow run.\n\n### Setup Steps:\n\n1. **Install n8n-nodes-sogni**\n   - Settings \u2192 Community Nodes \u2192 Install \u2192 `n8n-nodes-sogni`\n\n2. **Add Sogni Credentials**\n   - Create account at https://app.sogni.ai\n   - Add credentials in n8n: Sogni AI API\n\n3. **Customize Prompts**\n   - Edit the prompt array in \"Create Prompt List\" node\n\n4. **Click Test Workflow**\n   - Generates one image per prompt\n\n### Customization:\n\n- **Prompts**: Add/remove prompts in the Code node\n- **Model**: Change `modelId` in Generate Images node\n- **Seed**: Uses random seed for variety (or set fixed)\n- **Parallel**: n8n processes items in sequence by default",
        "height": 460,
        "width": 340,
        "color": 5
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -140,
        100
      ],
      "id": "sticky-setup-instructions",
      "name": "Setup Instructions"
    },
    {
      "parameters": {},
      "id": "start-node",
      "name": "When clicking 'Test workflow'",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        250,
        300
      ],
      "notes": "Click to start batch generation"
    },
    {
      "parameters": {
        "jsCode": "return [{\n  json: {\n    prompts: [\n      \"A cute cat wearing sunglasses\",\n      \"A futuristic cityscape at night\",\n      \"A serene forest with morning mist\",\n      \"An abstract geometric pattern in blue and gold\"\n    ]\n  }\n}];"
      },
      "id": "set-prompts",
      "name": "Create Prompt List",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        450,
        300
      ],
      "notes": "Define your list of prompts here - add or remove as needed"
    },
    {
      "parameters": {
        "fieldToSplitOut": "prompts",
        "options": {
          "destinationFieldName": "prompt"
        }
      },
      "id": "split-prompts",
      "name": "Split Into Items",
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        650,
        300
      ],
      "notes": "Splits array into individual items for processing"
    },
    {
      "parameters": {
        "resource": "image",
        "operation": "generate",
        "modelId": "flux1-schnell-fp8",
        "positivePrompt": "={{ $json.prompt }}",
        "network": "fast",
        "additionalFields": {
          "steps": 4,
          "guidance": 3.5,
          "numberOfMedia": 1,
          "tokenType": "spark",
          "seed": "={{ Math.floor(Math.random() * 1000000) }}"
        }
      },
      "id": "sogni-generate",
      "name": "Generate Images",
      "type": "n8n-nodes-sogni.sogni",
      "typeVersion": 1,
      "position": [
        850,
        300
      ],
      "notes": "Generates image for each prompt with random seed"
    },
    {
      "parameters": {
        "options": {}
      },
      "id": "aggregate-results",
      "name": "Aggregate Results",
      "type": "n8n-nodes-base.aggregate",
      "typeVersion": 1,
      "position": [
        1050,
        300
      ],
      "notes": "Combines all generated images into a single output"
    }
  ],
  "connections": {
    "When clicking 'Test workflow'": {
      "main": [
        [
          {
            "node": "Create Prompt List",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Prompt List": {
      "main": [
        [
          {
            "node": "Split Into Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Into Items": {
      "main": [
        [
          {
            "node": "Generate Images",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Images": {
      "main": [
        [
          {
            "node": "Aggregate Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "tags": [],
  "triggerCount": 0,
  "meta": {
    "templateCredsSetupCompleted": false
  }
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Batch Image Generation with Multiple Prompts. Uses n8n-nodes-sogni. Event-driven trigger; 6 nodes.

Source: https://github.com/Sogni-AI/n8n-nodes-sogni/blob/7076f6b87ded4436b16ef4e077542b85fec77778/examples/2-batch-image-generation.json — original creator credit. Request a take-down →

More General workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

General

Sogni Audio: ACE-Step Music Generation. Uses n8n-nodes-sogni. Event-driven trigger; 3 nodes.

N8N Nodes Sogni
General

Blotato. Uses googleSheets, @blotato/n8n-nodes-blotato. Event-driven trigger; 65 nodes.

Google Sheets, @Blotato/N8N Nodes Blotato
General

This template is a hands-on, practical exam designed to help you master n8n Expressions—the key to accessing and manipulating data in your workflows.

Stop And Error
General

This template is a hands-on, practical exam designed to test your understanding of the fundamental JSON data types. It's the perfect way to solidify your knowledge after learning the basics.

Stop And Error
General

Agendamiento. Uses n8n-nodes-evolution-api, redis, dataTable, executeWorkflowTrigger. Event-driven trigger; 60 nodes.

N8N Nodes Evolution Api, Redis, Data Table +2