| { | |
| "name": "Lesson5-n8n-Flux-Image-Generate", | |
| "nodes": [ | |
| { | |
| "parameters": { | |
| "url": "=https://image.pollinations.ai/prompt/{{ $json['Prompt to Image'] }}", | |
| "options": {} | |
| }, | |
| "type": "n8n-nodes-base.httpRequest", | |
| "typeVersion": 4.2, | |
| "position": [ | |
| 300, | |
| -20 | |
| ], | |
| "id": "92edb0fc-f1a5-41cb-957c-842840482f3a", | |
| "name": "HTTP Request" | |
| }, | |
| { | |
| "parameters": { | |
| "operation": "write", | |
| "fileName": "={{ $json.Path }}generated_image_{{ new Date().getTime() }}.jpg", | |
| "options": {} | |
| }, | |
| "type": "n8n-nodes-base.readWriteFile", | |
| "typeVersion": 1, | |
| "position": [ | |
| 480, | |
| -20 | |
| ], | |
| "id": "5bc22652-7030-45a9-9453-f043d0a4646b", | |
| "name": "Read/Write Files from Disk1" | |
| }, | |
| { | |
| "parameters": { | |
| "formTitle": "Text to Image Form", | |
| "formFields": { | |
| "values": [ | |
| { | |
| "fieldLabel": "Prompt to Image", | |
| "placeholder": "เขียนอธิบาย สิ่งที่ต้องการสร้างเป็นภาพ ด้วยภาษาอังกฤษ", | |
| "requiredField": true | |
| } | |
| ] | |
| }, | |
| "options": {} | |
| }, | |
| "type": "n8n-nodes-base.formTrigger", | |
| "typeVersion": 2.2, | |
| "position": [ | |
| -140, | |
| -20 | |
| ], | |
| "id": "db93a431-05e8-4f8a-a54e-b16b8e416e18", | |
| "name": "On form submission", | |
| "webhookId": "5910d2a6-ff95-40f8-a339-f4e1ced45845" | |
| }, | |
| { | |
| "parameters": { | |
| "assignments": { | |
| "assignments": [ | |
| { | |
| "id": "2ee5ed79-a69c-4a69-acc2-4cdd6a15cc83", | |
| "name": "Path", | |
| "value": "D:\\\\Download\\\\", | |
| "type": "string" | |
| } | |
| ] | |
| }, | |
| "includeOtherFields": true, | |
| "options": {} | |
| }, | |
| "type": "n8n-nodes-base.set", | |
| "typeVersion": 3.4, | |
| "position": [ | |
| 80, | |
| -20 | |
| ], | |
| "id": "43aab0d8-d52a-42c4-917d-fca7f348076e", | |
| "name": "Edit Fields" | |
| } | |
| ], | |
| "pinData": {}, | |
| "connections": { | |
| "HTTP Request": { | |
| "main": [ | |
| [ | |
| { | |
| "node": "Read/Write Files from Disk1", | |
| "type": "main", | |
| "index": 0 | |
| } | |
| ] | |
| ] | |
| }, | |
| "On form submission": { | |
| "main": [ | |
| [ | |
| { | |
| "node": "Edit Fields", | |
| "type": "main", | |
| "index": 0 | |
| } | |
| ] | |
| ] | |
| }, | |
| "Edit Fields": { | |
| "main": [ | |
| [ | |
| { | |
| "node": "HTTP Request", | |
| "type": "main", | |
| "index": 0 | |
| } | |
| ] | |
| ] | |
| } | |
| }, | |
| "active": false, | |
| "settings": { | |
| "executionOrder": "v1" | |
| }, | |
| "versionId": "37d2618e-d41c-4ddc-821e-5f57d1ccee3b", | |
| "meta": { | |
| "instanceId": "52186cf1b8efe42bc5d27bbce9c2dedc42f74757c6fd390a78301306ccc29052" | |
| }, | |
| "id": "SQcR6meG4FeB5AkQ", | |
| "tags": [] | |
| } |