{
  "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
  }
}