n8n-nodes-veida 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,3 +1,31 @@
1
- # Temporary Holding Version
1
+ # n8n-nodes-veida
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Unlimited free AI image generator. Sign in with Google to make pictures and edit your own photos on Veida AI Image v1 with no limit and no card | Veida AI.
4
+
5
+ `n8n-nodes-veida` is an n8n community node connecting automation workflows directly to the public Streamable HTTP MCP endpoint at `https://veida.ai/api/mcp` for still-image generation and photo enhancement.
6
+
7
+ ## Features
8
+
9
+ - **Find Image Tool (`find_veida_tool`)** — Route workflow prompts to specialized browser image tools such as the [ChatGPT photo enhancer](https://veida.ai/image/chatgpt-photo-enhancer) on [Veida AI](https://veida.ai/).
10
+ - **Generate Image (`generate_veida_image`)** — Trigger AI image generation or photo edits on Veida AI Image v1 with configurable aspect ratios (`1:1`, `16:9`, `9:16`, `4:5`).
11
+ - **Check Generation (`check_veida_generation`)** — Poll generation task IDs inside n8n wait loops until the output image URL is ready.
12
+
13
+ ## Installation
14
+
15
+ Install directly from n8n Settings -> Community Nodes:
16
+
17
+ ```text
18
+ n8n-nodes-veida
19
+ ```
20
+
21
+ Or install manually in your n8n custom extensions directory:
22
+
23
+ ```bash
24
+ npm install n8n-nodes-veida
25
+ ```
26
+
27
+ ## Links
28
+
29
+ - Homepage: [Veida AI](https://veida.ai/)
30
+ - Photo Enhancement Workflow: [ChatGPT photo enhancer](https://veida.ai/image/chatgpt-photo-enhancer)
31
+ - Live MCP Endpoint: `https://veida.ai/api/mcp`
@@ -0,0 +1,118 @@
1
+ 'use strict';
2
+
3
+ const DEFAULT_MCP_URL = 'https://veida.ai/api/mcp';
4
+
5
+ async function callVeidaMcp(method, params = {}, endpoint = DEFAULT_MCP_URL) {
6
+ const res = await fetch(endpoint, {
7
+ method: 'POST',
8
+ headers: {
9
+ 'Content-Type': 'application/json',
10
+ Accept: 'application/json, text/event-stream',
11
+ },
12
+ body: JSON.stringify({
13
+ jsonrpc: '2.0',
14
+ id: Date.now(),
15
+ method,
16
+ params,
17
+ }),
18
+ });
19
+ const text = await res.text();
20
+ if (!res.ok) {
21
+ throw new Error(`Veida MCP HTTP ${res.status}: ${text.slice(0, 200)}`);
22
+ }
23
+ const dataLine = text.split('\n').find((line) => line.startsWith('data: '));
24
+ const payload = dataLine ? JSON.parse(dataLine.slice(6)) : JSON.parse(text);
25
+ if (payload.error) {
26
+ throw new Error(`Veida MCP error ${payload.error.code}: ${payload.error.message}`);
27
+ }
28
+ return payload.result;
29
+ }
30
+
31
+ class Veida {
32
+ constructor() {
33
+ this.description = {
34
+ displayName: 'Veida AI',
35
+ name: 'veida',
36
+ group: ['transform'],
37
+ version: 1,
38
+ subtitle: '={{$parameter["operation"]}}',
39
+ description: 'Generate AI images and edit photos using the live Veida AI MCP server (veida.ai/api/mcp)',
40
+ defaults: { name: 'Veida AI' },
41
+ inputs: ['main'],
42
+ outputs: ['main'],
43
+ properties: [
44
+ {
45
+ displayName: 'Operation',
46
+ name: 'operation',
47
+ type: 'options',
48
+ noDataExpression: true,
49
+ options: [
50
+ { name: 'Find Image Tool', value: 'findTool', description: 'Match a photo or image goal to the best Veida AI tool' },
51
+ { name: 'Generate Image', value: 'generateImage', description: 'Generate or edit a still image on Veida AI Image v1' },
52
+ { name: 'Check Generation', value: 'checkGeneration', description: 'Poll a Veida AI image generation task ID for results' },
53
+ ],
54
+ default: 'findTool',
55
+ },
56
+ {
57
+ displayName: 'Query or Prompt',
58
+ name: 'prompt',
59
+ type: 'string',
60
+ default: '',
61
+ description: 'Image prompt or workflow query for Veida AI',
62
+ },
63
+ {
64
+ displayName: 'Aspect Ratio',
65
+ name: 'aspectRatio',
66
+ type: 'options',
67
+ options: [
68
+ { name: '1:1', value: '1:1' },
69
+ { name: '16:9', value: '16:9' },
70
+ { name: '9:16', value: '9:16' },
71
+ { name: '4:5', value: '4:5' },
72
+ ],
73
+ default: '1:1',
74
+ },
75
+ {
76
+ displayName: 'Task ID',
77
+ name: 'taskId',
78
+ type: 'string',
79
+ default: '',
80
+ description: 'Task ID returned by Generate Image when using Check Generation',
81
+ },
82
+ {
83
+ displayName: 'MCP Endpoint',
84
+ name: 'endpoint',
85
+ type: 'string',
86
+ default: DEFAULT_MCP_URL,
87
+ },
88
+ ],
89
+ };
90
+ }
91
+
92
+ async execute() {
93
+ const items = this.getInputData();
94
+ const out = [];
95
+ for (let i = 0; i < items.length; i++) {
96
+ const op = this.getNodeParameter('operation', i);
97
+ const endpoint = this.getNodeParameter('endpoint', i, DEFAULT_MCP_URL);
98
+ let result;
99
+ if (op === 'findTool') {
100
+ const query = this.getNodeParameter('prompt', i, '');
101
+ result = await callVeidaMcp('tools/call', { name: 'find_veida_tool', arguments: { query } }, endpoint);
102
+ } else if (op === 'generateImage') {
103
+ const prompt = this.getNodeParameter('prompt', i, '');
104
+ const aspectRatio = this.getNodeParameter('aspectRatio', i, '1:1');
105
+ result = await callVeidaMcp('tools/call', { name: 'generate_veida_image', arguments: { prompt, aspectRatio } }, endpoint);
106
+ } else if (op === 'checkGeneration') {
107
+ const taskId = this.getNodeParameter('taskId', i, '');
108
+ result = await callVeidaMcp('tools/call', { name: 'check_veida_generation', arguments: { taskId } }, endpoint);
109
+ } else {
110
+ throw new Error(`Unsupported operation: ${op}`);
111
+ }
112
+ out.push({ json: { operation: op, result }, pairedItem: { item: i } });
113
+ }
114
+ return [out];
115
+ }
116
+ }
117
+
118
+ module.exports = { Veida, callVeidaMcp, DEFAULT_MCP_URL };
package/package.json CHANGED
@@ -1,6 +1,42 @@
1
1
  {
2
2
  "name": "n8n-nodes-veida",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "n8n community node for Veida AI — unlimited free AI image generator and browser photo editing via the live Veida AI MCP server.",
5
+ "keywords": [
6
+ "n8n-community-node-package",
7
+ "n8n",
8
+ "veida",
9
+ "ai-image-generator",
10
+ "photo-editor",
11
+ "mcp"
12
+ ],
13
+ "license": "MIT",
14
+ "homepage": "https://veida.ai/",
15
+ "author": {
16
+ "name": "Veida AI",
17
+ "email": "support@veida.ai",
18
+ "url": "https://veida.ai/"
19
+ },
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "https://gitlab.com/sweaterswo/veida-sdks.git",
23
+ "directory": "n8n-nodes-veida"
24
+ },
25
+ "main": "dist/nodes/Veida/Veida.node.js",
26
+ "files": [
27
+ "dist",
28
+ "README.md"
29
+ ],
30
+ "n8n": {
31
+ "n8nNodesApiVersion": 1,
32
+ "nodes": [
33
+ "dist/nodes/Veida/Veida.node.js"
34
+ ]
35
+ },
36
+ "scripts": {
37
+ "test": "node --test test/veida.test.mjs"
38
+ },
39
+ "engines": {
40
+ "node": ">=18.17.0"
41
+ }
42
+ }