n8n-nodes-piapi 0.1.2 → 0.1.3

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.
Files changed (48) hide show
  1. package/README.md +7 -0
  2. package/dist/nodes/PiAPI/DiffRhythm/DiffRhythmAudioGeneration.node.d.ts +5 -0
  3. package/dist/nodes/PiAPI/DiffRhythm/DiffRhythmAudioGeneration.node.js +259 -0
  4. package/dist/nodes/PiAPI/DiffRhythm/DiffRhythmAudioGeneration.node.js.map +1 -0
  5. package/dist/nodes/PiAPI/{Skyreels/SkytreelsImageToVideo.node.d.ts → Faceswap/FaceswapImageToImage.node.d.ts} +1 -1
  6. package/dist/nodes/PiAPI/Faceswap/FaceswapImageToImage.node.js +278 -0
  7. package/dist/nodes/PiAPI/Faceswap/FaceswapImageToImage.node.js.map +1 -0
  8. package/dist/nodes/PiAPI/Faceswap/FaceswapVideoToVideo.node.d.ts +5 -0
  9. package/dist/nodes/PiAPI/Faceswap/FaceswapVideoToVideo.node.js +297 -0
  10. package/dist/nodes/PiAPI/Faceswap/FaceswapVideoToVideo.node.js.map +1 -0
  11. package/dist/nodes/PiAPI/FileUpload/FileUpload.node.d.ts +5 -0
  12. package/dist/nodes/PiAPI/FileUpload/FileUpload.node.js +215 -0
  13. package/dist/nodes/PiAPI/FileUpload/FileUpload.node.js.map +1 -0
  14. package/dist/nodes/PiAPI/ImageUpscale/ImageUpscale.node.d.ts +5 -0
  15. package/dist/nodes/PiAPI/ImageUpscale/ImageUpscale.node.js +209 -0
  16. package/dist/nodes/PiAPI/ImageUpscale/ImageUpscale.node.js.map +1 -0
  17. package/dist/nodes/PiAPI/MMAudio/MMAudioVideoToAudio.node.d.ts +5 -0
  18. package/dist/nodes/PiAPI/MMAudio/MMAudioVideoToAudio.node.js +241 -0
  19. package/dist/nodes/PiAPI/MMAudio/MMAudioVideoToAudio.node.js.map +1 -0
  20. package/dist/nodes/PiAPI/Midjourney/PiAPIMidjourney.node.d.ts +5 -0
  21. package/dist/nodes/PiAPI/Midjourney/PiAPIMidjourney.node.js +426 -0
  22. package/dist/nodes/PiAPI/Midjourney/PiAPIMidjourney.node.js.map +1 -0
  23. package/dist/nodes/PiAPI/Qubico/QubicoSegment.node.d.ts +5 -0
  24. package/dist/nodes/PiAPI/Qubico/QubicoSegment.node.js +243 -0
  25. package/dist/nodes/PiAPI/Qubico/QubicoSegment.node.js.map +1 -0
  26. package/dist/nodes/PiAPI/RemoveBackground/RemoveBackground.node.d.ts +5 -0
  27. package/dist/nodes/PiAPI/RemoveBackground/RemoveBackground.node.js +188 -0
  28. package/dist/nodes/PiAPI/RemoveBackground/RemoveBackground.node.js.map +1 -0
  29. package/dist/nodes/PiAPI/Skyreels/PiAPISkyreels.node.d.ts +5 -0
  30. package/dist/nodes/PiAPI/Skyreels/PiAPISkyreels.node.js +335 -0
  31. package/dist/nodes/PiAPI/Skyreels/PiAPISkyreels.node.js.map +1 -0
  32. package/dist/nodes/PiAPI/Skyreels/SkyreelsImageToVideo.node.d.ts +5 -0
  33. package/dist/nodes/PiAPI/Skyreels/{SkytreelsImageToVideo.node.js → SkyreelsImageToVideo.node.js} +4 -4
  34. package/dist/nodes/PiAPI/Skyreels/SkyreelsImageToVideo.node.js.map +1 -0
  35. package/dist/nodes/PiAPI/Skyreels/index.d.ts +2 -2
  36. package/dist/nodes/PiAPI/Skyreels/index.js +3 -3
  37. package/dist/nodes/PiAPI/Skyreels/index.js.map +1 -1
  38. package/dist/nodes/PiAPI/TTS/TextToSpeech.node.d.ts +5 -0
  39. package/dist/nodes/PiAPI/TTS/TextToSpeech.node.js +214 -0
  40. package/dist/nodes/PiAPI/TTS/TextToSpeech.node.js.map +1 -0
  41. package/dist/nodes/PiAPI/VideoUpscale/VideoUpscale.node.d.ts +5 -0
  42. package/dist/nodes/PiAPI/VideoUpscale/VideoUpscale.node.js +194 -0
  43. package/dist/nodes/PiAPI/VideoUpscale/VideoUpscale.node.js.map +1 -0
  44. package/dist/nodes/PiAPI/shared/Interfaces.d.ts +179 -5
  45. package/dist/package.json +14 -3
  46. package/dist/tsconfig.tsbuildinfo +1 -1
  47. package/package.json +14 -3
  48. package/dist/nodes/PiAPI/Skyreels/SkytreelsImageToVideo.node.js.map +0 -1
