n8n-nodes-piapi 0.1.2 → 0.1.4
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 +8 -1
- package/dist/nodes/PiAPI/DiffRhythm/DiffRhythmAudioGeneration.node.d.ts +5 -0
- package/dist/nodes/PiAPI/DiffRhythm/DiffRhythmAudioGeneration.node.js +259 -0
- package/dist/nodes/PiAPI/DiffRhythm/DiffRhythmAudioGeneration.node.js.map +1 -0
- package/dist/nodes/PiAPI/{Skyreels/SkytreelsImageToVideo.node.d.ts → Faceswap/FaceswapImageToImage.node.d.ts} +1 -1
- package/dist/nodes/PiAPI/Faceswap/FaceswapImageToImage.node.js +278 -0
- package/dist/nodes/PiAPI/Faceswap/FaceswapImageToImage.node.js.map +1 -0
- package/dist/nodes/PiAPI/Faceswap/FaceswapVideoToVideo.node.d.ts +5 -0
- package/dist/nodes/PiAPI/Faceswap/FaceswapVideoToVideo.node.js +297 -0
- package/dist/nodes/PiAPI/Faceswap/FaceswapVideoToVideo.node.js.map +1 -0
- package/dist/nodes/PiAPI/FileUpload/FileUpload.node.d.ts +5 -0
- package/dist/nodes/PiAPI/FileUpload/FileUpload.node.js +215 -0
- package/dist/nodes/PiAPI/FileUpload/FileUpload.node.js.map +1 -0
- package/dist/nodes/PiAPI/Flux/FluxTextToImage.node.js +20 -8
- package/dist/nodes/PiAPI/Flux/FluxTextToImage.node.js.map +1 -1
- package/dist/nodes/PiAPI/ImageUpscale/ImageUpscale.node.d.ts +5 -0
- package/dist/nodes/PiAPI/ImageUpscale/ImageUpscale.node.js +209 -0
- package/dist/nodes/PiAPI/ImageUpscale/ImageUpscale.node.js.map +1 -0
- package/dist/nodes/PiAPI/MMAudio/MMAudioVideoToAudio.node.d.ts +5 -0
- package/dist/nodes/PiAPI/MMAudio/MMAudioVideoToAudio.node.js +241 -0
- package/dist/nodes/PiAPI/MMAudio/MMAudioVideoToAudio.node.js.map +1 -0
- package/dist/nodes/PiAPI/Midjourney/PiAPIMidjourney.node.d.ts +5 -0
- package/dist/nodes/PiAPI/Midjourney/PiAPIMidjourney.node.js +426 -0
- package/dist/nodes/PiAPI/Midjourney/PiAPIMidjourney.node.js.map +1 -0
- package/dist/nodes/PiAPI/Qubico/QubicoSegment.node.d.ts +5 -0
- package/dist/nodes/PiAPI/Qubico/QubicoSegment.node.js +243 -0
- package/dist/nodes/PiAPI/Qubico/QubicoSegment.node.js.map +1 -0
- package/dist/nodes/PiAPI/RemoveBackground/RemoveBackground.node.d.ts +5 -0
- package/dist/nodes/PiAPI/RemoveBackground/RemoveBackground.node.js +188 -0
- package/dist/nodes/PiAPI/RemoveBackground/RemoveBackground.node.js.map +1 -0
- package/dist/nodes/PiAPI/Skyreels/PiAPISkyreels.node.d.ts +5 -0
- package/dist/nodes/PiAPI/Skyreels/PiAPISkyreels.node.js +335 -0
- package/dist/nodes/PiAPI/Skyreels/PiAPISkyreels.node.js.map +1 -0
- package/dist/nodes/PiAPI/Skyreels/SkyreelsImageToVideo.node.d.ts +5 -0
- package/dist/nodes/PiAPI/Skyreels/{SkytreelsImageToVideo.node.js → SkyreelsImageToVideo.node.js} +4 -4
- package/dist/nodes/PiAPI/Skyreels/SkyreelsImageToVideo.node.js.map +1 -0
- package/dist/nodes/PiAPI/Skyreels/index.d.ts +2 -2
- package/dist/nodes/PiAPI/Skyreels/index.js +3 -3
- package/dist/nodes/PiAPI/Skyreels/index.js.map +1 -1
- package/dist/nodes/PiAPI/TTS/TextToSpeech.node.d.ts +5 -0
- package/dist/nodes/PiAPI/TTS/TextToSpeech.node.js +214 -0
- package/dist/nodes/PiAPI/TTS/TextToSpeech.node.js.map +1 -0
- package/dist/nodes/PiAPI/VideoUpscale/VideoUpscale.node.d.ts +5 -0
- package/dist/nodes/PiAPI/VideoUpscale/VideoUpscale.node.js +194 -0
- package/dist/nodes/PiAPI/VideoUpscale/VideoUpscale.node.js.map +1 -0
- package/dist/nodes/PiAPI/shared/Interfaces.d.ts +179 -5
- package/dist/package.json +14 -3
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -3
- package/dist/nodes/PiAPI/Skyreels/SkytreelsImageToVideo.node.js.map +0 -1
@@ -0,0 +1,209 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.ImageUpscale = void 0;
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
5
|
+
const GenericFunctions_1 = require("../shared/GenericFunctions");
|
6
|
+
class ImageUpscale {
|
7
|
+
constructor() {
|
8
|
+
this.description = {
|
9
|
+
displayName: 'PiAPI Image Upscale',
|
10
|
+
name: 'imageUpscale',
|
11
|
+
icon: 'file:../piapi.svg',
|
12
|
+
group: ['transform'],
|
13
|
+
version: 1,
|
14
|
+
description: 'Enhance image resolution using PiAPI Image Upscale',
|
15
|
+
defaults: {
|
16
|
+
name: 'Image Upscale',
|
17
|
+
},
|
18
|
+
inputs: ["main"],
|
19
|
+
outputs: ["main"],
|
20
|
+
credentials: [
|
21
|
+
{
|
22
|
+
name: 'piAPIApi',
|
23
|
+
required: true,
|
24
|
+
},
|
25
|
+
],
|
26
|
+
properties: [
|
27
|
+
{
|
28
|
+
displayName: 'Image Input Method',
|
29
|
+
name: 'imageInputMethod',
|
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 image data',
|
43
|
+
},
|
44
|
+
{
|
45
|
+
displayName: 'Image Binary Property',
|
46
|
+
name: 'imageBinaryPropertyName',
|
47
|
+
type: 'string',
|
48
|
+
default: 'data',
|
49
|
+
required: true,
|
50
|
+
displayOptions: {
|
51
|
+
show: {
|
52
|
+
imageInputMethod: ['binaryData'],
|
53
|
+
},
|
54
|
+
},
|
55
|
+
description: 'Name of the binary property containing the image data',
|
56
|
+
},
|
57
|
+
{
|
58
|
+
displayName: 'Image URL',
|
59
|
+
name: 'imageUrl',
|
60
|
+
type: 'string',
|
61
|
+
default: '',
|
62
|
+
required: true,
|
63
|
+
displayOptions: {
|
64
|
+
show: {
|
65
|
+
imageInputMethod: ['url'],
|
66
|
+
},
|
67
|
+
},
|
68
|
+
description: 'URL of the image to upscale',
|
69
|
+
},
|
70
|
+
{
|
71
|
+
displayName: 'Image Requirements',
|
72
|
+
name: 'imageRequirements',
|
73
|
+
type: 'notice',
|
74
|
+
default: 'The image should be in a common format (JPEG, PNG) and must not exceed 10MB in size.',
|
75
|
+
},
|
76
|
+
{
|
77
|
+
displayName: 'Scale Factor',
|
78
|
+
name: 'scaleFactor',
|
79
|
+
type: 'options',
|
80
|
+
options: [
|
81
|
+
{
|
82
|
+
name: '2x',
|
83
|
+
value: 2,
|
84
|
+
description: 'Double the resolution (default)',
|
85
|
+
},
|
86
|
+
{
|
87
|
+
name: '4x',
|
88
|
+
value: 4,
|
89
|
+
description: 'Quadruple the resolution',
|
90
|
+
},
|
91
|
+
],
|
92
|
+
default: 2,
|
93
|
+
description: 'Factor by which to upscale the image resolution',
|
94
|
+
},
|
95
|
+
{
|
96
|
+
displayName: 'Wait For Completion',
|
97
|
+
name: 'waitForCompletion',
|
98
|
+
type: 'boolean',
|
99
|
+
default: false,
|
100
|
+
description: 'Whether to wait for the image upscaling process to complete before continuing',
|
101
|
+
},
|
102
|
+
{
|
103
|
+
displayName: 'Max Retries',
|
104
|
+
name: 'maxRetries',
|
105
|
+
type: 'number',
|
106
|
+
default: 20,
|
107
|
+
description: 'Maximum number of retries to check task status',
|
108
|
+
displayOptions: {
|
109
|
+
show: {
|
110
|
+
waitForCompletion: [true],
|
111
|
+
},
|
112
|
+
},
|
113
|
+
},
|
114
|
+
{
|
115
|
+
displayName: 'Retry Interval',
|
116
|
+
name: 'retryInterval',
|
117
|
+
type: 'number',
|
118
|
+
default: 3000,
|
119
|
+
description: 'Interval between retries in milliseconds',
|
120
|
+
displayOptions: {
|
121
|
+
show: {
|
122
|
+
waitForCompletion: [true],
|
123
|
+
},
|
124
|
+
},
|
125
|
+
},
|
126
|
+
],
|
127
|
+
};
|
128
|
+
}
|
129
|
+
async execute() {
|
130
|
+
var _a, _b;
|
131
|
+
const items = this.getInputData();
|
132
|
+
const returnData = [];
|
133
|
+
for (let i = 0; i < items.length; i++) {
|
134
|
+
try {
|
135
|
+
const imageInputMethod = this.getNodeParameter('imageInputMethod', i);
|
136
|
+
const scaleFactor = this.getNodeParameter('scaleFactor', i, 2);
|
137
|
+
const waitForCompletion = this.getNodeParameter('waitForCompletion', i, false);
|
138
|
+
let imageData;
|
139
|
+
if (imageInputMethod === 'url') {
|
140
|
+
imageData = this.getNodeParameter('imageUrl', i);
|
141
|
+
}
|
142
|
+
else {
|
143
|
+
const imageBinaryPropertyName = this.getNodeParameter('imageBinaryPropertyName', i);
|
144
|
+
const imageBinaryData = this.helpers.assertBinaryData(i, imageBinaryPropertyName);
|
145
|
+
if (imageBinaryData.mimeType && !imageBinaryData.mimeType.includes('image')) {
|
146
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'The provided binary data is not an image', { itemIndex: i });
|
147
|
+
}
|
148
|
+
const base64String = Buffer.from(await this.helpers.getBinaryDataBuffer(i, imageBinaryPropertyName)).toString('base64');
|
149
|
+
imageData = `data:${imageBinaryData.mimeType};base64,${base64String}`;
|
150
|
+
}
|
151
|
+
const requestBody = {
|
152
|
+
model: 'Qubico/image-toolkit',
|
153
|
+
task_type: 'upscale',
|
154
|
+
input: {
|
155
|
+
image: imageData,
|
156
|
+
scale: scaleFactor,
|
157
|
+
},
|
158
|
+
};
|
159
|
+
const response = await GenericFunctions_1.piApiRequest.call(this, 'POST', '/api/v1/task', requestBody);
|
160
|
+
const taskId = (_a = response.data) === null || _a === void 0 ? void 0 : _a.task_id;
|
161
|
+
if (!taskId) {
|
162
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Failed to get a valid task ID from the API');
|
163
|
+
}
|
164
|
+
let executionData;
|
165
|
+
if (waitForCompletion) {
|
166
|
+
const maxRetries = this.getNodeParameter('maxRetries', i, 20);
|
167
|
+
const retryInterval = this.getNodeParameter('retryInterval', i, 3000);
|
168
|
+
executionData = await GenericFunctions_1.waitForTaskCompletion.call(this, taskId, maxRetries, retryInterval);
|
169
|
+
}
|
170
|
+
else {
|
171
|
+
executionData = {
|
172
|
+
task_id: taskId,
|
173
|
+
status: ((_b = response.data) === null || _b === void 0 ? void 0 : _b.status) || 'pending',
|
174
|
+
};
|
175
|
+
}
|
176
|
+
returnData.push({
|
177
|
+
json: executionData,
|
178
|
+
});
|
179
|
+
}
|
180
|
+
catch (error) {
|
181
|
+
if (error.message && error.message.includes('failed to get valid image')) {
|
182
|
+
const errorMessage = 'The API could not process the provided image. Please ensure the image is accessible, in a common format (JPEG, PNG), and not too large (under 10MB).';
|
183
|
+
if (this.continueOnFail()) {
|
184
|
+
returnData.push({
|
185
|
+
json: {
|
186
|
+
error: errorMessage,
|
187
|
+
details: error.message,
|
188
|
+
},
|
189
|
+
});
|
190
|
+
continue;
|
191
|
+
}
|
192
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), errorMessage);
|
193
|
+
}
|
194
|
+
if (this.continueOnFail()) {
|
195
|
+
returnData.push({
|
196
|
+
json: {
|
197
|
+
error: error.message,
|
198
|
+
},
|
199
|
+
});
|
200
|
+
continue;
|
201
|
+
}
|
202
|
+
throw error;
|
203
|
+
}
|
204
|
+
}
|
205
|
+
return [returnData];
|
206
|
+
}
|
207
|
+
}
|
208
|
+
exports.ImageUpscale = ImageUpscale;
|
209
|
+
//# sourceMappingURL=ImageUpscale.node.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ImageUpscale.node.js","sourceRoot":"","sources":["../../../../nodes/PiAPI/ImageUpscale/ImageUpscale.node.ts"],"names":[],"mappings":";;;AAAA,+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AA2B,CAAC,EAAE,CAAC;oBACvE,MAAM,YAAY,GAAG,sJAAsJ,CAAC;oBAC5K,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;AAjPD,oCAiPC"}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
2
|
+
export declare class MMAudioVideoToAudio implements INodeType {
|
3
|
+
description: INodeTypeDescription;
|
4
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
5
|
+
}
|
@@ -0,0 +1,241 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.MMAudioVideoToAudio = void 0;
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
5
|
+
const GenericFunctions_1 = require("../shared/GenericFunctions");
|
6
|
+
class MMAudioVideoToAudio {
|
7
|
+
constructor() {
|
8
|
+
this.description = {
|
9
|
+
displayName: 'PiAPI MMAudio',
|
10
|
+
name: 'mmaudioVideoToAudio',
|
11
|
+
icon: 'file:../piapi.svg',
|
12
|
+
group: ['transform'],
|
13
|
+
version: 1,
|
14
|
+
description: 'Generate audio for videos using PiAPI MMAudio',
|
15
|
+
defaults: {
|
16
|
+
name: 'MMAudio Video to Audio',
|
17
|
+
},
|
18
|
+
inputs: ["main"],
|
19
|
+
outputs: ["main"],
|
20
|
+
credentials: [
|
21
|
+
{
|
22
|
+
name: 'piAPIApi',
|
23
|
+
required: true,
|
24
|
+
},
|
25
|
+
],
|
26
|
+
properties: [
|
27
|
+
{
|
28
|
+
displayName: 'Video Input Method',
|
29
|
+
name: 'videoInputMethod',
|
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 video data',
|
43
|
+
},
|
44
|
+
{
|
45
|
+
displayName: 'Video Binary Property',
|
46
|
+
name: 'videoBinaryPropertyName',
|
47
|
+
type: 'string',
|
48
|
+
default: 'data',
|
49
|
+
required: true,
|
50
|
+
displayOptions: {
|
51
|
+
show: {
|
52
|
+
videoInputMethod: ['binaryData'],
|
53
|
+
},
|
54
|
+
},
|
55
|
+
description: 'Name of the binary property containing the video data',
|
56
|
+
},
|
57
|
+
{
|
58
|
+
displayName: 'Video URL',
|
59
|
+
name: 'videoUrl',
|
60
|
+
type: 'string',
|
61
|
+
default: '',
|
62
|
+
required: true,
|
63
|
+
displayOptions: {
|
64
|
+
show: {
|
65
|
+
videoInputMethod: ['url'],
|
66
|
+
},
|
67
|
+
},
|
68
|
+
description: 'URL of the video (MP4 format only)',
|
69
|
+
},
|
70
|
+
{
|
71
|
+
displayName: 'Video Requirements',
|
72
|
+
name: 'videoRequirements',
|
73
|
+
type: 'notice',
|
74
|
+
default: 'Video must be in MP4 format. Maximum length is 30 seconds.',
|
75
|
+
},
|
76
|
+
{
|
77
|
+
displayName: 'Prompt',
|
78
|
+
name: 'prompt',
|
79
|
+
type: 'string',
|
80
|
+
typeOptions: {
|
81
|
+
rows: 4,
|
82
|
+
},
|
83
|
+
default: '',
|
84
|
+
description: 'Prompt text for audio generation',
|
85
|
+
},
|
86
|
+
{
|
87
|
+
displayName: 'Negative Prompt',
|
88
|
+
name: 'negativePrompt',
|
89
|
+
type: 'string',
|
90
|
+
typeOptions: {
|
91
|
+
rows: 4,
|
92
|
+
},
|
93
|
+
default: '',
|
94
|
+
description: 'Negative prompt text for audio generation',
|
95
|
+
},
|
96
|
+
{
|
97
|
+
displayName: 'Steps',
|
98
|
+
name: 'steps',
|
99
|
+
type: 'number',
|
100
|
+
typeOptions: {
|
101
|
+
minValue: 20,
|
102
|
+
maxValue: 50,
|
103
|
+
},
|
104
|
+
default: 20,
|
105
|
+
description: 'Number of steps for audio generation (20-50)',
|
106
|
+
},
|
107
|
+
{
|
108
|
+
displayName: 'Seed',
|
109
|
+
name: 'seed',
|
110
|
+
type: 'number',
|
111
|
+
default: 0,
|
112
|
+
description: 'Seed for audio generation (0 for random)',
|
113
|
+
},
|
114
|
+
{
|
115
|
+
displayName: 'Wait For Completion',
|
116
|
+
name: 'waitForCompletion',
|
117
|
+
type: 'boolean',
|
118
|
+
default: false,
|
119
|
+
description: 'Whether to wait for the audio generation process to complete before continuing',
|
120
|
+
},
|
121
|
+
{
|
122
|
+
displayName: 'Max Retries',
|
123
|
+
name: 'maxRetries',
|
124
|
+
type: 'number',
|
125
|
+
default: 20,
|
126
|
+
description: 'Maximum number of retries to check task status',
|
127
|
+
displayOptions: {
|
128
|
+
show: {
|
129
|
+
waitForCompletion: [true],
|
130
|
+
},
|
131
|
+
},
|
132
|
+
},
|
133
|
+
{
|
134
|
+
displayName: 'Retry Interval',
|
135
|
+
name: 'retryInterval',
|
136
|
+
type: 'number',
|
137
|
+
default: 3000,
|
138
|
+
description: 'Interval between retries in milliseconds',
|
139
|
+
displayOptions: {
|
140
|
+
show: {
|
141
|
+
waitForCompletion: [true],
|
142
|
+
},
|
143
|
+
},
|
144
|
+
},
|
145
|
+
],
|
146
|
+
};
|
147
|
+
}
|
148
|
+
async execute() {
|
149
|
+
var _a, _b;
|
150
|
+
const items = this.getInputData();
|
151
|
+
const returnData = [];
|
152
|
+
for (let i = 0; i < items.length; i++) {
|
153
|
+
try {
|
154
|
+
const videoInputMethod = this.getNodeParameter('videoInputMethod', i);
|
155
|
+
const prompt = this.getNodeParameter('prompt', i);
|
156
|
+
const negativePrompt = this.getNodeParameter('negativePrompt', i, '');
|
157
|
+
const steps = this.getNodeParameter('steps', i, 20);
|
158
|
+
const seed = this.getNodeParameter('seed', i, 0);
|
159
|
+
const waitForCompletion = this.getNodeParameter('waitForCompletion', i, false);
|
160
|
+
let videoData;
|
161
|
+
if (videoInputMethod === 'url') {
|
162
|
+
videoData = this.getNodeParameter('videoUrl', i);
|
163
|
+
}
|
164
|
+
else {
|
165
|
+
const videoBinaryPropertyName = this.getNodeParameter('videoBinaryPropertyName', i);
|
166
|
+
const videoBinaryData = this.helpers.assertBinaryData(i, videoBinaryPropertyName);
|
167
|
+
if (videoBinaryData.mimeType && !videoBinaryData.mimeType.includes('video/mp4')) {
|
168
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'The provided binary data is not an MP4 video', { itemIndex: i });
|
169
|
+
}
|
170
|
+
const base64String = Buffer.from(await this.helpers.getBinaryDataBuffer(i, videoBinaryPropertyName)).toString('base64');
|
171
|
+
videoData = `data:${videoBinaryData.mimeType};base64,${base64String}`;
|
172
|
+
}
|
173
|
+
const requestBody = {
|
174
|
+
model: 'Qubico/mmaudio',
|
175
|
+
task_type: 'video2audio',
|
176
|
+
input: {
|
177
|
+
prompt,
|
178
|
+
video: videoData,
|
179
|
+
},
|
180
|
+
config: {},
|
181
|
+
};
|
182
|
+
if (negativePrompt) {
|
183
|
+
requestBody.input.negative_prompt = negativePrompt;
|
184
|
+
}
|
185
|
+
if (steps) {
|
186
|
+
requestBody.input.steps = steps;
|
187
|
+
}
|
188
|
+
if (seed) {
|
189
|
+
requestBody.input.seed = seed;
|
190
|
+
}
|
191
|
+
const response = await GenericFunctions_1.piApiRequest.call(this, 'POST', '/api/v1/task', requestBody);
|
192
|
+
const taskId = (_a = response.data) === null || _a === void 0 ? void 0 : _a.task_id;
|
193
|
+
if (!taskId) {
|
194
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Failed to get a valid task ID from the API');
|
195
|
+
}
|
196
|
+
let executionData;
|
197
|
+
if (waitForCompletion) {
|
198
|
+
const maxRetries = this.getNodeParameter('maxRetries', i, 20);
|
199
|
+
const retryInterval = this.getNodeParameter('retryInterval', i, 3000);
|
200
|
+
executionData = await GenericFunctions_1.waitForTaskCompletion.call(this, taskId, maxRetries, retryInterval);
|
201
|
+
}
|
202
|
+
else {
|
203
|
+
executionData = {
|
204
|
+
task_id: taskId,
|
205
|
+
status: ((_b = response.data) === null || _b === void 0 ? void 0 : _b.status) || 'pending',
|
206
|
+
};
|
207
|
+
}
|
208
|
+
returnData.push({
|
209
|
+
json: executionData,
|
210
|
+
});
|
211
|
+
}
|
212
|
+
catch (error) {
|
213
|
+
if (error.message && error.message.includes('failed to get valid video')) {
|
214
|
+
const errorMessage = 'The API could not process the provided video. Please ensure the video is accessible, in MP4 format, and no longer than 30 seconds.';
|
215
|
+
if (this.continueOnFail()) {
|
216
|
+
returnData.push({
|
217
|
+
json: {
|
218
|
+
error: errorMessage,
|
219
|
+
details: error.message,
|
220
|
+
},
|
221
|
+
});
|
222
|
+
continue;
|
223
|
+
}
|
224
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), errorMessage);
|
225
|
+
}
|
226
|
+
if (this.continueOnFail()) {
|
227
|
+
returnData.push({
|
228
|
+
json: {
|
229
|
+
error: error.message,
|
230
|
+
},
|
231
|
+
});
|
232
|
+
continue;
|
233
|
+
}
|
234
|
+
throw error;
|
235
|
+
}
|
236
|
+
}
|
237
|
+
return [returnData];
|
238
|
+
}
|
239
|
+
}
|
240
|
+
exports.MMAudioVideoToAudio = MMAudioVideoToAudio;
|
241
|
+
//# sourceMappingURL=MMAudioVideoToAudio.node.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"MMAudioVideoToAudio.node.js","sourceRoot":"","sources":["../../../../nodes/PiAPI/MMAudio/MMAudioVideoToAudio.node.ts"],"names":[],"mappings":";;;AAAA,+CAQsB;AAEtB,iEAAiF;AAGjF,MAAa,mBAAmB;IAAhC;QACI,gBAAW,GAAyB;YAChC,WAAW,EAAE,eAAe;YAC5B,IAAI,EAAE,qBAAqB;YAC3B,IAAI,EAAE,mBAAmB;YACzB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,+CAA+C;YAC5D,QAAQ,EAAE;gBACN,IAAI,EAAE,wBAAwB;aACjC;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,oBAAoB;oBACjC,IAAI,EAAE,kBAAkB;oBACxB,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE;wBACL;4BACI,IAAI,EAAE,KAAK;4BACX,KAAK,EAAE,KAAK;yBACf;wBACD;4BACI,IAAI,EAAE,aAAa;4BACnB,KAAK,EAAE,YAAY;yBACtB;qBACJ;oBACD,OAAO,EAAE,KAAK;oBACd,WAAW,EAAE,gCAAgC;iBAChD;gBACD;oBACI,WAAW,EAAE,uBAAuB;oBACpC,IAAI,EAAE,yBAAyB;oBAC/B,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,MAAM;oBACf,QAAQ,EAAE,IAAI;oBACd,cAAc,EAAE;wBACZ,IAAI,EAAE;4BACF,gBAAgB,EAAE,CAAC,YAAY,CAAC;yBACnC;qBACJ;oBACD,WAA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,QAAQ,CAAC,2BAA2B,CAAC,EAAE,CAAC;oBACvE,MAAM,YAAY,GAAG,oIAAoI,CAAC;oBAC1J,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;AAzRD,kDAyRC"}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
2
|
+
export declare class PiAPIMidjourney implements INodeType {
|
3
|
+
description: INodeTypeDescription;
|
4
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
5
|
+
}
|