n8n-nodes-piapi 0.1.4 → 0.1.5
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 +16 -0
- package/dist/nodes/PiAPI/LLM/LLMConversationalImage.node.d.ts +5 -0
- package/dist/nodes/PiAPI/LLM/LLMConversationalImage.node.js +343 -0
- package/dist/nodes/PiAPI/LLM/LLMConversationalImage.node.js.map +1 -0
- package/dist/nodes/PiAPI/LLM/LLMImageToImage.node.d.ts +5 -0
- package/dist/nodes/PiAPI/LLM/LLMImageToImage.node.js +239 -0
- package/dist/nodes/PiAPI/LLM/LLMImageToImage.node.js.map +1 -0
- package/dist/nodes/PiAPI/LLM/LLMTextToImage.node.d.ts +5 -0
- package/dist/nodes/PiAPI/LLM/LLMTextToImage.node.js +161 -0
- package/dist/nodes/PiAPI/LLM/LLMTextToImage.node.js.map +1 -0
- package/dist/nodes/PiAPI/TaskStatus/PiAPITaskStatus.node.js +8 -1
- package/dist/nodes/PiAPI/TaskStatus/PiAPITaskStatus.node.js.map +1 -1
- package/dist/nodes/PiAPI/shared/GenericFunctions.d.ts +1 -0
- package/dist/nodes/PiAPI/shared/GenericFunctions.js +20 -0
- package/dist/nodes/PiAPI/shared/GenericFunctions.js.map +1 -1
- package/dist/package.json +4 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -2
package/README.md
CHANGED
@@ -8,6 +8,7 @@ This n8n community node enables seamless integration of **[PiAPI](https://piapi.
|
|
8
8
|
|
9
9
|
- Image to Video
|
10
10
|
- Text to Video
|
11
|
+
- Director Mode (camera control)
|
11
12
|
- Video Extension
|
12
13
|
- Video Effects
|
13
14
|
- Text to Image
|
@@ -20,8 +21,23 @@ This n8n community node enables seamless integration of **[PiAPI](https://piapi.
|
|
20
21
|
- Image/Video Upscale
|
21
22
|
- Remove Background
|
22
23
|
- Segment
|
24
|
+
- GPT-4o Image Generation
|
23
25
|
- Temporarely store files
|
24
26
|
|
27
|
+
## GPT-4o Image Generation
|
28
|
+
|
29
|
+
The new GPT-4o integration allows for:
|
30
|
+
- Advanced text-to-image generation with superior text rendering
|
31
|
+
- Image-to-image editing with natural language instructions
|
32
|
+
|
33
|
+
## Director Mode
|
34
|
+
|
35
|
+
The Director Mode (available in Hailuo nodes) allows:
|
36
|
+
- Camera movement control in video generation
|
37
|
+
- Use bracket syntax like `[Push in,Pedestal up]walking man` in your prompts
|
38
|
+
- Supports movements such as Pan, Tilt, Truck, Push, Pedestal, Zoom, Shake and Static shot
|
39
|
+
- Available in both text-to-video and image-to-video nodes
|
40
|
+
|
25
41
|
## Installation
|
26
42
|
|
27
43
|
Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation.
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
2
|
+
export declare class LLMConversationalImage implements INodeType {
|
3
|
+
description: INodeTypeDescription;
|
4
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
5
|
+
}
|
@@ -0,0 +1,343 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.LLMConversationalImage = void 0;
|
4
|
+
const GenericFunctions_1 = require("../shared/GenericFunctions");
|
5
|
+
const Constants_1 = require("../shared/Constants");
|
6
|
+
function generatePromptWithAspectRatio(executeFunctions, itemIndex, prompt) {
|
7
|
+
const aspectRatio = executeFunctions.getNodeParameter('aspectRatio', itemIndex, 'default');
|
8
|
+
const imageStyle = executeFunctions.getNodeParameter('imageStyle', itemIndex, 'none');
|
9
|
+
let aspectRatioText = '';
|
10
|
+
if (aspectRatio !== 'default') {
|
11
|
+
if (aspectRatio === 'custom') {
|
12
|
+
const width = executeFunctions.getNodeParameter('width', itemIndex, 1024);
|
13
|
+
const height = executeFunctions.getNodeParameter('height', itemIndex, 1024);
|
14
|
+
aspectRatioText = `Image size: ${width}x${height}. `;
|
15
|
+
}
|
16
|
+
else if (aspectRatio !== 'square_header' && aspectRatio !== 'landscape_header' && aspectRatio !== 'portrait_header') {
|
17
|
+
aspectRatioText = `Image size: ${aspectRatio}. `;
|
18
|
+
}
|
19
|
+
}
|
20
|
+
let styleText = '';
|
21
|
+
if (imageStyle !== 'none') {
|
22
|
+
styleText = `Image style: ${imageStyle}. `;
|
23
|
+
}
|
24
|
+
return `${aspectRatioText}${styleText}${prompt}`;
|
25
|
+
}
|
26
|
+
class LLMConversationalImage {
|
27
|
+
constructor() {
|
28
|
+
this.description = {
|
29
|
+
displayName: 'PiAPI GPT-4o Conversational Image',
|
30
|
+
name: 'llmConversationalImage',
|
31
|
+
icon: 'file:../piapi.svg',
|
32
|
+
group: ['transform'],
|
33
|
+
version: 1,
|
34
|
+
description: 'Edit and generate images through conversational interaction with GPT-4o',
|
35
|
+
defaults: {
|
36
|
+
name: 'GPT-4o Conversational Image',
|
37
|
+
},
|
38
|
+
inputs: ["main"],
|
39
|
+
outputs: ["main"],
|
40
|
+
credentials: [
|
41
|
+
{
|
42
|
+
name: 'piAPIApi',
|
43
|
+
required: true,
|
44
|
+
},
|
45
|
+
],
|
46
|
+
properties: [
|
47
|
+
{
|
48
|
+
displayName: 'Model',
|
49
|
+
name: 'model',
|
50
|
+
type: 'options',
|
51
|
+
options: [
|
52
|
+
{
|
53
|
+
name: 'GPT-4o Image Preview',
|
54
|
+
value: 'gpt-4o-image-preview',
|
55
|
+
},
|
56
|
+
],
|
57
|
+
default: 'gpt-4o-image-preview',
|
58
|
+
description: 'The model to use for conversational image editing',
|
59
|
+
},
|
60
|
+
{
|
61
|
+
displayName: 'Operation',
|
62
|
+
name: 'operation',
|
63
|
+
type: 'options',
|
64
|
+
options: [
|
65
|
+
{
|
66
|
+
name: 'New Conversation',
|
67
|
+
value: 'new',
|
68
|
+
},
|
69
|
+
{
|
70
|
+
name: 'Continue Conversation',
|
71
|
+
value: 'continue',
|
72
|
+
},
|
73
|
+
],
|
74
|
+
default: 'new',
|
75
|
+
description: 'Whether to start a new conversation or continue an existing one',
|
76
|
+
},
|
77
|
+
{
|
78
|
+
displayName: 'Image Source',
|
79
|
+
name: 'imageSource',
|
80
|
+
type: 'options',
|
81
|
+
options: [
|
82
|
+
{
|
83
|
+
name: 'None (Text Only)',
|
84
|
+
value: 'none',
|
85
|
+
},
|
86
|
+
{
|
87
|
+
name: 'URL',
|
88
|
+
value: 'url',
|
89
|
+
},
|
90
|
+
{
|
91
|
+
name: 'Binary Data',
|
92
|
+
value: 'binaryData',
|
93
|
+
},
|
94
|
+
],
|
95
|
+
default: 'none',
|
96
|
+
description: 'The source of the input image (if any)',
|
97
|
+
displayOptions: {
|
98
|
+
show: {
|
99
|
+
operation: ['new'],
|
100
|
+
},
|
101
|
+
},
|
102
|
+
},
|
103
|
+
{
|
104
|
+
displayName: 'Image URL',
|
105
|
+
name: 'imageUrl',
|
106
|
+
type: 'string',
|
107
|
+
default: '',
|
108
|
+
required: true,
|
109
|
+
displayOptions: {
|
110
|
+
show: {
|
111
|
+
imageSource: ['url'],
|
112
|
+
operation: ['new'],
|
113
|
+
},
|
114
|
+
},
|
115
|
+
description: 'URL of the image to start with',
|
116
|
+
},
|
117
|
+
{
|
118
|
+
displayName: 'Binary Property',
|
119
|
+
name: 'binaryPropertyName',
|
120
|
+
type: 'string',
|
121
|
+
default: 'data',
|
122
|
+
required: true,
|
123
|
+
displayOptions: {
|
124
|
+
show: {
|
125
|
+
imageSource: ['binaryData'],
|
126
|
+
operation: ['new'],
|
127
|
+
},
|
128
|
+
},
|
129
|
+
description: 'Name of the binary property containing the image data',
|
130
|
+
},
|
131
|
+
{
|
132
|
+
displayName: 'Prompt',
|
133
|
+
name: 'prompt',
|
134
|
+
type: 'string',
|
135
|
+
typeOptions: {
|
136
|
+
rows: 4,
|
137
|
+
},
|
138
|
+
default: '',
|
139
|
+
required: true,
|
140
|
+
description: 'Text prompt for image generation/editing',
|
141
|
+
},
|
142
|
+
{
|
143
|
+
displayName: 'Aspect Ratio',
|
144
|
+
name: 'aspectRatio',
|
145
|
+
type: 'options',
|
146
|
+
options: [
|
147
|
+
{
|
148
|
+
name: 'Default (No Specification)',
|
149
|
+
value: 'default',
|
150
|
+
},
|
151
|
+
...Constants_1.ASPECT_RATIO_OPTIONS.filter(option => option.value !== 'square_header' &&
|
152
|
+
option.value !== 'landscape_header' &&
|
153
|
+
option.value !== 'portrait_header'),
|
154
|
+
],
|
155
|
+
default: 'default',
|
156
|
+
description: 'Aspect ratio for new image generation (only applies to new conversations or when generating new images)',
|
157
|
+
},
|
158
|
+
{
|
159
|
+
displayName: 'Custom Width',
|
160
|
+
name: 'width',
|
161
|
+
type: 'number',
|
162
|
+
displayOptions: {
|
163
|
+
show: {
|
164
|
+
aspectRatio: ['custom'],
|
165
|
+
},
|
166
|
+
},
|
167
|
+
default: 1024,
|
168
|
+
description: 'Custom width of the generated image',
|
169
|
+
},
|
170
|
+
{
|
171
|
+
displayName: 'Custom Height',
|
172
|
+
name: 'height',
|
173
|
+
type: 'number',
|
174
|
+
displayOptions: {
|
175
|
+
show: {
|
176
|
+
aspectRatio: ['custom'],
|
177
|
+
},
|
178
|
+
},
|
179
|
+
default: 1024,
|
180
|
+
description: 'Custom height of the generated image',
|
181
|
+
},
|
182
|
+
{
|
183
|
+
displayName: 'Image Style',
|
184
|
+
name: 'imageStyle',
|
185
|
+
type: 'options',
|
186
|
+
options: Constants_1.LORA_OPTIONS,
|
187
|
+
default: 'none',
|
188
|
+
description: 'Style to apply to the generated image',
|
189
|
+
},
|
190
|
+
{
|
191
|
+
displayName: 'Previous Messages',
|
192
|
+
name: 'previousMessages',
|
193
|
+
type: 'json',
|
194
|
+
typeOptions: {
|
195
|
+
rows: 4,
|
196
|
+
},
|
197
|
+
default: '[]',
|
198
|
+
required: true,
|
199
|
+
displayOptions: {
|
200
|
+
show: {
|
201
|
+
operation: ['continue'],
|
202
|
+
},
|
203
|
+
},
|
204
|
+
description: 'JSON array of previous conversation messages',
|
205
|
+
},
|
206
|
+
{
|
207
|
+
displayName: 'Previous Images',
|
208
|
+
name: 'previousImages',
|
209
|
+
type: 'json',
|
210
|
+
typeOptions: {
|
211
|
+
rows: 4,
|
212
|
+
},
|
213
|
+
default: '[]',
|
214
|
+
displayOptions: {
|
215
|
+
show: {
|
216
|
+
operation: ['continue'],
|
217
|
+
},
|
218
|
+
},
|
219
|
+
description: 'JSON array of previous image URLs (optional)',
|
220
|
+
},
|
221
|
+
{
|
222
|
+
displayName: 'Wait for Completion',
|
223
|
+
name: 'waitForCompletion',
|
224
|
+
type: 'boolean',
|
225
|
+
default: false,
|
226
|
+
description: 'Wait for task to complete and return results',
|
227
|
+
},
|
228
|
+
],
|
229
|
+
};
|
230
|
+
}
|
231
|
+
async execute() {
|
232
|
+
var _a;
|
233
|
+
const items = this.getInputData();
|
234
|
+
const returnData = [];
|
235
|
+
for (let i = 0; i < items.length; i++) {
|
236
|
+
const model = this.getNodeParameter('model', i);
|
237
|
+
const operation = this.getNodeParameter('operation', i);
|
238
|
+
const prompt = this.getNodeParameter('prompt', i);
|
239
|
+
const waitForCompletion = this.getNodeParameter('waitForCompletion', i, true);
|
240
|
+
let messages = [];
|
241
|
+
if (operation === 'new') {
|
242
|
+
const imageSource = this.getNodeParameter('imageSource', i);
|
243
|
+
if (imageSource === 'none') {
|
244
|
+
messages = [
|
245
|
+
{
|
246
|
+
role: 'user',
|
247
|
+
content: generatePromptWithAspectRatio(this, i, prompt),
|
248
|
+
},
|
249
|
+
];
|
250
|
+
}
|
251
|
+
else {
|
252
|
+
let imageUrl = '';
|
253
|
+
if (imageSource === 'url') {
|
254
|
+
imageUrl = this.getNodeParameter('imageUrl', i);
|
255
|
+
}
|
256
|
+
else {
|
257
|
+
const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
|
258
|
+
const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
|
259
|
+
if (binaryData.mimeType && !binaryData.mimeType.includes('image/')) {
|
260
|
+
throw new Error('The provided binary data is not an image');
|
261
|
+
}
|
262
|
+
if (binaryData.data) {
|
263
|
+
const dataBuffer = Buffer.from(binaryData.data, 'base64');
|
264
|
+
imageUrl = `data:${binaryData.mimeType};base64,${dataBuffer.toString('base64')}`;
|
265
|
+
}
|
266
|
+
else if (binaryData.url) {
|
267
|
+
imageUrl = binaryData.url;
|
268
|
+
}
|
269
|
+
else {
|
270
|
+
throw new Error('No usable image data found in the provided binary property');
|
271
|
+
}
|
272
|
+
}
|
273
|
+
messages = [
|
274
|
+
{
|
275
|
+
role: 'user',
|
276
|
+
content: [
|
277
|
+
{
|
278
|
+
type: 'image_url',
|
279
|
+
image_url: {
|
280
|
+
url: imageUrl,
|
281
|
+
},
|
282
|
+
},
|
283
|
+
{
|
284
|
+
type: 'text',
|
285
|
+
text: generatePromptWithAspectRatio(this, i, prompt),
|
286
|
+
},
|
287
|
+
],
|
288
|
+
},
|
289
|
+
];
|
290
|
+
}
|
291
|
+
}
|
292
|
+
else {
|
293
|
+
try {
|
294
|
+
const previousMessages = JSON.parse(this.getNodeParameter('previousMessages', i));
|
295
|
+
if (!Array.isArray(previousMessages)) {
|
296
|
+
throw new Error('Previous messages must be a valid JSON array');
|
297
|
+
}
|
298
|
+
messages = [...previousMessages];
|
299
|
+
messages.push({
|
300
|
+
role: 'user',
|
301
|
+
content: prompt,
|
302
|
+
});
|
303
|
+
}
|
304
|
+
catch (error) {
|
305
|
+
throw new Error(`Failed to parse previous messages: ${error.message}`);
|
306
|
+
}
|
307
|
+
}
|
308
|
+
const body = {
|
309
|
+
model,
|
310
|
+
messages,
|
311
|
+
stream: true,
|
312
|
+
};
|
313
|
+
try {
|
314
|
+
const response = await GenericFunctions_1.llmApiRequest.call(this, body);
|
315
|
+
let taskResult = response;
|
316
|
+
if (waitForCompletion && ((_a = response.data) === null || _a === void 0 ? void 0 : _a.task_id)) {
|
317
|
+
taskResult = await GenericFunctions_1.waitForTaskCompletion.call(this, response.data.task_id);
|
318
|
+
}
|
319
|
+
taskResult.messages = messages;
|
320
|
+
if (taskResult.choices && taskResult.choices[0] && taskResult.choices[0].message) {
|
321
|
+
taskResult.messages.push(taskResult.choices[0].message);
|
322
|
+
}
|
323
|
+
returnData.push({
|
324
|
+
json: taskResult,
|
325
|
+
});
|
326
|
+
}
|
327
|
+
catch (error) {
|
328
|
+
if (this.continueOnFail()) {
|
329
|
+
returnData.push({
|
330
|
+
json: {
|
331
|
+
error: error.message,
|
332
|
+
},
|
333
|
+
});
|
334
|
+
continue;
|
335
|
+
}
|
336
|
+
throw error;
|
337
|
+
}
|
338
|
+
}
|
339
|
+
return [returnData];
|
340
|
+
}
|
341
|
+
}
|
342
|
+
exports.LLMConversationalImage = LLMConversationalImage;
|
343
|
+
//# sourceMappingURL=LLMConversationalImage.node.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"LLMConversationalImage.node.js","sourceRoot":"","sources":["../../../../nodes/PiAPI/LLM/LLMConversationalImage.node.ts"],"names":[],"mappings":";;;AAQA,iEAAkF;AAClF,mDAAyE;AAGzE,SAAS,6BAA6B,CACrC,gBAAmC,EACnC,SAAiB,EACjB,MAAc;IAEd,MAAM,WAAW,GAAG,gBAAgB,CAAC,gBAAgB,CAAC,aAAa,EAAE,SAAS,EAAE,SAAS,CAAW,CAAC;IACrG,MAAM,UAAU,GAAG,gBAAgB,CAAC,gBAAgB,CAAC,YAAY,EAAE,SAAS,EAAE,MAAM,CAAW,CAAC;IAGhG,IAAI,eAAe,GAAG,EAAE,CAAC;IACzB,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;QAC/B,IAAI,WAAW,KAAK,QAAQ,EAAE,CAAC;YAC9B,MAAM,KAAK,GAAG,gBAAgB,CAAC,gBAAgB,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,CAAW,CAAC;YACpF,MAAM,MAAM,GAAG,gBAAgB,CAAC,gBAAgB,CAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,CAAW,CAAC;YACtF,eAAe,G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AAI,CAAC,CAAC;gBAEtD,IAAI,UAAU,GAAG,QAAQ,CAAC;gBAG1B,IAAI,iBAAiB,KAAI,MAAA,QAAQ,CAAC,IAAI,0CAAE,OAAO,CAAA,EAAE,CAAC;oBACjD,UAAU,GAAG,MAAM,wCAAqB,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBAC5E,CAAC;gBAGD,UAAU,CAAC,QAAQ,GAAG,QAAQ,CAAC;gBAC/B,IAAI,UAAU,CAAC,OAAO,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;oBAClF,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;gBACzD,CAAC;gBAED,UAAU,CAAC,IAAI,CAAC;oBACf,IAAI,EAAE,UAAU;iBAChB,CAAC,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;oBAC3B,UAAU,CAAC,IAAI,CAAC;wBACf,IAAI,EAAE;4BACL,KAAK,EAAE,KAAK,CAAC,OAAO;yBACpB;qBACD,CAAC,CAAC;oBACH,SAAS;gBACV,CAAC;gBACD,MAAM,KAAK,CAAC;YACb,CAAC;QACF,CAAC;QAED,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AApVD,wDAoVC"}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
2
|
+
export declare class LLMImageToImage implements INodeType {
|
3
|
+
description: INodeTypeDescription;
|
4
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
5
|
+
}
|
@@ -0,0 +1,239 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.LLMImageToImage = void 0;
|
4
|
+
const GenericFunctions_1 = require("../shared/GenericFunctions");
|
5
|
+
const Constants_1 = require("../shared/Constants");
|
6
|
+
function generatePromptWithAspectRatio(executeFunctions, itemIndex, prompt) {
|
7
|
+
const aspectRatio = executeFunctions.getNodeParameter('aspectRatio', itemIndex);
|
8
|
+
const imageStyle = executeFunctions.getNodeParameter('imageStyle', itemIndex, 'none');
|
9
|
+
let aspectRatioText = '';
|
10
|
+
if (aspectRatio === 'custom') {
|
11
|
+
const width = executeFunctions.getNodeParameter('width', itemIndex, 1024);
|
12
|
+
const height = executeFunctions.getNodeParameter('height', itemIndex, 1024);
|
13
|
+
aspectRatioText = `Image size: ${width}x${height}. `;
|
14
|
+
}
|
15
|
+
else if (aspectRatio !== 'square_header' && aspectRatio !== 'landscape_header' && aspectRatio !== 'portrait_header') {
|
16
|
+
aspectRatioText = `Image size: ${aspectRatio}. `;
|
17
|
+
}
|
18
|
+
let styleText = '';
|
19
|
+
if (imageStyle !== 'none') {
|
20
|
+
styleText = `Image style: ${imageStyle}. `;
|
21
|
+
}
|
22
|
+
return `${aspectRatioText}${styleText}${prompt}`;
|
23
|
+
}
|
24
|
+
class LLMImageToImage {
|
25
|
+
constructor() {
|
26
|
+
this.description = {
|
27
|
+
displayName: 'PiAPI GPT-4o Image to Image',
|
28
|
+
name: 'llmImageToImage',
|
29
|
+
icon: 'file:../piapi.svg',
|
30
|
+
group: ['transform'],
|
31
|
+
version: 1,
|
32
|
+
description: 'Transform images using PiAPI GPT-4o Image Generation',
|
33
|
+
defaults: {
|
34
|
+
name: 'GPT-4o Image to Image',
|
35
|
+
},
|
36
|
+
inputs: ["main"],
|
37
|
+
outputs: ["main"],
|
38
|
+
credentials: [
|
39
|
+
{
|
40
|
+
name: 'piAPIApi',
|
41
|
+
required: true,
|
42
|
+
},
|
43
|
+
],
|
44
|
+
properties: [
|
45
|
+
{
|
46
|
+
displayName: 'Model',
|
47
|
+
name: 'model',
|
48
|
+
type: 'options',
|
49
|
+
options: [
|
50
|
+
{
|
51
|
+
name: 'GPT-4o Image Preview',
|
52
|
+
value: 'gpt-4o-image-preview',
|
53
|
+
},
|
54
|
+
],
|
55
|
+
default: 'gpt-4o-image-preview',
|
56
|
+
description: 'The model to use for image transformation',
|
57
|
+
},
|
58
|
+
{
|
59
|
+
displayName: 'Image Source',
|
60
|
+
name: 'imageSource',
|
61
|
+
type: 'options',
|
62
|
+
options: [
|
63
|
+
{
|
64
|
+
name: 'URL',
|
65
|
+
value: 'url',
|
66
|
+
},
|
67
|
+
{
|
68
|
+
name: 'Binary Data',
|
69
|
+
value: 'binaryData',
|
70
|
+
},
|
71
|
+
],
|
72
|
+
default: 'url',
|
73
|
+
description: 'The source of the input image',
|
74
|
+
},
|
75
|
+
{
|
76
|
+
displayName: 'Image URL',
|
77
|
+
name: 'imageUrl',
|
78
|
+
type: 'string',
|
79
|
+
default: '',
|
80
|
+
required: true,
|
81
|
+
displayOptions: {
|
82
|
+
show: {
|
83
|
+
imageSource: ['url'],
|
84
|
+
},
|
85
|
+
},
|
86
|
+
description: 'URL of the image to transform',
|
87
|
+
},
|
88
|
+
{
|
89
|
+
displayName: 'Binary Property',
|
90
|
+
name: 'binaryPropertyName',
|
91
|
+
type: 'string',
|
92
|
+
default: 'data',
|
93
|
+
required: true,
|
94
|
+
displayOptions: {
|
95
|
+
show: {
|
96
|
+
imageSource: ['binaryData'],
|
97
|
+
},
|
98
|
+
},
|
99
|
+
description: 'Name of the binary property containing the image data',
|
100
|
+
},
|
101
|
+
{
|
102
|
+
displayName: 'Prompt',
|
103
|
+
name: 'prompt',
|
104
|
+
type: 'string',
|
105
|
+
typeOptions: {
|
106
|
+
rows: 4,
|
107
|
+
},
|
108
|
+
default: '',
|
109
|
+
required: true,
|
110
|
+
description: 'Text prompt for image transformation',
|
111
|
+
},
|
112
|
+
{
|
113
|
+
displayName: 'Aspect Ratio',
|
114
|
+
name: 'aspectRatio',
|
115
|
+
type: 'options',
|
116
|
+
options: Constants_1.ASPECT_RATIO_OPTIONS,
|
117
|
+
default: '1024:1024',
|
118
|
+
description: 'Aspect ratio for the output image',
|
119
|
+
},
|
120
|
+
{
|
121
|
+
displayName: 'Custom Width',
|
122
|
+
name: 'width',
|
123
|
+
type: 'number',
|
124
|
+
displayOptions: {
|
125
|
+
show: {
|
126
|
+
aspectRatio: ['custom'],
|
127
|
+
},
|
128
|
+
},
|
129
|
+
default: 1024,
|
130
|
+
description: 'Custom width of the output image',
|
131
|
+
},
|
132
|
+
{
|
133
|
+
displayName: 'Custom Height',
|
134
|
+
name: 'height',
|
135
|
+
type: 'number',
|
136
|
+
displayOptions: {
|
137
|
+
show: {
|
138
|
+
aspectRatio: ['custom'],
|
139
|
+
},
|
140
|
+
},
|
141
|
+
default: 1024,
|
142
|
+
description: 'Custom height of the output image',
|
143
|
+
},
|
144
|
+
{
|
145
|
+
displayName: 'Image Style',
|
146
|
+
name: 'imageStyle',
|
147
|
+
type: 'options',
|
148
|
+
options: Constants_1.LORA_OPTIONS,
|
149
|
+
default: 'none',
|
150
|
+
description: 'Style to apply to the generated image',
|
151
|
+
},
|
152
|
+
{
|
153
|
+
displayName: 'Wait for Completion',
|
154
|
+
name: 'waitForCompletion',
|
155
|
+
type: 'boolean',
|
156
|
+
default: false,
|
157
|
+
description: 'Wait for task to complete and return results',
|
158
|
+
},
|
159
|
+
],
|
160
|
+
};
|
161
|
+
}
|
162
|
+
async execute() {
|
163
|
+
var _a;
|
164
|
+
const items = this.getInputData();
|
165
|
+
const returnData = [];
|
166
|
+
for (let i = 0; i < items.length; i++) {
|
167
|
+
const model = this.getNodeParameter('model', i);
|
168
|
+
const prompt = this.getNodeParameter('prompt', i);
|
169
|
+
const imageSource = this.getNodeParameter('imageSource', i);
|
170
|
+
const waitForCompletion = this.getNodeParameter('waitForCompletion', i, true);
|
171
|
+
let imageUrl = '';
|
172
|
+
if (imageSource === 'url') {
|
173
|
+
imageUrl = this.getNodeParameter('imageUrl', i);
|
174
|
+
}
|
175
|
+
else {
|
176
|
+
const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
|
177
|
+
const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
|
178
|
+
if (binaryData.mimeType && !binaryData.mimeType.includes('image/')) {
|
179
|
+
throw new Error('The provided binary data is not an image');
|
180
|
+
}
|
181
|
+
if (binaryData.data) {
|
182
|
+
const dataBuffer = Buffer.from(binaryData.data, 'base64');
|
183
|
+
imageUrl = `data:${binaryData.mimeType};base64,${dataBuffer.toString('base64')}`;
|
184
|
+
}
|
185
|
+
else if (binaryData.url) {
|
186
|
+
imageUrl = binaryData.url;
|
187
|
+
}
|
188
|
+
else {
|
189
|
+
throw new Error('No usable image data found in the provided binary property');
|
190
|
+
}
|
191
|
+
}
|
192
|
+
const body = {
|
193
|
+
model,
|
194
|
+
messages: [
|
195
|
+
{
|
196
|
+
role: 'user',
|
197
|
+
content: [
|
198
|
+
{
|
199
|
+
type: 'image_url',
|
200
|
+
image_url: {
|
201
|
+
url: imageUrl,
|
202
|
+
},
|
203
|
+
},
|
204
|
+
{
|
205
|
+
type: 'text',
|
206
|
+
text: generatePromptWithAspectRatio(this, i, prompt),
|
207
|
+
},
|
208
|
+
],
|
209
|
+
},
|
210
|
+
],
|
211
|
+
stream: true,
|
212
|
+
};
|
213
|
+
try {
|
214
|
+
const response = await GenericFunctions_1.llmApiRequest.call(this, body);
|
215
|
+
let taskResult = response;
|
216
|
+
if (waitForCompletion && ((_a = response.data) === null || _a === void 0 ? void 0 : _a.task_id)) {
|
217
|
+
taskResult = await GenericFunctions_1.waitForTaskCompletion.call(this, response.data.task_id);
|
218
|
+
}
|
219
|
+
returnData.push({
|
220
|
+
json: taskResult,
|
221
|
+
});
|
222
|
+
}
|
223
|
+
catch (error) {
|
224
|
+
if (this.continueOnFail()) {
|
225
|
+
returnData.push({
|
226
|
+
json: {
|
227
|
+
error: error.message,
|
228
|
+
},
|
229
|
+
});
|
230
|
+
continue;
|
231
|
+
}
|
232
|
+
throw error;
|
233
|
+
}
|
234
|
+
}
|
235
|
+
return [returnData];
|
236
|
+
}
|
237
|
+
}
|
238
|
+
exports.LLMImageToImage = LLMImageToImage;
|
239
|
+
//# sourceMappingURL=LLMImageToImage.node.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"LLMImageToImage.node.js","sourceRoot":"","sources":["../../../../nodes/PiAPI/LLM/LLMImageToImage.node.ts"],"names":[],"mappings":";;;AAQA,iEAAkF;AAClF,mDAAyE;AAGzE,SAAS,6BAA6B,CACrC,gBAAmC,EACnC,SAAiB,EACjB,MAAc;IAEd,MAAM,WAAW,GAAG,gBAAgB,CAAC,gBAAgB,CAAC,aAAa,EAAE,SAAS,CAAW,CAAC;IAC1F,MAAM,UAAU,GAAG,gBAAgB,CAAC,gBAAgB,CAAC,YAAY,EAAE,SAAS,EAAE,MAAM,CAAW,CAAC;IAEhG,IAAI,eAAe,GAAG,EAAE,CAAC;IACzB,IAAI,WAAW,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,KAAK,GAAG,gBAAgB,CAAC,gBAAgB,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,CAAW,CAAC;QACpF,MAAM,MAAM,GAAG,gBAAgB,CAAC,gBAAgB,CAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,CAAW,CAAC;QACtF,eAAe,GAAG,eAAe,KAAK,IAAI,MAAM,IAAI,CAAC;IACtD,CAAC;SAAM,IAAI,WAAW,KAAK,eAAe,IAAI,WAAW,KAAK,kBAAkB,IAAI,WAAW,KAAK,iBAAiB,EAAE,CAAC;QACvH,eAAe,GAAG,eAAe,WAAW,IAAI,CAAC;IAClD,CAAC;IAGD,IAAI,SAAS,GAAG,EAAE,CAAC;IACnB,IAAI,UAAU,KAAK,MAAM,EAAE,CAAC;QAC3B,SAAS,GAAG,gBAAgB,UAAU,IAAI,CAAC;IAC5C,CAAC;IAED,OAA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C,CAAC;gBAC5E,CAAC;gBAED,UAAU,CAAC,IAAI,CAAC;oBACf,IAAI,EAAE,UAAU;iBAChB,CAAC,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;oBAC3B,UAAU,CAAC,IAAI,CAAC;wBACf,IAAI,EAAE;4BACL,KAAK,EAAE,KAAK,CAAC,OAAO;yBACpB;qBACD,CAAC,CAAC;oBACH,SAAS;gBACV,CAAC;gBACD,MAAM,KAAK,CAAC;YACb,CAAC;QACF,CAAC;QAED,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AA/ND,0CA+NC"}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
2
|
+
export declare class LLMTextToImage implements INodeType {
|
3
|
+
description: INodeTypeDescription;
|
4
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
5
|
+
}
|