@wavespeed/n8n-nodes-wavespeed 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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 WaveSpeedAI
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,128 @@
1
+ # @wavespeed/n8n-nodes-wavespeed
2
+
3
+ This is an n8n community node for [WaveSpeed AI](https://wavespeed.ai) - generate images and videos with hundreds of hosted AI models (Seedream, Seedance, FLUX, Wan, Kling, and more) directly from your n8n workflows.
4
+
5
+ [n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.
6
+
7
+ ## Installation
8
+
9
+ Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation:
10
+
11
+ 1. In n8n, go to **Settings > Community Nodes**.
12
+ 2. Select **Install**.
13
+ 3. Enter `@wavespeed/n8n-nodes-wavespeed` and confirm.
14
+
15
+ ## Credentials
16
+
17
+ 1. Create a WaveSpeed account at [wavespeed.ai](https://wavespeed.ai).
18
+ 2. Create an API key under **Access Keys** in your dashboard.
19
+ 3. In n8n, create a new **WaveSpeed API** credential and paste the key.
20
+
21
+ The credential test calls `GET /api/v3/balance`, so a green check also confirms the key has API access.
22
+
23
+ ## Operations
24
+
25
+ All operations submit a prediction to `POST https://api.wavespeed.ai/api/v3/{model}` and poll `GET /api/v3/predictions/{id}/result` until it finishes. The output for each item is:
26
+
27
+ ```json
28
+ {
29
+ "urls": ["https://..."],
30
+ "id": "<prediction id>",
31
+ "model": "<model id>",
32
+ "timings": { "executionTime": 1234 }
33
+ }
34
+ ```
35
+
36
+ ### Generate Image
37
+
38
+ Generate an image from a text prompt.
39
+
40
+ - **Model** - WaveSpeed model ID (default `bytedance/seedream-v5.0-pro`).
41
+ - **Prompt** - text description of the image.
42
+ - **Image Options** - optional `Size` (e.g. `2048*2048`), `Seed`, and `Additional Inputs (JSON)` merged into the request body.
43
+
44
+ ### Generate Video
45
+
46
+ Generate a video from a text prompt.
47
+
48
+ - **Model** - WaveSpeed model ID (default `bytedance/seedance-2.5/text-to-video`).
49
+ - **Prompt** - text description of the video.
50
+ - **Video Options** - optional `Duration (Seconds)` and `Additional Inputs (JSON)`.
51
+
52
+ ### Run Model
53
+
54
+ The power operation: run any of the models on [wavespeed.ai/models](https://wavespeed.ai/models) by passing the model ID and the full request body as JSON. Use this for image-to-image, image-to-video, LoRA, upscaling, lipsync - anything the platform hosts.
55
+
56
+ ### Shared options
57
+
58
+ - **Download Output** - download the generated files and attach them as n8n binary data (`data`, `data_1`, ...), ready for the next node (upload to S3, send via Slack, etc.).
59
+ - **Poll Interval (Seconds)** - how often to check progress (default 2).
60
+ - **Timeout (Seconds)** - how long to wait before the node fails (default 600). The prediction keeps running server-side even if the node times out; the error message includes the task ID.
61
+
62
+ ## Example workflow
63
+
64
+ A minimal prompt-to-image workflow you can paste into n8n (**Workflow > Import from Clipboard**):
65
+
66
+ ```json
67
+ {
68
+ "nodes": [
69
+ {
70
+ "parameters": {},
71
+ "name": "When clicking \"Execute Workflow\"",
72
+ "type": "n8n-nodes-base.manualTrigger",
73
+ "typeVersion": 1,
74
+ "position": [0, 0]
75
+ },
76
+ {
77
+ "parameters": {
78
+ "operation": "generateImage",
79
+ "model": "bytedance/seedream-v5.0-pro",
80
+ "prompt": "A lighthouse on a cliff at dawn, cinematic lighting",
81
+ "imageOptions": {
82
+ "size": "2048*2048"
83
+ },
84
+ "options": {
85
+ "downloadOutput": true
86
+ }
87
+ },
88
+ "name": "WaveSpeed",
89
+ "type": "@wavespeed/n8n-nodes-wavespeed.waveSpeed",
90
+ "typeVersion": 1,
91
+ "position": [220, 0],
92
+ "credentials": {
93
+ "wavespeedApi": {
94
+ "name": "WaveSpeed API"
95
+ }
96
+ }
97
+ }
98
+ ],
99
+ "connections": {
100
+ "When clicking \"Execute Workflow\"": {
101
+ "main": [[{ "node": "WaveSpeed", "type": "main", "index": 0 }]]
102
+ }
103
+ }
104
+ }
105
+ ```
106
+
107
+ ## Compatibility
108
+
109
+ Requires n8n 1.x and Node.js 20 or newer.
110
+
111
+ ## Resources
112
+
113
+ - [WaveSpeed model catalog](https://wavespeed.ai/models)
114
+ - [WaveSpeed API documentation](https://wavespeed.ai/docs)
115
+ - [n8n community nodes documentation](https://docs.n8n.io/integrations/community-nodes/)
116
+
117
+ ## Development
118
+
119
+ ```bash
120
+ npm install
121
+ npm run build # tsc + copy icons to dist
122
+ npm run lint # eslint with eslint-plugin-n8n-nodes-base
123
+ npm test # jest unit tests for the request/poll logic
124
+ ```
125
+
126
+ ## License
127
+
128
+ [MIT](LICENSE)
@@ -0,0 +1,10 @@
1
+ import type { IAuthenticateGeneric, Icon, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
2
+ export declare class WavespeedApi implements ICredentialType {
3
+ name: string;
4
+ displayName: string;
5
+ icon: Icon;
6
+ documentationUrl: string;
7
+ properties: INodeProperties[];
8
+ authenticate: IAuthenticateGeneric;
9
+ test: ICredentialTestRequest;
10
+ }
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WavespeedApi = void 0;
4
+ class WavespeedApi {
5
+ constructor() {
6
+ this.name = 'wavespeedApi';
7
+ this.displayName = 'WaveSpeed API';
8
+ this.icon = { light: 'file:wavespeed.svg', dark: 'file:wavespeed.dark.svg' };
9
+ this.documentationUrl = 'https://wavespeed.ai/docs';
10
+ this.properties = [
11
+ {
12
+ displayName: 'API Key',
13
+ name: 'apiKey',
14
+ type: 'string',
15
+ typeOptions: { password: true },
16
+ required: true,
17
+ default: '',
18
+ description: 'Your WaveSpeed API key. Create one at https://wavespeed.ai under Access Keys.',
19
+ },
20
+ ];
21
+ this.authenticate = {
22
+ type: 'generic',
23
+ properties: {
24
+ headers: {
25
+ Authorization: '=Bearer {{$credentials.apiKey}}',
26
+ },
27
+ },
28
+ };
29
+ this.test = {
30
+ request: {
31
+ baseURL: 'https://api.wavespeed.ai',
32
+ url: '/api/v3/balance',
33
+ method: 'GET',
34
+ headers: {
35
+ 'X-Client-Name': 'n8n-nodes-wavespeed',
36
+ },
37
+ },
38
+ };
39
+ }
40
+ }
41
+ exports.WavespeedApi = WavespeedApi;
42
+ //# sourceMappingURL=WavespeedApi.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WavespeedApi.credentials.js","sourceRoot":"","sources":["../../credentials/WavespeedApi.credentials.ts"],"names":[],"mappings":";;;AAQA,MAAa,YAAY;IAAzB;QACC,SAAI,GAAG,cAAc,CAAC;QAEtB,gBAAW,GAAG,eAAe,CAAC;QAE9B,SAAI,GAAS,EAAE,KAAK,EAAE,oBAAoB,EAAE,IAAI,EAAE,yBAAyB,EAAE,CAAC;QAE9E,qBAAgB,GAAG,2BAA2B,CAAC;QAE/C,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EACV,+EAA+E;aAChF;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,aAAa,EAAE,iCAAiC;iBAChD;aACD;SACD,CAAC;QAEF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,0BAA0B;gBACnC,GAAG,EAAE,iBAAiB;gBACtB,MAAM,EAAE,KAAK;gBACb,OAAO,EAAE;oBACR,eAAe,EAAE,qBAAqB;iBACtC;aACD;SACD,CAAC;IACH,CAAC;CAAA;AAzCD,oCAyCC"}
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 60 60" fill="none">
2
+ <rect width="60" height="60" rx="12" fill="#FFFFFF" fill-opacity="0.08"/>
3
+ <path d="M12 20 L20 44 L26 26 L30 36 L34 26 L40 44 L48 20" stroke="#A78BFA" stroke-width="4.5" stroke-linecap="round" stroke-linejoin="round" fill="none"/>
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 60 60" fill="none">
2
+ <rect width="60" height="60" rx="12" fill="#0A0A0A"/>
3
+ <path d="M12 20 L20 44 L26 26 L30 36 L34 26 L40 44 L48 20" stroke="#7C6AFF" stroke-width="4.5" stroke-linecap="round" stroke-linejoin="round" fill="none"/>
4
+ </svg>
@@ -0,0 +1,24 @@
1
+ import type { IDataObject, IExecuteFunctions, IHttpRequestMethods, ILoadOptionsFunctions } from 'n8n-workflow';
2
+ export declare const BASE_URL = "https://api.wavespeed.ai";
3
+ export declare const CLIENT_NAME = "n8n-nodes-wavespeed";
4
+ export declare const CREDENTIAL_NAME = "wavespeedApi";
5
+ export interface WaveSpeedPrediction {
6
+ id: string;
7
+ model?: string;
8
+ status: string;
9
+ outputs?: Array<string | IDataObject>;
10
+ error?: string;
11
+ timings?: IDataObject;
12
+ executionTime?: number;
13
+ created_at?: string;
14
+ }
15
+ type WaveSpeedContext = IExecuteFunctions | ILoadOptionsFunctions;
16
+ export declare function waveSpeedApiRequest(this: WaveSpeedContext, method: IHttpRequestMethods, endpoint: string, body?: IDataObject): Promise<IDataObject>;
17
+ export declare function submitPrediction(this: WaveSpeedContext, model: string, input: IDataObject): Promise<WaveSpeedPrediction>;
18
+ export declare function getPrediction(this: WaveSpeedContext, predictionId: string): Promise<WaveSpeedPrediction>;
19
+ export declare function waitForPrediction(this: WaveSpeedContext, predictionId: string, options?: {
20
+ intervalMs?: number;
21
+ timeoutMs?: number;
22
+ }): Promise<WaveSpeedPrediction>;
23
+ export declare function parseJsonParameter(value: unknown, parameterName: string): IDataObject;
24
+ export {};
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CREDENTIAL_NAME = exports.CLIENT_NAME = exports.BASE_URL = void 0;
4
+ exports.waveSpeedApiRequest = waveSpeedApiRequest;
5
+ exports.submitPrediction = submitPrediction;
6
+ exports.getPrediction = getPrediction;
7
+ exports.waitForPrediction = waitForPrediction;
8
+ exports.parseJsonParameter = parseJsonParameter;
9
+ const n8n_workflow_1 = require("n8n-workflow");
10
+ exports.BASE_URL = 'https://api.wavespeed.ai';
11
+ exports.CLIENT_NAME = 'n8n-nodes-wavespeed';
12
+ exports.CREDENTIAL_NAME = 'wavespeedApi';
13
+ async function waveSpeedApiRequest(method, endpoint, body) {
14
+ const options = {
15
+ method,
16
+ url: `${exports.BASE_URL}${endpoint}`,
17
+ headers: {
18
+ 'Content-Type': 'application/json',
19
+ 'X-Client-Name': exports.CLIENT_NAME,
20
+ },
21
+ json: true,
22
+ };
23
+ if (body !== undefined) {
24
+ options.body = body;
25
+ }
26
+ let response;
27
+ try {
28
+ response = (await this.helpers.httpRequestWithAuthentication.call(this, exports.CREDENTIAL_NAME, options));
29
+ }
30
+ catch (error) {
31
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
32
+ }
33
+ const envelope = response;
34
+ if (envelope.code !== undefined && envelope.code !== 200) {
35
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), envelope, {
36
+ message: envelope.message ?? `WaveSpeed API returned code ${envelope.code}`,
37
+ });
38
+ }
39
+ return (envelope.data ?? response);
40
+ }
41
+ async function submitPrediction(model, input) {
42
+ const data = await waveSpeedApiRequest.call(this, 'POST', `/api/v3/${model}`, input);
43
+ return data;
44
+ }
45
+ async function getPrediction(predictionId) {
46
+ const data = await waveSpeedApiRequest.call(this, 'GET', `/api/v3/predictions/${predictionId}/result`);
47
+ return data;
48
+ }
49
+ async function waitForPrediction(predictionId, options = {}) {
50
+ const intervalMs = options.intervalMs ?? 2000;
51
+ const deadline = options.timeoutMs ? Date.now() + options.timeoutMs : undefined;
52
+ for (;;) {
53
+ const prediction = await getPrediction.call(this, predictionId);
54
+ if (prediction.status === 'completed') {
55
+ return prediction;
56
+ }
57
+ if (prediction.status === 'failed' ||
58
+ prediction.status === 'cancelled' ||
59
+ prediction.status === 'timeout') {
60
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `WaveSpeed prediction ${prediction.status}${prediction.error ? `: ${prediction.error}` : ''} (task ID: ${predictionId})`);
61
+ }
62
+ if (deadline !== undefined && Date.now() > deadline) {
63
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `WaveSpeed prediction is still "${prediction.status}" after the configured timeout (task ID: ${predictionId}). The task keeps running server-side.`);
64
+ }
65
+ await (0, n8n_workflow_1.sleep)(intervalMs);
66
+ }
67
+ }
68
+ function parseJsonParameter(value, parameterName) {
69
+ if (value === undefined || value === null || value === '') {
70
+ return {};
71
+ }
72
+ if (typeof value === 'object') {
73
+ return value;
74
+ }
75
+ let parsed;
76
+ let invalid = false;
77
+ try {
78
+ parsed = JSON.parse(value);
79
+ }
80
+ catch {
81
+ invalid = true;
82
+ }
83
+ if (invalid) {
84
+ throw new Error(`Parameter "${parameterName}" must contain valid JSON`);
85
+ }
86
+ if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {
87
+ throw new Error(`Parameter "${parameterName}" must be a JSON object`);
88
+ }
89
+ return parsed;
90
+ }
91
+ //# sourceMappingURL=GenericFunctions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GenericFunctions.js","sourceRoot":"","sources":["../../../nodes/WaveSpeed/GenericFunctions.ts"],"names":[],"mappings":";;;AAgCA,kDAqCC;AAOD,4CAOC;AAGD,sCAUC;AAOD,8CA+BC;AAGD,gDAqBC;AAtJD,+CAAuE;AAE1D,QAAA,QAAQ,GAAG,0BAA0B,CAAC;AACtC,QAAA,WAAW,GAAG,qBAAqB,CAAC;AACpC,QAAA,eAAe,GAAG,cAAc,CAAC;AAoBvC,KAAK,UAAU,mBAAmB,CAExC,MAA2B,EAC3B,QAAgB,EAChB,IAAkB;IAElB,MAAM,OAAO,GAAwB;QACpC,MAAM;QACN,GAAG,EAAE,GAAG,gBAAQ,GAAG,QAAQ,EAAE;QAC7B,OAAO,EAAE;YACR,cAAc,EAAE,kBAAkB;YAClC,eAAe,EAAE,mBAAW;SAC5B;QACD,IAAI,EAAE,IAAI;KACV,CAAC;IACF,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IACrB,CAAC;IAED,IAAI,QAAqB,CAAC;IAC1B,IAAI,CAAC;QACJ,QAAQ,GAAG,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,6BAA6B,CAAC,IAAI,CAChE,IAAI,EACJ,uBAAe,EACf,OAAO,CACP,CAAgB,CAAC;IACnB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,MAAM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E,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,cAAc,aAAa,2BAA2B,CAAC,CAAC;IACzE,CAAC;IACD,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC5E,MAAM,IAAI,KAAK,CAAC,cAAc,aAAa,yBAAyB,CAAC,CAAC;IACvE,CAAC;IACD,OAAO,MAAqB,CAAC;AAC9B,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ export declare class WaveSpeed implements INodeType {
3
+ description: INodeTypeDescription;
4
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
+ }
@@ -0,0 +1,364 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WaveSpeed = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const GenericFunctions_1 = require("./GenericFunctions");
6
+ class WaveSpeed {
7
+ constructor() {
8
+ this.description = {
9
+ displayName: 'WaveSpeed',
10
+ name: 'waveSpeed',
11
+ icon: { light: 'file:wavespeed.svg', dark: 'file:wavespeed.dark.svg' },
12
+ group: ['transform'],
13
+ version: 1,
14
+ subtitle: '={{$parameter["operation"]}}',
15
+ description: 'Generate images and videos with AI models hosted on WaveSpeed',
16
+ defaults: {
17
+ name: 'WaveSpeed',
18
+ },
19
+ usableAsTool: true,
20
+ inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
21
+ outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
22
+ credentials: [
23
+ {
24
+ name: 'wavespeedApi',
25
+ required: true,
26
+ },
27
+ ],
28
+ properties: [
29
+ {
30
+ displayName: 'Resource',
31
+ name: 'resource',
32
+ type: 'options',
33
+ noDataExpression: true,
34
+ options: [
35
+ {
36
+ name: 'Media',
37
+ value: 'media',
38
+ },
39
+ ],
40
+ default: 'media',
41
+ },
42
+ {
43
+ displayName: 'Operation',
44
+ name: 'operation',
45
+ type: 'options',
46
+ noDataExpression: true,
47
+ displayOptions: {
48
+ show: {
49
+ resource: ['media'],
50
+ },
51
+ },
52
+ options: [
53
+ {
54
+ name: 'Generate Image',
55
+ value: 'generateImage',
56
+ description: 'Generate an image from a text prompt',
57
+ action: 'Generate an image',
58
+ },
59
+ {
60
+ name: 'Generate Video',
61
+ value: 'generateVideo',
62
+ description: 'Generate a video from a text prompt',
63
+ action: 'Generate a video',
64
+ },
65
+ {
66
+ name: 'Run Model',
67
+ value: 'runModel',
68
+ description: 'Run any WaveSpeed model with raw JSON inputs',
69
+ action: 'Run a model',
70
+ },
71
+ ],
72
+ default: 'generateImage',
73
+ },
74
+ {
75
+ displayName: 'Model',
76
+ name: 'model',
77
+ type: 'string',
78
+ required: true,
79
+ displayOptions: {
80
+ show: {
81
+ resource: ['media'],
82
+ operation: ['generateImage'],
83
+ },
84
+ },
85
+ default: 'bytedance/seedream-v5.0-pro',
86
+ description: 'WaveSpeed model ID to run. Browse all models at https://wavespeed.ai/models.',
87
+ },
88
+ {
89
+ displayName: 'Prompt',
90
+ name: 'prompt',
91
+ type: 'string',
92
+ required: true,
93
+ typeOptions: {
94
+ rows: 4,
95
+ },
96
+ displayOptions: {
97
+ show: {
98
+ resource: ['media'],
99
+ operation: ['generateImage'],
100
+ },
101
+ },
102
+ default: '',
103
+ description: 'Text prompt describing the image to generate',
104
+ },
105
+ {
106
+ displayName: 'Image Options',
107
+ name: 'imageOptions',
108
+ type: 'collection',
109
+ placeholder: 'Add option',
110
+ displayOptions: {
111
+ show: {
112
+ resource: ['media'],
113
+ operation: ['generateImage'],
114
+ },
115
+ },
116
+ default: {},
117
+ options: [
118
+ {
119
+ displayName: 'Additional Inputs (JSON)',
120
+ name: 'additionalInputs',
121
+ type: 'json',
122
+ default: '{}',
123
+ description: 'Extra model inputs merged into the request body, e.g. {"image": "https://..."}. See the model page on wavespeed.ai for its full schema.',
124
+ },
125
+ {
126
+ displayName: 'Seed',
127
+ name: 'seed',
128
+ type: 'number',
129
+ default: -1,
130
+ description: 'Random seed for reproducible results. Use -1 for a random seed.',
131
+ },
132
+ {
133
+ displayName: 'Size',
134
+ name: 'size',
135
+ type: 'string',
136
+ default: '',
137
+ placeholder: 'e.g. 2048*2048',
138
+ description: 'Output resolution as width*height, if the model supports it',
139
+ },
140
+ ],
141
+ },
142
+ {
143
+ displayName: 'Model',
144
+ name: 'model',
145
+ type: 'string',
146
+ required: true,
147
+ displayOptions: {
148
+ show: {
149
+ resource: ['media'],
150
+ operation: ['generateVideo'],
151
+ },
152
+ },
153
+ default: 'bytedance/seedance-2.5/text-to-video',
154
+ description: 'WaveSpeed model ID to run. Browse all models at https://wavespeed.ai/models.',
155
+ },
156
+ {
157
+ displayName: 'Prompt',
158
+ name: 'prompt',
159
+ type: 'string',
160
+ required: true,
161
+ typeOptions: {
162
+ rows: 4,
163
+ },
164
+ displayOptions: {
165
+ show: {
166
+ resource: ['media'],
167
+ operation: ['generateVideo'],
168
+ },
169
+ },
170
+ default: '',
171
+ description: 'Text prompt describing the video to generate',
172
+ },
173
+ {
174
+ displayName: 'Video Options',
175
+ name: 'videoOptions',
176
+ type: 'collection',
177
+ placeholder: 'Add option',
178
+ displayOptions: {
179
+ show: {
180
+ resource: ['media'],
181
+ operation: ['generateVideo'],
182
+ },
183
+ },
184
+ default: {},
185
+ options: [
186
+ {
187
+ displayName: 'Additional Inputs (JSON)',
188
+ name: 'additionalInputs',
189
+ type: 'json',
190
+ default: '{}',
191
+ description: 'Extra model inputs merged into the request body, e.g. {"image": "https://..."}. See the model page on wavespeed.ai for its full schema.',
192
+ },
193
+ {
194
+ displayName: 'Duration (Seconds)',
195
+ name: 'duration',
196
+ type: 'number',
197
+ default: 5,
198
+ description: 'Length of the generated video in seconds, if the model supports it',
199
+ },
200
+ ],
201
+ },
202
+ {
203
+ displayName: 'Model',
204
+ name: 'model',
205
+ type: 'string',
206
+ required: true,
207
+ displayOptions: {
208
+ show: {
209
+ resource: ['media'],
210
+ operation: ['runModel'],
211
+ },
212
+ },
213
+ default: '',
214
+ placeholder: 'e.g. wavespeed-ai/flux-dev',
215
+ description: 'WaveSpeed model ID to run. Browse all models at https://wavespeed.ai/models.',
216
+ },
217
+ {
218
+ displayName: 'Inputs (JSON)',
219
+ name: 'inputs',
220
+ type: 'json',
221
+ required: true,
222
+ displayOptions: {
223
+ show: {
224
+ resource: ['media'],
225
+ operation: ['runModel'],
226
+ },
227
+ },
228
+ default: '{}',
229
+ description: 'Full request body for the model as a JSON object. See the model page on wavespeed.ai for its schema.',
230
+ },
231
+ {
232
+ displayName: 'Options',
233
+ name: 'options',
234
+ type: 'collection',
235
+ placeholder: 'Add option',
236
+ displayOptions: {
237
+ show: {
238
+ resource: ['media'],
239
+ },
240
+ },
241
+ default: {},
242
+ options: [
243
+ {
244
+ displayName: 'Download Output',
245
+ name: 'downloadOutput',
246
+ type: 'boolean',
247
+ default: false,
248
+ description: 'Whether to download the generated files and attach them as binary data',
249
+ },
250
+ {
251
+ displayName: 'Poll Interval (Seconds)',
252
+ name: 'pollInterval',
253
+ type: 'number',
254
+ typeOptions: {
255
+ minValue: 1,
256
+ },
257
+ default: 2,
258
+ description: 'How often to check whether the prediction has finished',
259
+ },
260
+ {
261
+ displayName: 'Timeout (Seconds)',
262
+ name: 'timeout',
263
+ type: 'number',
264
+ typeOptions: {
265
+ minValue: 1,
266
+ },
267
+ default: 600,
268
+ description: 'Maximum time to wait for the prediction before the node fails. The task keeps running on WaveSpeed either way.',
269
+ },
270
+ ],
271
+ },
272
+ ],
273
+ };
274
+ }
275
+ async execute() {
276
+ const items = this.getInputData();
277
+ const returnData = [];
278
+ const operation = this.getNodeParameter('operation', 0);
279
+ for (let i = 0; i < items.length; i++) {
280
+ try {
281
+ const model = this.getNodeParameter('model', i);
282
+ let input = {};
283
+ if (operation === 'generateImage') {
284
+ const options = this.getNodeParameter('imageOptions', i, {});
285
+ input = (0, GenericFunctions_1.parseJsonParameter)(options.additionalInputs, 'Additional Inputs (JSON)');
286
+ input.prompt = this.getNodeParameter('prompt', i);
287
+ if (options.size !== undefined && options.size !== '') {
288
+ input.size = options.size;
289
+ }
290
+ if (options.seed !== undefined && options.seed !== -1) {
291
+ input.seed = options.seed;
292
+ }
293
+ }
294
+ else if (operation === 'generateVideo') {
295
+ const options = this.getNodeParameter('videoOptions', i, {});
296
+ input = (0, GenericFunctions_1.parseJsonParameter)(options.additionalInputs, 'Additional Inputs (JSON)');
297
+ input.prompt = this.getNodeParameter('prompt', i);
298
+ if (options.duration !== undefined) {
299
+ input.duration = options.duration;
300
+ }
301
+ }
302
+ else if (operation === 'runModel') {
303
+ input = (0, GenericFunctions_1.parseJsonParameter)(this.getNodeParameter('inputs', i), 'Inputs (JSON)');
304
+ }
305
+ else {
306
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown operation "${operation}"`, {
307
+ itemIndex: i,
308
+ });
309
+ }
310
+ const options = this.getNodeParameter('options', i, {});
311
+ const submitted = await GenericFunctions_1.submitPrediction.call(this, model, input);
312
+ const prediction = await GenericFunctions_1.waitForPrediction.call(this, submitted.id, {
313
+ intervalMs: (options.pollInterval ?? 2) * 1000,
314
+ timeoutMs: (options.timeout ?? 600) * 1000,
315
+ });
316
+ const urls = (prediction.outputs ?? []).filter((output) => typeof output === 'string');
317
+ const json = {
318
+ urls,
319
+ id: prediction.id,
320
+ model: prediction.model ?? model,
321
+ };
322
+ if (prediction.timings !== undefined) {
323
+ json.timings = prediction.timings;
324
+ }
325
+ else if (prediction.executionTime !== undefined) {
326
+ json.timings = { executionTime: prediction.executionTime };
327
+ }
328
+ const executionData = {
329
+ json,
330
+ pairedItem: { item: i },
331
+ };
332
+ if (options.downloadOutput === true && urls.length > 0) {
333
+ executionData.binary = {};
334
+ for (let urlIndex = 0; urlIndex < urls.length; urlIndex++) {
335
+ const url = urls[urlIndex];
336
+ const response = (await this.helpers.httpRequest({
337
+ url,
338
+ method: 'GET',
339
+ encoding: 'arraybuffer',
340
+ returnFullResponse: true,
341
+ }));
342
+ const fileName = new URL(url).pathname.split('/').pop() || `output-${urlIndex}`;
343
+ const binaryKey = urlIndex === 0 ? 'data' : `data_${urlIndex}`;
344
+ executionData.binary[binaryKey] = await this.helpers.prepareBinaryData(response.body, fileName, response.headers['content-type']);
345
+ }
346
+ }
347
+ returnData.push(executionData);
348
+ }
349
+ catch (error) {
350
+ if (this.continueOnFail()) {
351
+ returnData.push({
352
+ json: { error: error instanceof Error ? error.message : String(error) },
353
+ pairedItem: { item: i },
354
+ });
355
+ continue;
356
+ }
357
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), error, { itemIndex: i });
358
+ }
359
+ }
360
+ return [returnData];
361
+ }
362
+ }
363
+ exports.WaveSpeed = WaveSpeed;
364
+ //# sourceMappingURL=WaveSpeed.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WaveSpeed.node.js","sourceRoot":"","sources":["../../../nodes/WaveSpeed/WaveSpeed.node.ts"],"names":[],"mappings":";;;AAOA,+CAAuE;AAEvE,yDAK4B;AAE5B,MAAa,SAAS;IAAtB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,WAAW;YACxB,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,EAAE,KAAK,EAAE,oBAAoB,EAAE,IAAI,EAAE,yBAAyB,EAAE;YACtE,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,8BAA8B;YACxC,WAAW,EAAE,+DAA+D;YAC5E,QAAQ,EAAE;gBACT,IAAI,EAAE,WAAW;aACjB;YACD,YAAY,EAAE,IAAI;YAClB,MAAM,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YAClC,OAAO,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YACnC,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,cAAc;oBACpB,QAAQ,EAAE,IAAI;iBACd;aACD;YAC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D,aAAa,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,iBAAiB,CACrE,QAAQ,CAAC,IAAI,EACb,QAAQ,EACR,QAAQ,CAAC,OAAO,CAAC,cAAc,CAAC,CAChC,CAAC;oBACH,CAAC;gBACF,CAAC;gBAED,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YAChC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;oBAC3B,UAAU,CAAC,IAAI,CAAC;wBACf,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;wBACvE,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;qBACvB,CAAC,CAAC;oBACH,SAAS;gBACV,CAAC;gBACD,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,KAAc,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC;YAChF,CAAC;QACF,CAAC;QAED,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AA1YD,8BA0YC"}
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 60 60" fill="none">
2
+ <rect width="60" height="60" rx="12" fill="#FFFFFF" fill-opacity="0.08"/>
3
+ <path d="M12 20 L20 44 L26 26 L30 36 L34 26 L40 44 L48 20" stroke="#A78BFA" stroke-width="4.5" stroke-linecap="round" stroke-linejoin="round" fill="none"/>
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 60 60" fill="none">
2
+ <rect width="60" height="60" rx="12" fill="#0A0A0A"/>
3
+ <path d="M12 20 L20 44 L26 26 L30 36 L34 26 L40 44 L48 20" stroke="#7C6AFF" stroke-width="4.5" stroke-linecap="round" stroke-linejoin="round" fill="none"/>
4
+ </svg>
@@ -0,0 +1,67 @@
1
+ {
2
+ "name": "@wavespeed/n8n-nodes-wavespeed",
3
+ "version": "0.1.0",
4
+ "description": "n8n community node for WaveSpeed AI - generate images and videos with hundreds of hosted AI models",
5
+ "keywords": [
6
+ "n8n-community-node-package",
7
+ "wavespeed",
8
+ "ai",
9
+ "image-generation",
10
+ "video-generation",
11
+ "seedream",
12
+ "seedance"
13
+ ],
14
+ "license": "MIT",
15
+ "homepage": "https://wavespeed.ai",
16
+ "author": {
17
+ "name": "WaveSpeedAI",
18
+ "email": "support@wavespeed.ai"
19
+ },
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "https://github.com/WaveSpeedAI/n8n-nodes-wavespeed.git"
23
+ },
24
+ "engines": {
25
+ "node": ">=20"
26
+ },
27
+ "main": "index.js",
28
+ "scripts": {
29
+ "build": "tsc && node scripts/copy-icons.mjs",
30
+ "dev": "tsc --watch",
31
+ "format": "prettier credentials nodes --write",
32
+ "lint": "eslint nodes credentials package.json",
33
+ "lintfix": "eslint nodes credentials package.json --fix",
34
+ "test": "jest",
35
+ "prepublishOnly": "npm run build && npm run lint"
36
+ },
37
+ "files": [
38
+ "dist"
39
+ ],
40
+ "n8n": {
41
+ "n8nNodesApiVersion": 1,
42
+ "credentials": [
43
+ "dist/credentials/WavespeedApi.credentials.js"
44
+ ],
45
+ "nodes": [
46
+ "dist/nodes/WaveSpeed/WaveSpeed.node.js"
47
+ ]
48
+ },
49
+ "devDependencies": {
50
+ "@types/jest": "^29.5.14",
51
+ "@types/node": "^20.17.0",
52
+ "@typescript-eslint/parser": "^7.18.0",
53
+ "eslint": "^8.57.1",
54
+ "eslint-plugin-n8n-nodes-base": "^1.16.3",
55
+ "jest": "^29.7.0",
56
+ "n8n-workflow": "^1.82.0",
57
+ "prettier": "^3.3.3",
58
+ "ts-jest": "^29.2.5",
59
+ "typescript": "^5.5.4"
60
+ },
61
+ "peerDependencies": {
62
+ "n8n-workflow": "*"
63
+ },
64
+ "publishConfig": {
65
+ "access": "public"
66
+ }
67
+ }
package/package.json ADDED
@@ -0,0 +1,67 @@
1
+ {
2
+ "name": "@wavespeed/n8n-nodes-wavespeed",
3
+ "version": "0.1.0",
4
+ "description": "n8n community node for WaveSpeed AI - generate images and videos with hundreds of hosted AI models",
5
+ "keywords": [
6
+ "n8n-community-node-package",
7
+ "wavespeed",
8
+ "ai",
9
+ "image-generation",
10
+ "video-generation",
11
+ "seedream",
12
+ "seedance"
13
+ ],
14
+ "license": "MIT",
15
+ "homepage": "https://wavespeed.ai",
16
+ "author": {
17
+ "name": "WaveSpeedAI",
18
+ "email": "support@wavespeed.ai"
19
+ },
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "https://github.com/WaveSpeedAI/n8n-nodes-wavespeed.git"
23
+ },
24
+ "engines": {
25
+ "node": ">=20"
26
+ },
27
+ "main": "index.js",
28
+ "scripts": {
29
+ "build": "tsc && node scripts/copy-icons.mjs",
30
+ "dev": "tsc --watch",
31
+ "format": "prettier credentials nodes --write",
32
+ "lint": "eslint nodes credentials package.json",
33
+ "lintfix": "eslint nodes credentials package.json --fix",
34
+ "test": "jest",
35
+ "prepublishOnly": "npm run build && npm run lint"
36
+ },
37
+ "files": [
38
+ "dist"
39
+ ],
40
+ "n8n": {
41
+ "n8nNodesApiVersion": 1,
42
+ "credentials": [
43
+ "dist/credentials/WavespeedApi.credentials.js"
44
+ ],
45
+ "nodes": [
46
+ "dist/nodes/WaveSpeed/WaveSpeed.node.js"
47
+ ]
48
+ },
49
+ "devDependencies": {
50
+ "@types/jest": "^29.5.14",
51
+ "@types/node": "^20.17.0",
52
+ "@typescript-eslint/parser": "^7.18.0",
53
+ "eslint": "^8.57.1",
54
+ "eslint-plugin-n8n-nodes-base": "^1.16.3",
55
+ "jest": "^29.7.0",
56
+ "n8n-workflow": "^1.82.0",
57
+ "prettier": "^3.3.3",
58
+ "ts-jest": "^29.2.5",
59
+ "typescript": "^5.5.4"
60
+ },
61
+ "peerDependencies": {
62
+ "n8n-workflow": "*"
63
+ },
64
+ "publishConfig": {
65
+ "access": "public"
66
+ }
67
+ }