n8n-nodes-deapi 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 +21 -0
- package/README.md +90 -0
- package/dist/credentials/DeApi.credentials.d.ts +10 -0
- package/dist/credentials/DeApi.credentials.js +50 -0
- package/dist/credentials/DeApi.credentials.js.map +1 -0
- package/dist/credentials/deapi.svg +16 -0
- package/dist/nodes/Deapi/Deapi.node.d.ts +6 -0
- package/dist/nodes/Deapi/Deapi.node.js +166 -0
- package/dist/nodes/Deapi/Deapi.node.js.map +1 -0
- package/dist/nodes/Deapi/Deapi.node.json +18 -0
- package/dist/nodes/Deapi/DeapiTrigger.node.d.ts +12 -0
- package/dist/nodes/Deapi/DeapiTrigger.node.js +154 -0
- package/dist/nodes/Deapi/DeapiTrigger.node.js.map +1 -0
- package/dist/nodes/Deapi/DeapiTrigger.node.json +18 -0
- package/dist/nodes/Deapi/actions/audio/index.d.ts +4 -0
- package/dist/nodes/Deapi/actions/audio/index.js +62 -0
- package/dist/nodes/Deapi/actions/audio/index.js.map +1 -0
- package/dist/nodes/Deapi/actions/audio/transcribe.operation.d.ts +28 -0
- package/dist/nodes/Deapi/actions/audio/transcribe.operation.js +89 -0
- package/dist/nodes/Deapi/actions/audio/transcribe.operation.js.map +1 -0
- package/dist/nodes/Deapi/actions/image/generate.operation.d.ts +28 -0
- package/dist/nodes/Deapi/actions/image/generate.operation.js +484 -0
- package/dist/nodes/Deapi/actions/image/generate.operation.js.map +1 -0
- package/dist/nodes/Deapi/actions/image/index.d.ts +6 -0
- package/dist/nodes/Deapi/actions/image/index.js +80 -0
- package/dist/nodes/Deapi/actions/image/index.js.map +1 -0
- package/dist/nodes/Deapi/actions/image/removeBackground.operation.d.ts +28 -0
- package/dist/nodes/Deapi/actions/image/removeBackground.operation.js +79 -0
- package/dist/nodes/Deapi/actions/image/removeBackground.operation.js.map +1 -0
- package/dist/nodes/Deapi/actions/image/upscale.operation.d.ts +28 -0
- package/dist/nodes/Deapi/actions/image/upscale.operation.js +79 -0
- package/dist/nodes/Deapi/actions/image/upscale.operation.js.map +1 -0
- package/dist/nodes/Deapi/actions/node.type.d.ts +9 -0
- package/dist/nodes/Deapi/actions/node.type.js +3 -0
- package/dist/nodes/Deapi/actions/node.type.js.map +1 -0
- package/dist/nodes/Deapi/actions/prompt/imagePromptBooster.operation.d.ts +28 -0
- package/dist/nodes/Deapi/actions/prompt/imagePromptBooster.operation.js +68 -0
- package/dist/nodes/Deapi/actions/prompt/imagePromptBooster.operation.js.map +1 -0
- package/dist/nodes/Deapi/actions/prompt/index.d.ts +5 -0
- package/dist/nodes/Deapi/actions/prompt/index.js +71 -0
- package/dist/nodes/Deapi/actions/prompt/index.js.map +1 -0
- package/dist/nodes/Deapi/actions/prompt/videoPromptBooster.operation.d.ts +28 -0
- package/dist/nodes/Deapi/actions/prompt/videoPromptBooster.operation.js +93 -0
- package/dist/nodes/Deapi/actions/prompt/videoPromptBooster.operation.js.map +1 -0
- package/dist/nodes/Deapi/actions/router.d.ts +2 -0
- package/dist/nodes/Deapi/actions/router.js +102 -0
- package/dist/nodes/Deapi/actions/router.js.map +1 -0
- package/dist/nodes/Deapi/actions/video/generate.operation.d.ts +28 -0
- package/dist/nodes/Deapi/actions/video/generate.operation.js +477 -0
- package/dist/nodes/Deapi/actions/video/generate.operation.js.map +1 -0
- package/dist/nodes/Deapi/actions/video/index.d.ts +5 -0
- package/dist/nodes/Deapi/actions/video/index.js +71 -0
- package/dist/nodes/Deapi/actions/video/index.js.map +1 -0
- package/dist/nodes/Deapi/actions/video/transcribe.operation.d.ts +28 -0
- package/dist/nodes/Deapi/actions/video/transcribe.operation.js +141 -0
- package/dist/nodes/Deapi/actions/video/transcribe.operation.js.map +1 -0
- package/dist/nodes/Deapi/deapi.svg +16 -0
- package/dist/nodes/Deapi/helpers/binary-data.d.ts +7 -0
- package/dist/nodes/Deapi/helpers/binary-data.js +38 -0
- package/dist/nodes/Deapi/helpers/binary-data.js.map +1 -0
- package/dist/nodes/Deapi/helpers/formdata.d.ts +8 -0
- package/dist/nodes/Deapi/helpers/formdata.js +23 -0
- package/dist/nodes/Deapi/helpers/formdata.js.map +1 -0
- package/dist/nodes/Deapi/helpers/interfaces.d.ts +81 -0
- package/dist/nodes/Deapi/helpers/interfaces.js +3 -0
- package/dist/nodes/Deapi/helpers/interfaces.js.map +1 -0
- package/dist/nodes/Deapi/helpers/webhook-verification.d.ts +1 -0
- package/dist/nodes/Deapi/helpers/webhook-verification.js +58 -0
- package/dist/nodes/Deapi/helpers/webhook-verification.js.map +1 -0
- package/dist/nodes/Deapi/transport/index.d.ts +9 -0
- package/dist/nodes/Deapi/transport/index.js +29 -0
- package/dist/nodes/Deapi/transport/index.js.map +1 -0
- package/dist/package.json +82 -0
- package/package.json +80 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.description = exports.upscale = exports.removeBackground = exports.generate = void 0;
|
|
37
|
+
const generate = __importStar(require("./generate.operation"));
|
|
38
|
+
exports.generate = generate;
|
|
39
|
+
const removeBackground = __importStar(require("./removeBackground.operation"));
|
|
40
|
+
exports.removeBackground = removeBackground;
|
|
41
|
+
const upscale = __importStar(require("./upscale.operation"));
|
|
42
|
+
exports.upscale = upscale;
|
|
43
|
+
exports.description = [
|
|
44
|
+
{
|
|
45
|
+
displayName: 'Operation',
|
|
46
|
+
name: 'operation',
|
|
47
|
+
type: 'options',
|
|
48
|
+
noDataExpression: true,
|
|
49
|
+
options: [
|
|
50
|
+
{
|
|
51
|
+
name: 'Generate an Image',
|
|
52
|
+
value: 'generate',
|
|
53
|
+
action: 'Generate an image',
|
|
54
|
+
description: 'Generates an image from a text prompt',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: 'Remove Background',
|
|
58
|
+
value: 'removeBackground',
|
|
59
|
+
action: 'Remove background',
|
|
60
|
+
description: 'Remove the background from an image',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: 'Upscale an Image',
|
|
64
|
+
value: 'upscale',
|
|
65
|
+
action: 'Upscale an image',
|
|
66
|
+
description: 'Increase an image resolution x4',
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
default: 'generate',
|
|
70
|
+
displayOptions: {
|
|
71
|
+
show: {
|
|
72
|
+
resource: ['image'],
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
...generate.description,
|
|
77
|
+
...removeBackground.description,
|
|
78
|
+
...upscale.description,
|
|
79
|
+
];
|
|
80
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/Deapi/actions/image/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,+DAAiD;AAIxC,4BAAQ;AAHjB,+EAAiE;AAG9C,4CAAgB;AAFnC,6DAA+C;AAEV,0BAAO;AAE/B,QAAA,WAAW,GAAsB;IAC7C;QACC,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,mBAAmB;gBACzB,KAAK,EAAE,UAAU;gBACjB,MAAM,EAAE,mBAAmB;gBAC3B,WAAW,EAAE,uCAAuC;aACpD;YACD;gBACC,IAAI,EAAE,mBAAmB;gBACzB,KAAK,EAAE,kBAAkB;gBACzB,MAAM,EAAE,mBAAmB;gBAC3B,WAAW,EAAE,qCAAqC;aAClD;YACD;gBACC,IAAI,EAAE,kBAAkB;gBACxB,KAAK,EAAE,SAAS;gBAChB,MAAM,EAAE,kBAAkB;gBAC1B,WAAW,EAAE,iCAAiC;aAC9C;SACD;QACD,OAAO,EAAE,UAAU;QACnB,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,OAAO,CAAC;aACnB;SACD;KACD;IACD,GAAG,QAAQ,CAAC,WAAW;IACvB,GAAG,gBAAgB,CAAC,WAAW;IAC/B,GAAG,OAAO,CAAC,WAAW;CACtB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare const description: {
|
|
3
|
+
displayOptions: import("n8n-workflow").IDisplayOptions;
|
|
4
|
+
displayName: string;
|
|
5
|
+
name: string;
|
|
6
|
+
type: import("n8n-workflow").NodePropertyTypes;
|
|
7
|
+
typeOptions?: import("n8n-workflow").INodePropertyTypeOptions;
|
|
8
|
+
default: import("n8n-workflow").NodeParameterValueType;
|
|
9
|
+
description?: string;
|
|
10
|
+
hint?: string;
|
|
11
|
+
disabledOptions?: import("n8n-workflow").IDisplayOptions;
|
|
12
|
+
options?: Array<import("n8n-workflow").INodePropertyOptions | INodeProperties | import("n8n-workflow").INodePropertyCollection>;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
isNodeSetting?: boolean;
|
|
15
|
+
noDataExpression?: boolean;
|
|
16
|
+
required?: boolean;
|
|
17
|
+
routing?: import("n8n-workflow").INodePropertyRouting;
|
|
18
|
+
credentialTypes?: Array<"extends:oAuth2Api" | "extends:oAuth1Api" | "has:authenticate" | "has:genericAuth">;
|
|
19
|
+
extractValue?: import("n8n-workflow").INodePropertyValueExtractor;
|
|
20
|
+
modes?: import("n8n-workflow").INodePropertyMode[];
|
|
21
|
+
requiresDataPath?: "single" | "multiple";
|
|
22
|
+
doNotInherit?: boolean;
|
|
23
|
+
validateType?: import("n8n-workflow").FieldType;
|
|
24
|
+
ignoreValidationDuringExecution?: boolean;
|
|
25
|
+
allowArbitraryValues?: boolean;
|
|
26
|
+
resolvableField?: boolean;
|
|
27
|
+
}[];
|
|
28
|
+
export declare function execute(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.description = void 0;
|
|
4
|
+
exports.execute = execute;
|
|
5
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
|
+
const transport_1 = require("../../transport");
|
|
7
|
+
const binary_data_1 = require("../../helpers/binary-data");
|
|
8
|
+
const formdata_1 = require("../../helpers/formdata");
|
|
9
|
+
const properties = [
|
|
10
|
+
{
|
|
11
|
+
displayName: 'Binary Field Name',
|
|
12
|
+
name: 'binaryPropertyName',
|
|
13
|
+
type: 'string',
|
|
14
|
+
required: true,
|
|
15
|
+
default: 'data',
|
|
16
|
+
placeholder: 'e.g. data',
|
|
17
|
+
description: 'The name of the binary field containing the image file. Supported formats: JPG, JPEG, PNG, GIF, BMP, WebP. Max 10 MB.',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
displayName: 'Options',
|
|
21
|
+
name: 'options',
|
|
22
|
+
placeholder: 'Add Option',
|
|
23
|
+
type: 'collection',
|
|
24
|
+
default: {},
|
|
25
|
+
options: [
|
|
26
|
+
{
|
|
27
|
+
displayName: 'Wait Timeout',
|
|
28
|
+
name: 'waitTimeout',
|
|
29
|
+
type: 'number',
|
|
30
|
+
description: 'Maximum time to wait for completion in seconds',
|
|
31
|
+
default: 60,
|
|
32
|
+
typeOptions: {
|
|
33
|
+
minValue: 30,
|
|
34
|
+
maxValue: 240,
|
|
35
|
+
numberPrecision: 0,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
];
|
|
41
|
+
const displayOptions = {
|
|
42
|
+
show: {
|
|
43
|
+
operation: ['removeBackground'],
|
|
44
|
+
resource: ['image'],
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
exports.description = (0, n8n_workflow_1.updateDisplayOptions)(displayOptions, properties);
|
|
48
|
+
async function execute(i) {
|
|
49
|
+
var _a;
|
|
50
|
+
const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
|
|
51
|
+
const options = this.getNodeParameter('options', i);
|
|
52
|
+
const waitTimeout = (_a = options.waitTimeout) !== null && _a !== void 0 ? _a : 60;
|
|
53
|
+
const waitTill = new Date(Date.now() + waitTimeout * 1000);
|
|
54
|
+
await this.putExecutionToWait(waitTill);
|
|
55
|
+
const webhookUrl = this.evaluateExpression('{{ $execution.resumeUrl }}', i);
|
|
56
|
+
const { fileContent, contentType, filename } = await (0, binary_data_1.getBinaryDataFile)(this, i, binaryPropertyName);
|
|
57
|
+
const request = {
|
|
58
|
+
image: {
|
|
59
|
+
filename: filename || 'image',
|
|
60
|
+
contentType,
|
|
61
|
+
content: fileContent,
|
|
62
|
+
},
|
|
63
|
+
model: 'Ben2',
|
|
64
|
+
webhook_url: webhookUrl,
|
|
65
|
+
};
|
|
66
|
+
const boundary = `----n8nFormBoundary${Date.now()}`;
|
|
67
|
+
const body = (0, formdata_1.generateFormdataBody)(boundary, request);
|
|
68
|
+
await transport_1.apiRequest.call(this, 'POST', '/img-rmbg', {
|
|
69
|
+
headers: {
|
|
70
|
+
'Content-Type': `multipart/form-data; boundary=${boundary}`,
|
|
71
|
+
},
|
|
72
|
+
option: {
|
|
73
|
+
body,
|
|
74
|
+
json: false,
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
return [this.getInputData()[i]];
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=removeBackground.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"removeBackground.operation.js","sourceRoot":"","sources":["../../../../../nodes/Deapi/actions/image/removeBackground.operation.ts"],"names":[],"mappings":";;;AAuDA,0BA0CC;AAjGD,+CAKsB;AAGtB,+CAA6C;AAC7C,2DAA8D;AAC9D,qDAA8D;AAE9D,MAAM,UAAU,GAAsB;IACrC;QACC,WAAW,EAAE,mBAAmB;QAChC,IAAI,EAAE,oBAAoB;QAC1B,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,MAAM;QACf,WAAW,EAAE,WAAW;QACxB,WAAW,EACV,uHAAuH;KACxH;IACD;QACC,WAAW,EAAE,SAAS;QACtB,IAAI,EAAE,SAAS;QACf,WAAW,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C,KAAK,EAAE;YACN,QAAQ,EAAE,QAAQ,IAAI,OAAO;YAC7B,WAAW;YACX,OAAO,EAAE,WAAW;SACpB;QACD,KAAK,EAAE,MAAM;QACb,WAAW,EAAE,UAAU;KACvB,CAAC;IAEF,MAAM,QAAQ,GAAG,sBAAsB,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;IACpD,MAAM,IAAI,GAAG,IAAA,+BAAoB,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAErD,MAAM,sBAAU,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE;QAChD,OAAO,EAAE;YACR,cAAc,EAAE,iCAAiC,QAAQ,EAAE;SAC3D;QACD,MAAM,EAAE;YACP,IAAI;YACJ,IAAI,EAAE,KAAK;SACX;KACD,CAAC,CAAC;IAEH,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare const description: {
|
|
3
|
+
displayOptions: import("n8n-workflow").IDisplayOptions;
|
|
4
|
+
displayName: string;
|
|
5
|
+
name: string;
|
|
6
|
+
type: import("n8n-workflow").NodePropertyTypes;
|
|
7
|
+
typeOptions?: import("n8n-workflow").INodePropertyTypeOptions;
|
|
8
|
+
default: import("n8n-workflow").NodeParameterValueType;
|
|
9
|
+
description?: string;
|
|
10
|
+
hint?: string;
|
|
11
|
+
disabledOptions?: import("n8n-workflow").IDisplayOptions;
|
|
12
|
+
options?: Array<import("n8n-workflow").INodePropertyOptions | INodeProperties | import("n8n-workflow").INodePropertyCollection>;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
isNodeSetting?: boolean;
|
|
15
|
+
noDataExpression?: boolean;
|
|
16
|
+
required?: boolean;
|
|
17
|
+
routing?: import("n8n-workflow").INodePropertyRouting;
|
|
18
|
+
credentialTypes?: Array<"extends:oAuth2Api" | "extends:oAuth1Api" | "has:authenticate" | "has:genericAuth">;
|
|
19
|
+
extractValue?: import("n8n-workflow").INodePropertyValueExtractor;
|
|
20
|
+
modes?: import("n8n-workflow").INodePropertyMode[];
|
|
21
|
+
requiresDataPath?: "single" | "multiple";
|
|
22
|
+
doNotInherit?: boolean;
|
|
23
|
+
validateType?: import("n8n-workflow").FieldType;
|
|
24
|
+
ignoreValidationDuringExecution?: boolean;
|
|
25
|
+
allowArbitraryValues?: boolean;
|
|
26
|
+
resolvableField?: boolean;
|
|
27
|
+
}[];
|
|
28
|
+
export declare function execute(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.description = void 0;
|
|
4
|
+
exports.execute = execute;
|
|
5
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
|
+
const transport_1 = require("../../transport");
|
|
7
|
+
const binary_data_1 = require("../../helpers/binary-data");
|
|
8
|
+
const formdata_1 = require("../../helpers/formdata");
|
|
9
|
+
const properties = [
|
|
10
|
+
{
|
|
11
|
+
displayName: 'Binary Field Name',
|
|
12
|
+
name: 'binaryPropertyName',
|
|
13
|
+
type: 'string',
|
|
14
|
+
required: true,
|
|
15
|
+
default: 'data',
|
|
16
|
+
placeholder: 'e.g. data',
|
|
17
|
+
description: 'The name of the binary field containing the image file. Supported formats: JPG, JPEG, PNG, GIF, BMP, WebP. Max 10 MB.',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
displayName: 'Options',
|
|
21
|
+
name: 'options',
|
|
22
|
+
placeholder: 'Add Option',
|
|
23
|
+
type: 'collection',
|
|
24
|
+
default: {},
|
|
25
|
+
options: [
|
|
26
|
+
{
|
|
27
|
+
displayName: 'Wait Timeout',
|
|
28
|
+
name: 'waitTimeout',
|
|
29
|
+
type: 'number',
|
|
30
|
+
description: 'Maximum time to wait for completion in seconds',
|
|
31
|
+
default: 60,
|
|
32
|
+
typeOptions: {
|
|
33
|
+
minValue: 30,
|
|
34
|
+
maxValue: 240,
|
|
35
|
+
numberPrecision: 0,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
];
|
|
41
|
+
const displayOptions = {
|
|
42
|
+
show: {
|
|
43
|
+
operation: ['upscale'],
|
|
44
|
+
resource: ['image'],
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
exports.description = (0, n8n_workflow_1.updateDisplayOptions)(displayOptions, properties);
|
|
48
|
+
async function execute(i) {
|
|
49
|
+
var _a;
|
|
50
|
+
const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
|
|
51
|
+
const options = this.getNodeParameter('options', i);
|
|
52
|
+
const waitTimeout = (_a = options.waitTimeout) !== null && _a !== void 0 ? _a : 60;
|
|
53
|
+
const waitTill = new Date(Date.now() + waitTimeout * 1000);
|
|
54
|
+
await this.putExecutionToWait(waitTill);
|
|
55
|
+
const webhookUrl = this.evaluateExpression('{{ $execution.resumeUrl }}', i);
|
|
56
|
+
const { fileContent, contentType, filename } = await (0, binary_data_1.getBinaryDataFile)(this, i, binaryPropertyName);
|
|
57
|
+
const request = {
|
|
58
|
+
image: {
|
|
59
|
+
filename: filename || 'image',
|
|
60
|
+
contentType,
|
|
61
|
+
content: fileContent,
|
|
62
|
+
},
|
|
63
|
+
model: 'RealESRGAN_x4',
|
|
64
|
+
webhook_url: webhookUrl,
|
|
65
|
+
};
|
|
66
|
+
const boundary = `----n8nFormBoundary${Date.now()}`;
|
|
67
|
+
const body = (0, formdata_1.generateFormdataBody)(boundary, request);
|
|
68
|
+
await transport_1.apiRequest.call(this, 'POST', '/img-upscale', {
|
|
69
|
+
headers: {
|
|
70
|
+
'Content-Type': `multipart/form-data; boundary=${boundary}`,
|
|
71
|
+
},
|
|
72
|
+
option: {
|
|
73
|
+
body,
|
|
74
|
+
json: false,
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
return [this.getInputData()[i]];
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=upscale.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upscale.operation.js","sourceRoot":"","sources":["../../../../../nodes/Deapi/actions/image/upscale.operation.ts"],"names":[],"mappings":";;;AAuDA,0BA0CC;AAjGD,+CAKsB;AAGtB,+CAA6C;AAC7C,2DAA8D;AAC9D,qDAA8D;AAE9D,MAAM,UAAU,GAAsB;IACrC;QACC,WAAW,EAAE,mBAAmB;QAChC,IAAI,EAAE,oBAAoB;QAC1B,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,MAAM;QACf,WAAW,EAAE,WAAW;QACxB,WAAW,EACV,uHAAuH;KACxH;IACD;QACC,WAAW,EAAE,SAAS;QACtB,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,YAAY;QACzB,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE,EAAE;QACX,OAAO,EAAE;YACR;gBACC,WAAW,EAAE,cAAc;gBAC3B,IAAI,EAAE,aAAa;gBACnB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,gDAAgD;gBAC7D,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE;oBACZ,QAAQ,EAAE,EAAE;oBACZ,QAAQ,EAAE,GAAG;oBACb,eAAe,EAAE,CAAC;iBAClB;aACD;SACD;KACD;CACD,CAAC;AAEF,MAAM,cAAc,GAAG;IACtB,IAAI,EAAE;QACL,SAAS,EAAE,CAAC,SAAS,CAAC;QACtB,QAAQ,EAAE,CAAC,OAAO,CAAC;KACnB;CACD,CAAC;AAEW,QAAA,WAAW,GAAG,IAAA,mCAAoB,EAAC,cAAc,EAAE,UAAU,CAAC,CAAC;AAErE,KAAK,UAAU,OAAO,CAA0B,CAAS;;IAC/D,MAAM,kBAAkB,GAAG,IAAI,CAAC,gBAAgB,CA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AllEntities } from 'n8n-workflow';
|
|
2
|
+
type NodeMap = {
|
|
3
|
+
image: 'generate' | 'removeBackground' | 'upscale';
|
|
4
|
+
video: 'generate' | 'transcribe';
|
|
5
|
+
audio: 'transcribe';
|
|
6
|
+
prompt: 'boostImage' | 'boostVideo';
|
|
7
|
+
};
|
|
8
|
+
export type DeApiType = AllEntities<NodeMap>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.type.js","sourceRoot":"","sources":["../../../../nodes/Deapi/actions/node.type.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare const description: {
|
|
3
|
+
displayOptions: import("n8n-workflow").IDisplayOptions;
|
|
4
|
+
displayName: string;
|
|
5
|
+
name: string;
|
|
6
|
+
type: import("n8n-workflow").NodePropertyTypes;
|
|
7
|
+
typeOptions?: import("n8n-workflow").INodePropertyTypeOptions;
|
|
8
|
+
default: import("n8n-workflow").NodeParameterValueType;
|
|
9
|
+
description?: string;
|
|
10
|
+
hint?: string;
|
|
11
|
+
disabledOptions?: import("n8n-workflow").IDisplayOptions;
|
|
12
|
+
options?: Array<import("n8n-workflow").INodePropertyOptions | INodeProperties | import("n8n-workflow").INodePropertyCollection>;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
isNodeSetting?: boolean;
|
|
15
|
+
noDataExpression?: boolean;
|
|
16
|
+
required?: boolean;
|
|
17
|
+
routing?: import("n8n-workflow").INodePropertyRouting;
|
|
18
|
+
credentialTypes?: Array<"extends:oAuth2Api" | "extends:oAuth1Api" | "has:authenticate" | "has:genericAuth">;
|
|
19
|
+
extractValue?: import("n8n-workflow").INodePropertyValueExtractor;
|
|
20
|
+
modes?: import("n8n-workflow").INodePropertyMode[];
|
|
21
|
+
requiresDataPath?: "single" | "multiple";
|
|
22
|
+
doNotInherit?: boolean;
|
|
23
|
+
validateType?: import("n8n-workflow").FieldType;
|
|
24
|
+
ignoreValidationDuringExecution?: boolean;
|
|
25
|
+
allowArbitraryValues?: boolean;
|
|
26
|
+
resolvableField?: boolean;
|
|
27
|
+
}[];
|
|
28
|
+
export declare function execute(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.description = void 0;
|
|
4
|
+
exports.execute = execute;
|
|
5
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
|
+
const transport_1 = require("../../transport");
|
|
7
|
+
const properties = [
|
|
8
|
+
{
|
|
9
|
+
displayName: 'Prompt',
|
|
10
|
+
name: 'prompt',
|
|
11
|
+
type: 'string',
|
|
12
|
+
required: true,
|
|
13
|
+
placeholder: 'e.g. Red Bull F1 car from 2025',
|
|
14
|
+
description: 'A prompt to boost for image generation',
|
|
15
|
+
default: '',
|
|
16
|
+
typeOptions: {
|
|
17
|
+
rows: 1,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
displayName: 'Options',
|
|
22
|
+
name: 'options',
|
|
23
|
+
placeholder: 'Add Option',
|
|
24
|
+
type: 'collection',
|
|
25
|
+
default: {},
|
|
26
|
+
options: [
|
|
27
|
+
{
|
|
28
|
+
displayName: 'Negative Prompt',
|
|
29
|
+
name: 'negativePrompt',
|
|
30
|
+
type: 'string',
|
|
31
|
+
placeholder: 'e.g. blur, darkness, noise',
|
|
32
|
+
description: 'A negative prompt to boost',
|
|
33
|
+
default: '',
|
|
34
|
+
typeOptions: {
|
|
35
|
+
rows: 1,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
];
|
|
41
|
+
const displayOptions = {
|
|
42
|
+
show: {
|
|
43
|
+
operation: ['boostImage'],
|
|
44
|
+
resource: ['prompt'],
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
exports.description = (0, n8n_workflow_1.updateDisplayOptions)(displayOptions, properties);
|
|
48
|
+
async function execute(i) {
|
|
49
|
+
const prompt = this.getNodeParameter('prompt', i);
|
|
50
|
+
const options = this.getNodeParameter('options', i);
|
|
51
|
+
const negativePrompt = options.negativePrompt;
|
|
52
|
+
const body = {
|
|
53
|
+
prompt: prompt,
|
|
54
|
+
negative_prompt: negativePrompt !== null && negativePrompt !== void 0 ? negativePrompt : null,
|
|
55
|
+
};
|
|
56
|
+
const response = (await transport_1.apiRequest.call(this, 'POST', '/prompt/image', {
|
|
57
|
+
body,
|
|
58
|
+
}));
|
|
59
|
+
return [
|
|
60
|
+
{
|
|
61
|
+
json: response,
|
|
62
|
+
pairedItem: {
|
|
63
|
+
item: i,
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
];
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=imagePromptBooster.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imagePromptBooster.operation.js","sourceRoot":"","sources":["../../../../../nodes/Deapi/actions/prompt/imagePromptBooster.operation.ts"],"names":[],"mappings":";;;AAsDA,0BAsBC;AA5ED,+CAKsB;AAGtB,+CAA6C;AAE7C,MAAM,UAAU,GAAsB;IACrC;QACC,WAAW,EAAE,QAAQ;QACrB,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,gCAAgC;QAC7C,WAAW,EAAE,wCAAwC;QACrD,OAAO,EAAE,EAAE;QACX,WAAW,EAAE;YACZ,IAAI,EAAE,CAAC;SACP;KACD;IACD;QACC,WAAW,EAAE,SAAS;QACtB,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,YAAY;QACzB,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE,EAAE;QACX,OAAO,EAAE;YACR;gBACC,WAAW,EAAE,iBAAiB;gBAC9B,IAAI,EAAE,gBAAgB;gBACtB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,4BAA4B;gBACzC,WAAW,EAAE,4BAA4B;gBACzC,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE;oBACZ,IAAI,EAAE,CAAC;iBACP;aACD;SACD;KACD;CACD,CAAC;AAEF,MAAM,cAAc,GAAG;IACtB,IAAI,EAAE;QACL,SAAS,EAAE,CAAC,YAAY,CAAC;QACzB,QAAQ,EAAE,CAAC,QAAQ,CAAC;KACpB;CACD,CAAC;AAEW,QAAA,WAAW,GAAG,IAAA,mCAAoB,EAAC,cAAc,EAAE,UAAU,CAAC,CAAC;AAErE,KAAK,UAAU,OAAO,CAA0B,CAAS;IAC/D,MAAM,MAAM,GAAG,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,CAAC,CAAW,CAAC;IAC5D,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IACpD,MAAM,cAAc,GAAG,OAAO,CAAC,cAAoC,CAAC;IAEpE,MAAM,IAAI,GAA8B;QACvC,MAAM,EAAE,MAAM;QACd,eAAe,EAAE,cAAc,aAAd,cAAc,cAAd,cAAc,GAAI,IAAI;KACvC,CAAC;IAEF,MAAM,QAAQ,GAAG,CAAC,MAAM,sBAAU,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,eAAe,EAAE;QACtE,IAAI;KACJ,CAAC,CAAoB,CAAC;IAEvB,OAAO;QACN;YACC,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACX,IAAI,EAAE,CAAC;aACP;SACD;KACD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { INodeProperties } from 'n8n-workflow';
|
|
2
|
+
import * as imagePromptBooster from './imagePromptBooster.operation';
|
|
3
|
+
import * as videoPromptBooster from './videoPromptBooster.operation';
|
|
4
|
+
export { imagePromptBooster as boostImage, videoPromptBooster as boostVideo };
|
|
5
|
+
export declare const description: INodeProperties[];
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.description = exports.boostVideo = exports.boostImage = void 0;
|
|
37
|
+
const imagePromptBooster = __importStar(require("./imagePromptBooster.operation"));
|
|
38
|
+
exports.boostImage = imagePromptBooster;
|
|
39
|
+
const videoPromptBooster = __importStar(require("./videoPromptBooster.operation"));
|
|
40
|
+
exports.boostVideo = videoPromptBooster;
|
|
41
|
+
exports.description = [
|
|
42
|
+
{
|
|
43
|
+
displayName: 'Operation',
|
|
44
|
+
name: 'operation',
|
|
45
|
+
type: 'options',
|
|
46
|
+
noDataExpression: true,
|
|
47
|
+
options: [
|
|
48
|
+
{
|
|
49
|
+
name: 'Image Prompt Booster',
|
|
50
|
+
value: 'boostImage',
|
|
51
|
+
action: 'Image prompt booster',
|
|
52
|
+
description: 'Optimizes a prompt for text-to-image generation',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: 'Video Prompt Booster',
|
|
56
|
+
value: 'boostVideo',
|
|
57
|
+
action: 'Video prompt booster',
|
|
58
|
+
description: 'Optimizes a prompt for text-image-to-video generation',
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
default: 'boostImage',
|
|
62
|
+
displayOptions: {
|
|
63
|
+
show: {
|
|
64
|
+
resource: ['prompt'],
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
...imagePromptBooster.description,
|
|
69
|
+
...videoPromptBooster.description,
|
|
70
|
+
];
|
|
71
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/Deapi/actions/prompt/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,mFAAqE;AAGtC,wCAAU;AAFzC,mFAAqE;AAEJ,wCAAU;AAE9D,QAAA,WAAW,GAAsB;IAC7C;QACC,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,sBAAsB;gBAC5B,KAAK,EAAE,YAAY;gBACnB,MAAM,EAAE,sBAAsB;gBAC9B,WAAW,EAAE,iDAAiD;aAC9D;YACD;gBACC,IAAI,EAAE,sBAAsB;gBAC5B,KAAK,EAAE,YAAY;gBACnB,MAAM,EAAE,sBAAsB;gBAC9B,WAAW,EAAE,uDAAuD;aACpE;SACD;QACD,OAAO,EAAE,YAAY;QACrB,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,QAAQ,CAAC;aACpB;SACD;KACD;IACD,GAAG,kBAAkB,CAAC,WAAW;IACjC,GAAG,kBAAkB,CAAC,WAAW;CACjC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare const description: {
|
|
3
|
+
displayOptions: import("n8n-workflow").IDisplayOptions;
|
|
4
|
+
displayName: string;
|
|
5
|
+
name: string;
|
|
6
|
+
type: import("n8n-workflow").NodePropertyTypes;
|
|
7
|
+
typeOptions?: import("n8n-workflow").INodePropertyTypeOptions;
|
|
8
|
+
default: import("n8n-workflow").NodeParameterValueType;
|
|
9
|
+
description?: string;
|
|
10
|
+
hint?: string;
|
|
11
|
+
disabledOptions?: import("n8n-workflow").IDisplayOptions;
|
|
12
|
+
options?: Array<import("n8n-workflow").INodePropertyOptions | INodeProperties | import("n8n-workflow").INodePropertyCollection>;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
isNodeSetting?: boolean;
|
|
15
|
+
noDataExpression?: boolean;
|
|
16
|
+
required?: boolean;
|
|
17
|
+
routing?: import("n8n-workflow").INodePropertyRouting;
|
|
18
|
+
credentialTypes?: Array<"extends:oAuth2Api" | "extends:oAuth1Api" | "has:authenticate" | "has:genericAuth">;
|
|
19
|
+
extractValue?: import("n8n-workflow").INodePropertyValueExtractor;
|
|
20
|
+
modes?: import("n8n-workflow").INodePropertyMode[];
|
|
21
|
+
requiresDataPath?: "single" | "multiple";
|
|
22
|
+
doNotInherit?: boolean;
|
|
23
|
+
validateType?: import("n8n-workflow").FieldType;
|
|
24
|
+
ignoreValidationDuringExecution?: boolean;
|
|
25
|
+
allowArbitraryValues?: boolean;
|
|
26
|
+
resolvableField?: boolean;
|
|
27
|
+
}[];
|
|
28
|
+
export declare function execute(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]>;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.description = void 0;
|
|
4
|
+
exports.execute = execute;
|
|
5
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
|
+
const transport_1 = require("../../transport");
|
|
7
|
+
const binary_data_1 = require("../../helpers/binary-data");
|
|
8
|
+
const formdata_1 = require("../../helpers/formdata");
|
|
9
|
+
const properties = [
|
|
10
|
+
{
|
|
11
|
+
displayName: 'Prompt',
|
|
12
|
+
name: 'prompt',
|
|
13
|
+
type: 'string',
|
|
14
|
+
required: true,
|
|
15
|
+
placeholder: 'e.g. A cinematic video sequence',
|
|
16
|
+
description: 'A prompt to boost for video generation',
|
|
17
|
+
default: '',
|
|
18
|
+
typeOptions: {
|
|
19
|
+
rows: 1,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
displayName: 'Options',
|
|
24
|
+
name: 'options',
|
|
25
|
+
placeholder: 'Add Option',
|
|
26
|
+
type: 'collection',
|
|
27
|
+
default: {},
|
|
28
|
+
options: [
|
|
29
|
+
{
|
|
30
|
+
displayName: 'Negative Prompt',
|
|
31
|
+
name: 'negativePrompt',
|
|
32
|
+
type: 'string',
|
|
33
|
+
placeholder: 'e.g. blur, darkness, noise',
|
|
34
|
+
description: 'A negative prompt to boost',
|
|
35
|
+
default: '',
|
|
36
|
+
typeOptions: {
|
|
37
|
+
rows: 1,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
displayName: 'Binary Field Name',
|
|
42
|
+
name: 'binaryPropertyName',
|
|
43
|
+
type: 'string',
|
|
44
|
+
default: 'data',
|
|
45
|
+
placeholder: 'e.g. data',
|
|
46
|
+
description: 'The name of the binary field containing the image data',
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
},
|
|
50
|
+
];
|
|
51
|
+
const displayOptions = {
|
|
52
|
+
show: {
|
|
53
|
+
operation: ['boostVideo'],
|
|
54
|
+
resource: ['prompt'],
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
exports.description = (0, n8n_workflow_1.updateDisplayOptions)(displayOptions, properties);
|
|
58
|
+
async function execute(i) {
|
|
59
|
+
const prompt = this.getNodeParameter('prompt', i);
|
|
60
|
+
const options = this.getNodeParameter('options', i);
|
|
61
|
+
const negativePrompt = options.negativePrompt;
|
|
62
|
+
const refImage = options.binaryPropertyName;
|
|
63
|
+
let image = null;
|
|
64
|
+
if (refImage) {
|
|
65
|
+
const { fileContent, contentType, filename } = await (0, binary_data_1.getBinaryDataFile)(this, i, refImage);
|
|
66
|
+
image = { filename: filename || 'file', contentType, content: fileContent };
|
|
67
|
+
}
|
|
68
|
+
const request = {
|
|
69
|
+
prompt,
|
|
70
|
+
negative_prompt: negativePrompt !== null && negativePrompt !== void 0 ? negativePrompt : null,
|
|
71
|
+
image,
|
|
72
|
+
};
|
|
73
|
+
const boundary = `----n8nFormBoundary${Date.now()}`;
|
|
74
|
+
const body = (0, formdata_1.generateFormdataBody)(boundary, request);
|
|
75
|
+
const response = (await transport_1.apiRequest.call(this, 'POST', '/prompt/video', {
|
|
76
|
+
headers: {
|
|
77
|
+
'Content-Type': `multipart/form-data; boundary=${boundary}`,
|
|
78
|
+
},
|
|
79
|
+
option: {
|
|
80
|
+
body,
|
|
81
|
+
json: false,
|
|
82
|
+
},
|
|
83
|
+
}));
|
|
84
|
+
return [
|
|
85
|
+
{
|
|
86
|
+
json: response,
|
|
87
|
+
pairedItem: {
|
|
88
|
+
item: i,
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
];
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=videoPromptBooster.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"videoPromptBooster.operation.js","sourceRoot":"","sources":["../../../../../nodes/Deapi/actions/prompt/videoPromptBooster.operation.ts"],"names":[],"mappings":";;;AAgEA,0BAuCC;AAvGD,+CAKsB;AAEtB,+CAA6C;AAC7C,2DAA8D;AAC9D,qDAA8D;AAG9D,MAAM,UAAU,GAAsB;IACrC;QACC,WAAW,EAAE,QAAQ;QACrB,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,iCAAiC;QAC9C,WAAW,EAAE,wCAAwC;QACrD,OAAO,EAAE,EAAE;QACX,WAAW,EAAE;YACZ,IAAI,EAAE,CAAC;SACP;KACD;IACD;QACC,WAAW,EAAE,SAAS;QACtB,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,YAAY;QACzB,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE,EAAE;QACX,OAAO,EAAE;YACR;gBACC,WAAW,EAAE,iBAAiB;gBAC9B,IAAI,EAAE,gBAAgB;gBACtB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,4BAA4B;gBACzC,WAAW,EAAE,4BAA4B;gBACzC,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE;oBACZ,IAAI,EAAE,CAAC;iBACP;aACD;YACD;gBACC,WAAW,EAAE,mBAAmB;gBAChC,IAAI,EAAE,oBAAoB;gBAC1B,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,MAAM;gBACf,WAAW,EAAE,WAAW;gBACxB,WAAW,EAAE,wDAAwD;aACrE;SACD;KACD;CACD,CAAC;AAEF,MAAM,cAAc,GAAG;IACtB,IAAI,EAAE;QACL,SAAS,EAAE,CAAC,YAAY,CAAC;QACzB,QAAQ,EAAE,CAAC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