package/README.md CHANGED
@@ -14,6 +14,13 @@ This n8n community node enables seamless integration of **[piAPI](https://piapi.
14
14
  - Image to Image
15
15
  - Virtual Try-on
16
16
  - Lip sync
17
+ - Sound Creation
18
+ - Text to 3D
19
+ - Image to 3D
20
+ - Image/Video Upscale
21
+ - Remove Background
22
+ - Segment
23
+ - Temporarely store files
17
24
 
18
25
  ## Installation
19
26
 
@@ -0,0 +1,5 @@
1
+ import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ export declare class DiffRhythmAudioGeneration implements INodeType {
3
+ description: INodeTypeDescription;
4
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
+ }
@@ -0,0 +1,259 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DiffRhythmAudioGeneration = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const GenericFunctions_1 = require("../shared/GenericFunctions");
6
+ class DiffRhythmAudioGeneration {
7
+ constructor() {
8
+ this.description = {
9
+ displayName: 'PiAPI DiffRhythm Audio Generation',
10
+ name: 'diffRhythmAudioGeneration',
11
+ icon: 'file:../piapi.svg',
12
+ group: ['transform'],
13
+ version: 1,
14
+ description: 'Generate audio based on lyrics or style using PiAPI DiffRhythm',
15
+ defaults: {
16
+ name: 'DiffRhythm Audio Generation',
17
+ },
18
+ inputs: ["main"],
19
+ outputs: ["main"],
20
+ credentials: [
21
+ {
22
+ name: 'piAPIApi',
23
+ required: true,
24
+ },
25
+ ],
26
+ properties: [
27
+ {
28
+ displayName: 'Task Type',
29
+ name: 'taskType',
30
+ type: 'options',
31
+ options: [
32
+ {
33
+ name: 'Base (1.35 min)',
34
+ value: 'txt2audio-base',
35
+ description: 'Generate audio up to 1.35 minutes in length',
36
+ },
37
+ {
38
+ name: 'Full (4.45 min)',
39
+ value: 'txt2audio-full',
40
+ description: 'Generate audio up to 4.45 minutes in length',
41
+ },
42
+ ],
43
+ default: 'txt2audio-base',
44
+ description: 'Type of audio generation task',
45
+ },
46
+ {
47
+ displayName: 'Style Prompt',
48
+ name: 'stylePrompt',
49
+ type: 'string',
50
+ typeOptions: {
51
+ rows: 4,
52
+ },
53
+ default: 'pop',
54
+ description: 'Describe the style of audio that you want to generate',
55
+ },
56
+ {
57
+ displayName: 'Include Lyrics',
58
+ name: 'includeLyrics',
59
+ type: 'boolean',
60
+ default: false,
61
+ description: 'Whether to include timestamped lyrics in the audio generation',
62
+ },
63
+ {
64
+ displayName: 'Lyrics',
65
+ name: 'lyrics',
66
+ type: 'string',
67
+ typeOptions: {
68
+ rows: 10,
69
+ },
70
+ default: '',
71
+ description: 'The lyrics of the audio with timestamps (e.g., [00:10.00] First line [00:17.00] Second line)',
72
+ placeholder: '[00:10.00] Drifting through the Milky Way\'s glow, stars hum low and bright\n[00:17.00] Every shadow hides a cosmos, burning without light',
73
+ displayOptions: {
74
+ show: {
75
+ includeLyrics: [true],
76
+ },
77
+ },
78
+ },
79
+ {
80
+ displayName: 'Lyrics Format',
81
+ name: 'lyricsFormat',
82
+ type: 'notice',
83
+ default: 'Lyrics should be formatted with timestamps like: [00:10.00] First line [00:17.00] Second line',
84
+ displayOptions: {
85
+ show: {
86
+ includeLyrics: [true],
87
+ },
88
+ },
89
+ },
90
+ {
91
+ displayName: 'Include Reference Audio',
92
+ name: 'includeReferenceAudio',
93
+ type: 'boolean',
94
+ default: false,
95
+ description: 'Whether to include a reference audio for style',
96
+ },
97
+ {
98
+ displayName: 'Reference Audio Input Method',
99
+ name: 'referenceAudioInputMethod',
100
+ type: 'options',
101
+ options: [
102
+ {
103
+ name: 'URL',
104
+ value: 'url',
105
+ },
106
+ {
107
+ name: 'Binary Data',
108
+ value: 'binaryData',
109
+ },
110
+ ],
111
+ default: 'url',
112
+ description: 'Method to input the reference audio data',
113
+ displayOptions: {
114
+ show: {
115
+ includeReferenceAudio: [true],
116
+ },
117
+ },
118
+ },
119
+ {
120
+ displayName: 'Reference Audio Binary Property',
121
+ name: 'referenceAudioBinaryPropertyName',
122
+ type: 'string',
123
+ default: 'data',
124
+ required: true,
125
+ displayOptions: {
126
+ show: {
127
+ includeReferenceAudio: [true],
128
+ referenceAudioInputMethod: ['binaryData'],
129
+ },
130
+ },
131
+ description: 'Name of the binary property containing the reference audio data',
132
+ },
133
+ {
134
+ displayName: 'Reference Audio URL',
135
+ name: 'referenceAudioUrl',
136
+ type: 'string',
137
+ default: '',
138
+ required: true,
139
+ displayOptions: {
140
+ show: {
141
+ includeReferenceAudio: [true],
142
+ referenceAudioInputMethod: ['url'],
143
+ },
144
+ },
145
+ description: 'URL of the reference audio for style',
146
+ },
147
+ {
148
+ displayName: 'Wait For Completion',
149
+ name: 'waitForCompletion',
150
+ type: 'boolean',
151
+ default: false,
152
+ description: 'Whether to wait for the audio generation process to complete before continuing',
153
+ },
154
+ {
155
+ displayName: 'Max Retries',
156
+ name: 'maxRetries',
157
+ type: 'number',
158
+ default: 60,
159
+ description: 'Maximum number of retries to check task status (audio generation may take longer)',
160
+ displayOptions: {
161
+ show: {
162
+ waitForCompletion: [true],
163
+ },
164
+ },
165
+ },
166
+ {
167
+ displayName: 'Retry Interval',
168
+ name: 'retryInterval',
169
+ type: 'number',
170
+ default: 5000,
171
+ description: 'Interval between retries in milliseconds',
172
+ displayOptions: {
173
+ show: {
174
+ waitForCompletion: [true],
175
+ },
176
+ },
177
+ },
178
+ ],
179
+ };
180
+ }
181
+ async execute() {
182
+ var _a, _b;
183
+ const items = this.getInputData();
184
+ const returnData = [];
185
+ for (let i = 0; i < items.length; i++) {
186
+ try {
187
+ const taskType = this.getNodeParameter('taskType', i);
188
+ const stylePrompt = this.getNodeParameter('stylePrompt', i);
189
+ const includeLyrics = this.getNodeParameter('includeLyrics', i, false);
190
+ const includeReferenceAudio = this.getNodeParameter('includeReferenceAudio', i, false);
191
+ const waitForCompletion = this.getNodeParameter('waitForCompletion', i, false);
192
+ const requestBody = {
193
+ model: 'Qubico/diffrhythm',
194
+ task_type: taskType,
195
+ input: {
196
+ style_prompt: stylePrompt,
197
+ },
198
+ config: {},
199
+ };
200
+ if (includeLyrics) {
201
+ const lyrics = this.getNodeParameter('lyrics', i, '');
202
+ if (lyrics) {
203
+ requestBody.input.lyrics = lyrics;
204
+ }
205
+ }
206
+ if (includeReferenceAudio) {
207
+ const referenceAudioInputMethod = this.getNodeParameter('referenceAudioInputMethod', i);
208
+ if (referenceAudioInputMethod === 'url') {
209
+ const referenceAudioUrl = this.getNodeParameter('referenceAudioUrl', i);
210
+ requestBody.input.style_audio = referenceAudioUrl;
211
+ }
212
+ else {
213
+ const referenceAudioBinaryPropertyName = this.getNodeParameter('referenceAudioBinaryPropertyName', i);
214
+ const referenceAudioBinaryData = this.helpers.assertBinaryData(i, referenceAudioBinaryPropertyName);
215
+ if (referenceAudioBinaryData.mimeType && !referenceAudioBinaryData.mimeType.includes('audio')) {
216
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'The provided binary data is not an audio file', { itemIndex: i });
217
+ }
218
+ const base64String = Buffer.from(await this.helpers.getBinaryDataBuffer(i, referenceAudioBinaryPropertyName)).toString('base64');
219
+ requestBody.input.style_audio = `data:${referenceAudioBinaryData.mimeType};base64,${base64String}`;
220
+ }
221
+ }
222
+ const response = await GenericFunctions_1.piApiRequest.call(this, 'POST', '/api/v1/task', requestBody);
223
+ const taskId = (_a = response.data) === null || _a === void 0 ? void 0 : _a.task_id;
224
+ if (!taskId) {
225
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Failed to get a valid task ID from the API');
226
+ }
227
+ let executionData;
228
+ if (waitForCompletion) {
229
+ const maxRetries = this.getNodeParameter('maxRetries', i, 60);
230
+ const retryInterval = this.getNodeParameter('retryInterval', i, 5000);
231
+ executionData = await GenericFunctions_1.waitForTaskCompletion.call(this, taskId, maxRetries, retryInterval);
232
+ }
233
+ else {
234
+ executionData = {
235
+ task_id: taskId,
236
+ status: ((_b = response.data) === null || _b === void 0 ? void 0 : _b.status) || 'pending',
237
+ };
238
+ }
239
+ returnData.push({
240
+ json: executionData,
241
+ });
242
+ }
243
+ catch (error) {
244
+ if (this.continueOnFail()) {
245
+ returnData.push({
246
+ json: {
247
+ error: error.message,
248
+ },
249
+ });
250
+ continue;
251
+ }
252
+ throw error;
253
+ }
254
+ }
255
+ return [returnData];
256
+ }
257
+ }
258
+ exports.DiffRhythmAudioGeneration = DiffRhythmAudioGeneration;
259
+ //# sourceMappingURL=DiffRhythmAudioGeneration.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DiffRhythmAudioGeneration.node.js","sourceRoot":"","sources":["../../../../nodes/PiAPI/DiffRhythm/DiffRhythmAudioGeneration.node.ts"],"names":[],"mappings":";;;AAAA,+CAQsB;AAEtB,iEAAiF;AAGjF,MAAa,yBAAyB;IAAtC;QACI,gBAAW,GAAyB;YAChC,WAAW,EAAE,mCAAmC;YAChD,IAAI,EAAE,2BAA2B;YACjC,IAAI,EAAE,mBAAmB;YACzB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,gEAAgE;YAC7E,QAAQ,EAAE;gBACN,IAAI,EAAE,6BAA6B;aACtC;YACD,MAAM,EAAE,QAAyB;YACjC,OAAO,EAAE,QAAyB;YAClC,WAAW,EAAE;gBACT;oBACI,IAAI,EAAE,UAAU;oBAChB,QAAQ,EAAE,IAAI;iBACjB;aACJ;YACD,UAAU,EAAE;gBAER;oBACI,WAAW,EAAE,WAAW;oBACxB,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE;wBACL;4BACI,IAAI,EAAE,iBAAiB;4BACvB,KAAK,EAAE,gBAAgB;4BACvB,WAAW,EAAE,6CAA6C;yBA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AAU,CAAC,CAAC;IACxB,CAAC;CACJ;AArSD,8DAqSC"}
@@ -1,5 +1,5 @@
1
1
  import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
