{
  "schemaVersion": "flowdrome.workflow.v1",
  "id": "",
  "name": "AI · 15 — Image (text → picture)",
  "version": "0",
  "status": "draft",
  "nodes": [
    {
      "id": "seed",
      "type": "input.inject",
      "label": "Prompt",
      "category": "trigger",
      "config": {
        "contentType": "application/json",
        "payload": {
          "prompt": "a watercolor painting of a fox reading a book under a lamp"
        }
      },
      "position": {
        "x": 0,
        "y": 0
      }
    },
    {
      "id": "mark",
      "type": "utility.console",
      "label": "Heads-up",
      "category": "utility",
      "config": {
        "message": "🎨 generating… CPU stable-diffusion at 256×256 takes ~1 minute — the run is alive, let it finish"
      },
      "position": {
        "x": 530,
        "y": 0
      }
    },
    {
      "id": "draw",
      "type": "ai.image",
      "label": "Generate",
      "category": "ai",
      "config": {
        "baseUrl": "http://localhost:8081/v1",
        "apiKey": "",
        "model": "stablediffusion",
        "promptField": "prompt",
        "size": "256x256",
        "timeoutMs": 600000
      },
      "position": {
        "x": 1060,
        "y": 0
      },
      "attachments": {
        "model": "img"
      }
    },
    {
      "id": "img",
      "type": "ai.model",
      "label": "LocalAI images",
      "category": "ai",
      "config": {
        "provider": "generic-url",
        "baseUrl": "http://localhost:8081/v1",
        "apiKey": "",
        "model": "stablediffusion",
        "models": [],
        "temperature": 0.2,
        "maxTokens": 512
      },
      "position": {
        "x": 1060,
        "y": 222
      }
    },
    {
      "id": "show",
      "type": "output.image",
      "label": "Show in Console",
      "category": "output",
      "config": {
        "imageField": "",
        "label": ""
      },
      "position": {
        "x": 1590,
        "y": 0
      }
    },
    {
      "id": "save",
      "type": "storage.write-file",
      "label": "Save png",
      "category": "io",
      "config": {
        "path": "./ai-demo-image.png",
        "contentMode": "base64",
        "inputField": "image",
        "append": false,
        "createDirs": true,
        "encoding": "utf8"
      },
      "position": {
        "x": 2120,
        "y": 0
      }
    },
    {
      "id": "out",
      "type": "utility.console",
      "label": "Done",
      "category": "utility",
      "config": {
        "message": "Saved ./ai-demo-image.png ({{ $json.bytes }} bytes)"
      },
      "position": {
        "x": 2650,
        "y": 0
      }
    }
  ],
  "edges": [
    {
      "id": "e0",
      "sourceNodeId": "seed",
      "sourcePort": "output",
      "targetNodeId": "mark",
      "targetPort": "input"
    },
    {
      "id": "e1",
      "sourceNodeId": "mark",
      "sourcePort": "output",
      "targetNodeId": "draw",
      "targetPort": "input"
    },
    {
      "id": "e2",
      "sourceNodeId": "draw",
      "sourcePort": "output",
      "targetNodeId": "show",
      "targetPort": "input"
    },
    {
      "id": "e3",
      "sourceNodeId": "show",
      "sourcePort": "output",
      "targetNodeId": "save",
      "targetPort": "input"
    },
    {
      "id": "e4",
      "sourceNodeId": "save",
      "sourcePort": "output",
      "targetNodeId": "out",
      "targetPort": "input"
    }
  ],
  "triggers": [
    {
      "id": "t0",
      "nodeId": "seed"
    }
  ],
  "meta": {
    "snippets": [],
    "source": "template-gallery",
    "description": "A prompt becomes a picture through the ◈-wired image model and is saved to ./ai-demo-image.png. Wired for LocalAI's Stable Diffusion on :8081 (docker run -p 8081:8080 -e MODELS=/aio/cpu/image-gen.yaml localai/localai:latest-aio-cpu). ⏳ CPU diffusion at 256×256 takes about a minute (512×512 ≈ 4–5 min) — watch the Console: a start marker fires immediately and THE PICTURE APPEARS RIGHT THERE when it finishes (also saved to ./ai-demo-image.png). Point the ◈ carrier at any OpenAI-compatible image endpoint (or a GPU box) for fast generations."
  }
}