- export declare class SkytreelsImageToVideo implements INodeType {
2
+ export declare class FaceswapImageToImage implements INodeType {
3
3
  description: INodeTypeDescription;
4
4
  execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
5
  }
@@ -0,0 +1,278 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FaceswapImageToImage = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const GenericFunctions_1 = require("../shared/GenericFunctions");
6
+ class FaceswapImageToImage {
7
+ constructor() {
8
+ this.description = {
9
+ displayName: 'PiAPI Faceswap',
10
+ name: 'faceswapImageToImage',
11
+ icon: 'file:../piapi.svg',
12
+ group: ['transform'],
13
+ version: 1,
14
+ description: 'Swap faces in images using PiAPI Faceswap',
15
+ defaults: {
16
+ name: 'Faceswap',
17
+ },
18
+ inputs: ["main"],
19
+ outputs: ["main"],
20
+ credentials: [
21
+ {
22
+ name: 'piAPIApi',
23
+ required: true,
24
+ },
25
+ ],
26
+ properties: [
27
+ {
28
+ displayName: 'Target Image Input Method',
29
+ name: 'targetImageInputMethod',
30
+ type: 'options',
31
+ options: [
32
+ {
33
+ name: 'URL',
34
+ value: 'url',
35
+ },
36
+ {
37
+ name: 'Binary Data',
38
+ value: 'binaryData',
39
+ },
40
+ ],
41
+ default: 'url',
42
+ description: 'Method to input the target image data',
43
+ },
44
+ {
45
+ displayName: 'Target Image Binary Property',
46
+ name: 'targetBinaryPropertyName',
47
+ type: 'string',
48
+ default: 'data',
49
+ required: true,
50
+ displayOptions: {
51
+ show: {
52
+ targetImageInputMethod: ['binaryData'],
53
+ },
54
+ },
55
+ description: 'Name of the binary property containing the target image data',
56
+ },
57
+ {
58
+ displayName: 'Target Image URL',
59
+ name: 'targetImageUrl',
60
+ type: 'string',
61
+ default: '',
62
+ required: true,
63
+ displayOptions: {
64
+ show: {
65
+ targetImageInputMethod: ['url'],
66
+ },
67
+ },
68
+ description: 'URL of the target image that will have faces replaced',
69
+ },
70
+ {
71
+ displayName: 'Swap Image Input Method',
72
+ name: 'swapImageInputMethod',
73
+ type: 'options',
74
+ options: [
75
+ {
76
+ name: 'URL',
77
+ value: 'url',
78
+ },
79
+ {
80
+ name: 'Binary Data',
81
+ value: 'binaryData',
82
+ },
83
+ ],
84
+ default: 'url',
85
+ description: 'Method to input the swap image data',
86
+ },
87
+ {
88
+ displayName: 'Swap Image Binary Property',
89
+ name: 'swapBinaryPropertyName',
90
+ type: 'string',
91
+ default: 'data',
92
+ required: true,
93
+ displayOptions: {
94
+ show: {
95
+ swapImageInputMethod: ['binaryData'],
96
+ },
97
+ },
98
+ description: 'Name of the binary property containing the swap image data',
99
+ },
100
+ {
101
+ displayName: 'Swap Image URL',
102
+ name: 'swapImageUrl',
103
+ type: 'string',
104
+ default: '',
105
+ required: true,
106
+ displayOptions: {
107
+ show: {
108
+ swapImageInputMethod: ['url'],
109
+ },
110
+ },
111
+ description: 'URL of the image containing the face(s) to swap',
112
+ },
113
+ {
114
+ displayName: 'Face Indices Information',
115
+ name: 'faceIndicesInfo',
116
+ type: 'notice',
117
+ default: 'Faces are detected in order from left to right in most cases. For diagonal positioning, top-left might be 1 and bottom-right 0. Leave blank to swap all detected faces.',
118
+ },
119
+ {
120
+ displayName: 'Advanced Options',
121
+ name: 'advancedOptions',
122
+ type: 'collection',
123
+ placeholder: 'Add Option',
124
+ default: {},
125
+ options: [
126
+ {
127
+ displayName: 'Swap Faces Index',
128
+ name: 'swapFacesIndex',
129
+ type: 'string',
130
+ default: '',
131
+ placeholder: '0 or 0,1',
132
+ description: 'Index(es) of faces to use from the swap image (e.g., "0" or "1,0")',
133
+ },
134
+ {
135
+ displayName: 'Target Faces Index',
136
+ name: 'targetFacesIndex',
137
+ type: 'string',
138
+ default: '',
139
+ placeholder: '0 or 0,1',
140
+ description: 'Index(es) of faces to replace in the target image (e.g., "0" or "0,1")',
141
+ },
142
+ ],
143
+ },
144
+ {
145
+ displayName: 'Wait For Completion',
146
+ name: 'waitForCompletion',
147
+ type: 'boolean',
148
+ default: false,
149
+ description: 'Whether to wait for the face swap process to complete before continuing',
150
+ },
151
+ {
152
+ displayName: 'Max Retries',
153
+ name: 'maxRetries',
154
+ type: 'number',
155
+ default: 20,
156
+ description: 'Maximum number of retries to check task status',
157
+ displayOptions: {
158
+ show: {
159
+ waitForCompletion: [true],
160
+ },
161
+ },
162
+ },
163
+ {
164
+ displayName: 'Retry Interval',
165
+ name: 'retryInterval',
166
+ type: 'number',
167
+ default: 3000,
168
+ description: 'Interval between retries in milliseconds',
169
+ displayOptions: {
170
+ show: {
171
+ waitForCompletion: [true],
172
+ },
173
+ },
174
+ },
175
+ ],
176
+ };
177
+ }
178
+ async execute() {
179
+ var _a, _b;
180
+ const items = this.getInputData();
181
+ const returnData = [];
182
+ for (let i = 0; i < items.length; i++) {
183
+ try {
184
+ const targetImageInputMethod = this.getNodeParameter('targetImageInputMethod', i);
185
+ const swapImageInputMethod = this.getNodeParameter('swapImageInputMethod', i);
186
+ const waitForCompletion = this.getNodeParameter('waitForCompletion', i, false);
187
+ const advancedOptions = this.getNodeParameter('advancedOptions', i, {});
188
+ let targetImageData;
189
+ if (targetImageInputMethod === 'url') {
190
+ targetImageData = this.getNodeParameter('targetImageUrl', i);
191
+ }
192
+ else {
193
+ const targetBinaryPropertyName = this.getNodeParameter('targetBinaryPropertyName', i);
194
+ const targetBinaryData = this.helpers.assertBinaryData(i, targetBinaryPropertyName);
195
+ if (targetBinaryData.mimeType && !targetBinaryData.mimeType.includes('image')) {
196
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'The provided target binary data is not an image', { itemIndex: i });
197
+ }
198
+ const base64String = Buffer.from(await this.helpers.getBinaryDataBuffer(i, targetBinaryPropertyName)).toString('base64');
199
+ targetImageData = `data:${targetBinaryData.mimeType};base64,${base64String}`;
200
+ }
201
+ let swapImageData;
202
+ if (swapImageInputMethod === 'url') {
203
+ swapImageData = this.getNodeParameter('swapImageUrl', i);
204
+ }
205
+ else {
206
+ const swapBinaryPropertyName = this.getNodeParameter('swapBinaryPropertyName', i);
207
+ const swapBinaryData = this.helpers.assertBinaryData(i, swapBinaryPropertyName);
208
+ if (swapBinaryData.mimeType && !swapBinaryData.mimeType.includes('image')) {
209
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'The provided swap binary data is not an image', { itemIndex: i });
210
+ }
211
+ const base64String = Buffer.from(await this.helpers.getBinaryDataBuffer(i, swapBinaryPropertyName)).toString('base64');
212
+ swapImageData = `data:${swapBinaryData.mimeType};base64,${base64String}`;
213
+ }
214
+ const requestBody = {
215
+ model: 'Qubico/image-toolkit',
216
+ task_type: 'face-swap',
217
+ input: {
218
+ target_image: targetImageData,
219
+ swap_image: swapImageData,
220
+ },
221
+ };
222
+ if (advancedOptions.swapFacesIndex) {
223
+ requestBody.input.swap_faces_index = advancedOptions.swapFacesIndex;
224
+ }
225
+ if (advancedOptions.targetFacesIndex) {
226
+ requestBody.input.target_faces_index = advancedOptions.targetFacesIndex;
227
+ }
228
+ const response = await GenericFunctions_1.piApiRequest.call(this, 'POST', '/api/v1/task', requestBody);
229
+ const taskId = (_a = response.data) === null || _a === void 0 ? void 0 : _a.task_id;
230
+ if (!taskId) {
231
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Failed to get a valid task ID from the API');
232
+ }
233
+ let executionData;
234
+ if (waitForCompletion) {
235
+ const maxRetries = this.getNodeParameter('maxRetries', i, 20);
236
+ const retryInterval = this.getNodeParameter('retryInterval', i, 3000);
237
+ executionData = await GenericFunctions_1.waitForTaskCompletion.call(this, taskId, maxRetries, retryInterval);
238
+ }
239
+ else {
240
+ executionData = {
241
+ task_id: taskId,
242
+ status: ((_b = response.data) === null || _b === void 0 ? void 0 : _b.status) || 'pending',
243
+ };
244
+ }
245
+ returnData.push({
246
+ json: executionData,
247
+ });
248
+ }
249
+ catch (error) {
250
+ if (error.message && error.message.includes('failed to get valid image')) {
251
+ const errorMessage = 'The API could not process the provided image. Please ensure the image is accessible, in a common format (JPEG, PNG), and meets the size requirements (under 2048x2048 resolution).';
252
+ if (this.continueOnFail()) {
253
+ returnData.push({
254
+ json: {
255
+ error: errorMessage,
256
+ details: error.message,
257
+ },
258
+ });
259
+ continue;
260
+ }
261
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), errorMessage);
262
+ }
263
+ if (this.continueOnFail()) {
264
+ returnData.push({
265
+ json: {
266
+ error: error.message,
267
+ },
268
+ });
269
+ continue;
270
+ }
271
+ throw error;
272
+ }
273
+ }
274
+ return [returnData];
275
+ }
276
+ }
277
+ exports.FaceswapImageToImage = FaceswapImageToImage;
278
+ //# sourceMappingURL=FaceswapImageToImage.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FaceswapImageToImage.node.js","sourceRoot":"","sources":["../../../../nodes/PiAPI/Faceswap/FaceswapImageToImage.node.ts"],"names":[],"mappings":";;;AAAA,+CAQsB;AAEtB,iEAAiF;AAGjF,MAAa,oBAAoB;IAAjC;QACI,gBAAW,GAAyB;YAChC,WAAW,EAAE,gBAAgB;YAC7B,IAAI,EAAE,sBAAsB;YAC5B,IAAI,EAAE,mBAAmB;YACzB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,2CAA2C;YACxD,QAAQ,EAAE;gBACN,IAAI,EAAE,UAAU;aACnB;YACD,MAAM,EAAE,QAAyB;YACjC,OAAO,EAAE,QAAyB;YAClC,WAAW,EAAE;gBACT;oBACI,IAAI,EAAE,UAAU;oBAChB,QAAQ,EAAE,IAAI;iBACjB;aACJ;YACD,UAAU,EAAE;gBAER;oBACI,WAAW,EAAE,2BAA2B;oBACxC,IAAI,EAAE,wBAAwB;oBAC9B,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE;wBACL;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C5C,IAAI,EACJ,MAAM,EACN,UAAU,EACV,aAAa,CAChB,CAAC;gBACN,CAAC;qBAAM,CAAC;oBAEJ,aAAa,GAAG;wBACZ,OAAO,EAAE,MAAM;wBACf,MAAM,EAAE,CAAA,MAAA,QAAQ,CAAC,IAAI,0CAAE,MAAM,KAAI,SAAS;qBAC7C,CAAC;gBACN,CAAC;gBAED,UAAU,CAAC,IAAI,CAAC;oBACZ,IAAI,EAAE,aAAa;iBACtB,CAAC,CAAC;YACP,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAEb,IAAI,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,2BAA2B,CAAC,EAAE,CAAC;oBACvE,MAAM,YAAY,GAAG,oLAAoL,CAAC;oBAC1M,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;wBACxB,UAAU,CAAC,IAAI,CAAC;4BACZ,IAAI,EAAE;gCACF,KAAK,EAAE,YAAY;gCACnB,OAAO,EAAE,KAAK,CAAC,OAAO;6BACzB;yBACJ,CAAC,CAAC;wBACH,SAAS;oBACb,CAAC;oBACD,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,CAAC;gBAC/D,CAAC;gBAED,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;oBACxB,UAAU,CAAC,IAAI,CAAC;wBACZ,IAAI,EAAE;4BACF,KAAK,EAAE,KAAK,CAAC,OAAO;yBACvB;qBACJ,CAAC,CAAC;oBACH,SAAS;gBACb,CAAC;gBACD,MAAM,KAAK,CAAC;YAChB,CAAC;QACL,CAAC;QAED,OAAO,CAAC,UAAU,CAAC,CAAC;IACxB,CAAC;CACJ;AA1UD,oDA0UC"}
@@ -0,0 +1,5 @@
1
+ import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ export declare class FaceswapVideoToVideo implements INodeType {
3
+ description: INodeTypeDescription;
4
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
+ }