n8n-nodes-supermachine 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/credentials/SupermachineApi.credentials.ts +41 -0
- package/dist/credentials/SupermachineApi.credentials.js +38 -0
- package/dist/credentials/SupermachineApi.credentials.js.map +1 -0
- package/dist/nodes/Supermachine/Supermachine.node.js +428 -0
- package/dist/nodes/Supermachine/Supermachine.node.js.map +1 -0
- package/dist/nodes/Supermachine/SupermachineTrigger.node.js +157 -0
- package/dist/nodes/Supermachine/SupermachineTrigger.node.js.map +1 -0
- package/dist/nodes/Supermachine/descriptions/AccountDescription.js +73 -0
- package/dist/nodes/Supermachine/descriptions/AccountDescription.js.map +1 -0
- package/dist/nodes/Supermachine/descriptions/ImageDescription.js +355 -0
- package/dist/nodes/Supermachine/descriptions/ImageDescription.js.map +1 -0
- package/dist/nodes/Supermachine/descriptions/ToolsDescription.js +241 -0
- package/dist/nodes/Supermachine/descriptions/ToolsDescription.js.map +1 -0
- package/dist/nodes/Supermachine/descriptions/index.js +21 -0
- package/dist/nodes/Supermachine/descriptions/index.js.map +1 -0
- package/dist/nodes/Supermachine/index.js +5 -0
- package/dist/nodes/Supermachine/index.js.map +1 -0
- package/dist/nodes/Supermachine/supermachine.svg +132 -0
- package/gulpfile.js +58 -0
- package/index.ts +5 -0
- package/nodes/Supermachine/Supermachine.node.ts +508 -0
- package/nodes/Supermachine/SupermachineTrigger.node.ts +175 -0
- package/nodes/Supermachine/descriptions/AccountDescription.ts +72 -0
- package/nodes/Supermachine/descriptions/ImageDescription.ts +355 -0
- package/nodes/Supermachine/descriptions/ToolsDescription.ts +241 -0
- package/nodes/Supermachine/descriptions/index.ts +3 -0
- package/nodes/Supermachine/index.ts +3 -0
- package/nodes/Supermachine/supermachine.svg +132 -0
- package/package.json +47 -0
- package/tsconfig.json +15 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import {
|
|
2
|
+
IAuthenticateGeneric,
|
|
3
|
+
ICredentialTestRequest,
|
|
4
|
+
ICredentialType,
|
|
5
|
+
INodeProperties,
|
|
6
|
+
} from 'n8n-workflow';
|
|
7
|
+
|
|
8
|
+
export class SupermachineApi implements ICredentialType {
|
|
9
|
+
name = 'supermachineApi';
|
|
10
|
+
displayName = 'Supermachine API';
|
|
11
|
+
documentationUrl = 'https://knowledge.supermachine.art/help/accessing-the-supermachine-api';
|
|
12
|
+
properties: INodeProperties[] = [
|
|
13
|
+
{
|
|
14
|
+
displayName: 'API Key',
|
|
15
|
+
name: 'apiKey',
|
|
16
|
+
type: 'string',
|
|
17
|
+
typeOptions: { password: true },
|
|
18
|
+
default: '',
|
|
19
|
+
required: true,
|
|
20
|
+
placeholder: 'sk-xxxxxxxxxxxxxxxxxxxxxx',
|
|
21
|
+
description: 'Your Supermachine API key. Get it from <a href="https://supermachine.art/settings/api" target="_blank">Supermachine Settings</a>',
|
|
22
|
+
},
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
authenticate: IAuthenticateGeneric = {
|
|
26
|
+
type: 'generic',
|
|
27
|
+
properties: {
|
|
28
|
+
headers: {
|
|
29
|
+
'Authorization': '=Bearer {{$credentials.apiKey}}',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
test: ICredentialTestRequest = {
|
|
35
|
+
request: {
|
|
36
|
+
baseURL: 'https://dev.supermachine.art',
|
|
37
|
+
url: '/v1/user',
|
|
38
|
+
method: 'GET',
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SupermachineApi = void 0;
|
|
4
|
+
class SupermachineApi {
|
|
5
|
+
name = 'supermachineApi';
|
|
6
|
+
displayName = 'Supermachine API';
|
|
7
|
+
documentationUrl = 'https://knowledge.supermachine.art/help/accessing-the-supermachine-api';
|
|
8
|
+
properties = [
|
|
9
|
+
{
|
|
10
|
+
displayName: 'API Key',
|
|
11
|
+
name: 'apiKey',
|
|
12
|
+
type: 'string',
|
|
13
|
+
typeOptions: { password: true },
|
|
14
|
+
default: '',
|
|
15
|
+
required: true,
|
|
16
|
+
placeholder: 'sk-xxxxxxxxxxxxxxxxxxxxxx',
|
|
17
|
+
description: 'Your Supermachine API key. Get it from <a href="https://supermachine.art/settings/api" target="_blank">Supermachine Settings</a>',
|
|
18
|
+
},
|
|
19
|
+
];
|
|
20
|
+
authenticate = {
|
|
21
|
+
type: 'generic',
|
|
22
|
+
properties: {
|
|
23
|
+
headers: {
|
|
24
|
+
'Authorization': '=Bearer {{$credentials.apiKey}}',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
test = {
|
|
29
|
+
request: {
|
|
30
|
+
baseURL: 'https://dev.supermachine.art',
|
|
31
|
+
url: '/v1/user',
|
|
32
|
+
method: 'GET',
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
exports.SupermachineApi = SupermachineApi;
|
|
37
|
+
|
|
38
|
+
//# sourceMappingURL=SupermachineApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../credentials/SupermachineApi.credentials.ts"],"names":[],"mappings":";;;AAOA,MAAa,eAAe;IAC1B,IAAI,GAAG,iBAAiB,CAAC;IACzB,WAAW,GAAG,kBAAkB,CAAC;IACjC,gBAAgB,GAAG,wEAAwE,CAAC;IAC5F,UAAU,GAAsB;QAC9B;YACE,WAAW,EAAE,SAAS;YACtB,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC/B,OAAO,EAAE,EAAE;YACX,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,2BAA2B;YACxC,WAAW,EAAE,kIAAkI;SAChJ;KACF,CAAC;IAEF,YAAY,GAAyB;QACnC,IAAI,EAAE,SAAS;QACf,UAAU,EAAE;YACV,OAAO,EAAE;gBACP,eAAe,EAAE,iCAAiC;aACnD;SACF;KACF,CAAC;IAEF,IAAI,GAA2B;QAC7B,OAAO,EAAE;YACP,OAAO,EAAE,8BAA8B;YACvC,GAAG,EAAE,UAAU;YACf,MAAM,EAAE,KAAK;SACd;KACF,CAAC;CACH;AAjCD,0CAiCC","file":"SupermachineApi.credentials.js"}
|
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Supermachine = void 0;
|
|
4
|
+
const descriptions_1 = require("./descriptions");
|
|
5
|
+
class Supermachine {
|
|
6
|
+
description = {
|
|
7
|
+
displayName: 'Supermachine',
|
|
8
|
+
name: 'supermachine',
|
|
9
|
+
icon: 'file:supermachine.svg',
|
|
10
|
+
group: ['transform'],
|
|
11
|
+
version: 1,
|
|
12
|
+
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
13
|
+
description: 'Interact with Supermachine AI Image API',
|
|
14
|
+
defaults: { name: 'Supermachine' },
|
|
15
|
+
inputs: ['main'],
|
|
16
|
+
outputs: ['main'],
|
|
17
|
+
credentials: [{ name: 'supermachineApi', required: true }],
|
|
18
|
+
properties: [
|
|
19
|
+
{
|
|
20
|
+
displayName: 'Resource',
|
|
21
|
+
name: 'resource',
|
|
22
|
+
type: 'options',
|
|
23
|
+
noDataExpression: true,
|
|
24
|
+
options: [
|
|
25
|
+
{ name: 'Account', value: 'account' },
|
|
26
|
+
{ name: 'Image', value: 'image' },
|
|
27
|
+
{ name: 'Tools', value: 'tools' },
|
|
28
|
+
],
|
|
29
|
+
default: 'image',
|
|
30
|
+
},
|
|
31
|
+
...descriptions_1.getAccountOperations,
|
|
32
|
+
...descriptions_1.getAccountFields,
|
|
33
|
+
...descriptions_1.getImageOperations,
|
|
34
|
+
...descriptions_1.getImageFields,
|
|
35
|
+
...descriptions_1.getToolsOperations,
|
|
36
|
+
...descriptions_1.getToolsFields,
|
|
37
|
+
],
|
|
38
|
+
};
|
|
39
|
+
methods = {
|
|
40
|
+
loadOptions: {
|
|
41
|
+
// ═══════════════════════════════════════════════════════════
|
|
42
|
+
// Load danh sách Models
|
|
43
|
+
// ═══════════════════════════════════════════════════════════
|
|
44
|
+
async getModels() {
|
|
45
|
+
const credentials = await this.getCredentials('supermachineApi');
|
|
46
|
+
const apiKey = credentials.apiKey;
|
|
47
|
+
try {
|
|
48
|
+
const response = await this.helpers.httpRequest({
|
|
49
|
+
method: 'GET',
|
|
50
|
+
url: 'https://dev.supermachine.art/v1/models',
|
|
51
|
+
headers: {
|
|
52
|
+
'Authorization': `Bearer ${apiKey}`,
|
|
53
|
+
'Content-Type': 'application/json',
|
|
54
|
+
},
|
|
55
|
+
json: true,
|
|
56
|
+
});
|
|
57
|
+
const items = response.items;
|
|
58
|
+
if (!Array.isArray(items) || items.length === 0) {
|
|
59
|
+
return [{ name: 'No models available', value: '' }];
|
|
60
|
+
}
|
|
61
|
+
return items.map((model) => ({
|
|
62
|
+
name: model.title,
|
|
63
|
+
value: model.title,
|
|
64
|
+
description: `${model.slug} (ID: ${model.id})`,
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
console.error('Supermachine getModels error:', error);
|
|
69
|
+
return [{ name: `⚠️ Error: ${error.message}`, value: '' }];
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
// ═══════════════════════════════════════════════════════════
|
|
73
|
+
// Load danh sách LoRAs theo modelId được chọn
|
|
74
|
+
// ═══════════════════════════════════════════════════════════
|
|
75
|
+
async getLoras() {
|
|
76
|
+
const credentials = await this.getCredentials('supermachineApi');
|
|
77
|
+
const apiKey = credentials.apiKey;
|
|
78
|
+
const modelTitle = this.getNodeParameter('model');
|
|
79
|
+
if (!modelTitle) {
|
|
80
|
+
return [{
|
|
81
|
+
name: '⚠️ Please select a model first',
|
|
82
|
+
value: '',
|
|
83
|
+
description: 'LoRAs depend on the selected model'
|
|
84
|
+
}];
|
|
85
|
+
}
|
|
86
|
+
try {
|
|
87
|
+
const modelsResponse = await this.helpers.httpRequest({
|
|
88
|
+
method: 'GET',
|
|
89
|
+
url: 'https://dev.supermachine.art/v1/models',
|
|
90
|
+
headers: {
|
|
91
|
+
'Authorization': `Bearer ${apiKey}`,
|
|
92
|
+
'Content-Type': 'application/json',
|
|
93
|
+
},
|
|
94
|
+
json: true,
|
|
95
|
+
});
|
|
96
|
+
const models = modelsResponse.items;
|
|
97
|
+
const selectedModel = models.find((m) => m.title === modelTitle);
|
|
98
|
+
if (!selectedModel) {
|
|
99
|
+
return [{
|
|
100
|
+
name: `⚠️ Model "${modelTitle}" not found`,
|
|
101
|
+
value: '',
|
|
102
|
+
description: 'Try refreshing the page'
|
|
103
|
+
}];
|
|
104
|
+
}
|
|
105
|
+
const modelId = selectedModel.id;
|
|
106
|
+
const lorasResponse = await this.helpers.httpRequest({
|
|
107
|
+
method: 'GET',
|
|
108
|
+
url: `https://dev.supermachine.art/v1/loras?modelId=${modelId}`,
|
|
109
|
+
headers: {
|
|
110
|
+
'Authorization': `Bearer ${apiKey}`,
|
|
111
|
+
'Content-Type': 'application/json',
|
|
112
|
+
},
|
|
113
|
+
json: true,
|
|
114
|
+
});
|
|
115
|
+
const items = lorasResponse.items;
|
|
116
|
+
if (!Array.isArray(items) || items.length === 0) {
|
|
117
|
+
return [{
|
|
118
|
+
name: 'No LoRAs available for this model',
|
|
119
|
+
value: '',
|
|
120
|
+
description: `Model "${modelTitle}" doesn't support LoRAs`
|
|
121
|
+
}];
|
|
122
|
+
}
|
|
123
|
+
return items.map((lora) => {
|
|
124
|
+
const triggerWords = lora.triggerWords || [];
|
|
125
|
+
const triggerHint = triggerWords.length > 0
|
|
126
|
+
? ` | Trigger: ${triggerWords.join(', ')}`
|
|
127
|
+
: '';
|
|
128
|
+
return {
|
|
129
|
+
name: lora.name,
|
|
130
|
+
value: String(lora.id),
|
|
131
|
+
description: `${lora.slug}${triggerHint}`,
|
|
132
|
+
};
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
catch (error) {
|
|
136
|
+
console.error('Supermachine getLoras error:', error);
|
|
137
|
+
return [{
|
|
138
|
+
name: `⚠️ Error loading LoRAs: ${error.message}`,
|
|
139
|
+
value: '',
|
|
140
|
+
description: 'Check your API key and network connection'
|
|
141
|
+
}];
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
// ═══════════════════════════════════════════════════════════
|
|
145
|
+
// Load danh sách Character Categories
|
|
146
|
+
// ═══════════════════════════════════════════════════════════
|
|
147
|
+
async getCharacterCategories() {
|
|
148
|
+
const credentials = await this.getCredentials('supermachineApi');
|
|
149
|
+
const apiKey = credentials.apiKey;
|
|
150
|
+
try {
|
|
151
|
+
const response = await this.helpers.httpRequest({
|
|
152
|
+
method: 'GET',
|
|
153
|
+
url: 'https://dev.supermachine.art/v1/characters/categories',
|
|
154
|
+
headers: {
|
|
155
|
+
'Authorization': `Bearer ${apiKey}`,
|
|
156
|
+
'Content-Type': 'application/json',
|
|
157
|
+
},
|
|
158
|
+
json: true,
|
|
159
|
+
});
|
|
160
|
+
const items = response.items;
|
|
161
|
+
if (!Array.isArray(items) || items.length === 0) {
|
|
162
|
+
return [{
|
|
163
|
+
name: 'No categories available',
|
|
164
|
+
value: '',
|
|
165
|
+
description: 'Character categories may not be enabled'
|
|
166
|
+
}];
|
|
167
|
+
}
|
|
168
|
+
return items.map((category) => ({
|
|
169
|
+
name: category.name,
|
|
170
|
+
value: String(category.id),
|
|
171
|
+
description: `Category ID: ${category.id}`,
|
|
172
|
+
}));
|
|
173
|
+
}
|
|
174
|
+
catch (error) {
|
|
175
|
+
console.error('Supermachine getCharacterCategories error:', error);
|
|
176
|
+
return [{
|
|
177
|
+
name: `⚠️ Error: ${error.message}`,
|
|
178
|
+
value: '',
|
|
179
|
+
description: 'Check your API key and permissions'
|
|
180
|
+
}];
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
// ═══════════════════════════════════════════════════════════
|
|
184
|
+
// Load danh sách Characters (phụ thuộc category + model)
|
|
185
|
+
// ═══════════════════════════════════════════════════════════
|
|
186
|
+
async getCharacters() {
|
|
187
|
+
const credentials = await this.getCredentials('supermachineApi');
|
|
188
|
+
const apiKey = credentials.apiKey;
|
|
189
|
+
const additionalFields = this.getCurrentNodeParameter('additionalFields');
|
|
190
|
+
const categoryId = additionalFields?.characterCategory;
|
|
191
|
+
const modelTitle = this.getNodeParameter('model');
|
|
192
|
+
if (!categoryId) {
|
|
193
|
+
return [{
|
|
194
|
+
name: '⚠️ Please select a Character Category first',
|
|
195
|
+
value: '',
|
|
196
|
+
description: 'Characters depend on the selected category'
|
|
197
|
+
}];
|
|
198
|
+
}
|
|
199
|
+
if (!modelTitle) {
|
|
200
|
+
return [{
|
|
201
|
+
name: '⚠️ Please select a Model first',
|
|
202
|
+
value: '',
|
|
203
|
+
description: 'Characters depend on the selected model'
|
|
204
|
+
}];
|
|
205
|
+
}
|
|
206
|
+
try {
|
|
207
|
+
const modelsResponse = await this.helpers.httpRequest({
|
|
208
|
+
method: 'GET',
|
|
209
|
+
url: 'https://dev.supermachine.art/v1/models',
|
|
210
|
+
headers: {
|
|
211
|
+
'Authorization': `Bearer ${apiKey}`,
|
|
212
|
+
'Content-Type': 'application/json',
|
|
213
|
+
},
|
|
214
|
+
json: true,
|
|
215
|
+
});
|
|
216
|
+
const models = modelsResponse.items;
|
|
217
|
+
const selectedModel = models.find((m) => m.title === modelTitle);
|
|
218
|
+
if (!selectedModel) {
|
|
219
|
+
return [{
|
|
220
|
+
name: `⚠️ Model "${modelTitle}" not found`,
|
|
221
|
+
value: '',
|
|
222
|
+
description: 'Try refreshing the page'
|
|
223
|
+
}];
|
|
224
|
+
}
|
|
225
|
+
const modelId = selectedModel.id;
|
|
226
|
+
const charactersResponse = await this.helpers.httpRequest({
|
|
227
|
+
method: 'GET',
|
|
228
|
+
url: `https://dev.supermachine.art/v1/characters?categoryId=${categoryId}&modelId=${modelId}`,
|
|
229
|
+
headers: {
|
|
230
|
+
'Authorization': `Bearer ${apiKey}`,
|
|
231
|
+
'Content-Type': 'application/json',
|
|
232
|
+
},
|
|
233
|
+
json: true,
|
|
234
|
+
});
|
|
235
|
+
const items = charactersResponse.items;
|
|
236
|
+
if (!Array.isArray(items) || items.length === 0) {
|
|
237
|
+
return [{
|
|
238
|
+
name: 'No characters available',
|
|
239
|
+
value: '',
|
|
240
|
+
description: `No characters found for this category and model combination`
|
|
241
|
+
}];
|
|
242
|
+
}
|
|
243
|
+
return items.map((character) => {
|
|
244
|
+
const embedCode = character.embedCode;
|
|
245
|
+
const embedHint = embedCode ? ` | Use: "${embedCode}"` : '';
|
|
246
|
+
return {
|
|
247
|
+
name: character.name,
|
|
248
|
+
value: String(character.id),
|
|
249
|
+
description: `${character.slug}${embedHint}`,
|
|
250
|
+
};
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
catch (error) {
|
|
254
|
+
console.error('Supermachine getCharacters error:', error);
|
|
255
|
+
return [{
|
|
256
|
+
name: `⚠️ Error loading characters: ${error.message}`,
|
|
257
|
+
value: '',
|
|
258
|
+
description: 'Check your API key and network connection'
|
|
259
|
+
}];
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
},
|
|
263
|
+
};
|
|
264
|
+
async execute() {
|
|
265
|
+
const items = this.getInputData();
|
|
266
|
+
const returnData = [];
|
|
267
|
+
for (let i = 0; i < items.length; i++) {
|
|
268
|
+
try {
|
|
269
|
+
const resource = this.getNodeParameter('resource', i);
|
|
270
|
+
const operation = this.getNodeParameter('operation', i);
|
|
271
|
+
let requestOptions = {
|
|
272
|
+
method: 'GET',
|
|
273
|
+
url: '',
|
|
274
|
+
json: true,
|
|
275
|
+
};
|
|
276
|
+
// ══════════════════════════════════════════════════════
|
|
277
|
+
// ACCOUNT OPERATIONS
|
|
278
|
+
// ══════════════════════════════════════════════════════
|
|
279
|
+
if (resource === 'account') {
|
|
280
|
+
if (operation === 'getProfile') {
|
|
281
|
+
requestOptions.url = 'https://dev.supermachine.art/v1/user';
|
|
282
|
+
}
|
|
283
|
+
else if (operation === 'listModels') {
|
|
284
|
+
requestOptions.url = 'https://dev.supermachine.art/v1/models';
|
|
285
|
+
if (!this.getNodeParameter('returnAll', i, false)) {
|
|
286
|
+
requestOptions.qs = {
|
|
287
|
+
perPage: this.getNodeParameter('limit', i, 20),
|
|
288
|
+
page: 1,
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
else if (operation === 'getModelDetail') {
|
|
293
|
+
const modelTitle = this.getNodeParameter('modelId', i);
|
|
294
|
+
const modelsResponse = await this.helpers.requestWithAuthentication.call(this, 'supermachineApi', { method: 'GET', url: 'https://dev.supermachine.art/v1/models', json: true });
|
|
295
|
+
const models = modelsResponse.items;
|
|
296
|
+
const model = models.find((m) => m.title === modelTitle);
|
|
297
|
+
if (!model) {
|
|
298
|
+
throw new Error(`Model "${modelTitle}" not found`);
|
|
299
|
+
}
|
|
300
|
+
requestOptions.url = `https://dev.supermachine.art/v1/models/gems/id/${model.id}`;
|
|
301
|
+
}
|
|
302
|
+
else if (operation === 'listModelCategories') {
|
|
303
|
+
requestOptions.url = 'https://dev.supermachine.art/v1/models/categories';
|
|
304
|
+
}
|
|
305
|
+
else if (operation === 'listLoras') {
|
|
306
|
+
const modelTitle = this.getNodeParameter('modelId', i);
|
|
307
|
+
const modelsResponse = await this.helpers.requestWithAuthentication.call(this, 'supermachineApi', { method: 'GET', url: 'https://dev.supermachine.art/v1/models', json: true });
|
|
308
|
+
const models = modelsResponse.items;
|
|
309
|
+
const model = models.find((m) => m.title === modelTitle);
|
|
310
|
+
if (!model) {
|
|
311
|
+
throw new Error(`Model "${modelTitle}" not found`);
|
|
312
|
+
}
|
|
313
|
+
requestOptions.url = `https://dev.supermachine.art/v1/loras?modelId=${model.id}`;
|
|
314
|
+
}
|
|
315
|
+
else if (operation === 'listLoraCategories') {
|
|
316
|
+
requestOptions.url = 'https://dev.supermachine.art/v1/loras/categories';
|
|
317
|
+
}
|
|
318
|
+
else if (operation === 'listCharacterCategories') {
|
|
319
|
+
requestOptions.url = 'https://dev.supermachine.art/v1/characters/categories';
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
// ══════════════════════════════════════════════════════
|
|
323
|
+
// IMAGE OPERATIONS
|
|
324
|
+
// ══════════════════════════════════════════════════════
|
|
325
|
+
else if (resource === 'image') {
|
|
326
|
+
if (operation === 'generate') {
|
|
327
|
+
requestOptions.method = 'POST';
|
|
328
|
+
requestOptions.url = 'https://dev.supermachine.art/v1/generate';
|
|
329
|
+
const additionalFields = this.getNodeParameter('additionalFields', i, {});
|
|
330
|
+
const body = {
|
|
331
|
+
prompt: this.getNodeParameter('prompt', i),
|
|
332
|
+
model: this.getNodeParameter('model', i),
|
|
333
|
+
width: this.getNodeParameter('width', i, 1024),
|
|
334
|
+
height: this.getNodeParameter('height', i, 768),
|
|
335
|
+
};
|
|
336
|
+
if (additionalFields.negativePrompt) {
|
|
337
|
+
body.negativePrompt = additionalFields.negativePrompt;
|
|
338
|
+
}
|
|
339
|
+
if (additionalFields.numberResults) {
|
|
340
|
+
body.numberResults = additionalFields.numberResults;
|
|
341
|
+
}
|
|
342
|
+
if (additionalFields.outputFormat) {
|
|
343
|
+
body.outputFormat = additionalFields.outputFormat;
|
|
344
|
+
}
|
|
345
|
+
if (additionalFields.seed) {
|
|
346
|
+
body.seed = additionalFields.seed;
|
|
347
|
+
}
|
|
348
|
+
if (additionalFields.steps) {
|
|
349
|
+
body.steps = additionalFields.steps;
|
|
350
|
+
}
|
|
351
|
+
if (additionalFields.cfgScale) {
|
|
352
|
+
body.cfgScale = additionalFields.cfgScale;
|
|
353
|
+
}
|
|
354
|
+
if (additionalFields.callbackUrl) {
|
|
355
|
+
body.callbackUrl = additionalFields.callbackUrl;
|
|
356
|
+
}
|
|
357
|
+
if (additionalFields.loras) {
|
|
358
|
+
const lorasData = additionalFields.loras;
|
|
359
|
+
const loraValues = lorasData.loraValues;
|
|
360
|
+
if (Array.isArray(loraValues) && loraValues.length > 0) {
|
|
361
|
+
body.loras = loraValues.map((lora) => ({
|
|
362
|
+
id: lora.loraId,
|
|
363
|
+
strength: lora.strength || 1,
|
|
364
|
+
}));
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
if (additionalFields.characterId) {
|
|
368
|
+
body.characterId = additionalFields.characterId;
|
|
369
|
+
}
|
|
370
|
+
if (additionalFields.img2img) {
|
|
371
|
+
const img2imgData = additionalFields.img2img;
|
|
372
|
+
const img2imgValues = img2imgData.img2imgValues;
|
|
373
|
+
if (Array.isArray(img2imgValues) && img2imgValues.length > 0) {
|
|
374
|
+
const img2img = img2imgValues[0];
|
|
375
|
+
if (img2img.sourceImageUrl) {
|
|
376
|
+
body.sourceImageUrl = img2img.sourceImageUrl;
|
|
377
|
+
body.denoisingStrength = img2img.denoisingStrength || 0.75;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
requestOptions.body = body;
|
|
382
|
+
}
|
|
383
|
+
else if (operation === 'getStatus' || operation === 'listImages') {
|
|
384
|
+
const batchId = this.getNodeParameter('batchId', i);
|
|
385
|
+
requestOptions.url = `https://dev.supermachine.art/v1/images?batchId=${batchId}`;
|
|
386
|
+
if (operation === 'listImages' && !this.getNodeParameter('returnAll', i, false)) {
|
|
387
|
+
requestOptions.qs = {
|
|
388
|
+
limit: this.getNodeParameter('limit', i, 20),
|
|
389
|
+
page: this.getNodeParameter('page', i, 1),
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
// ══════════════════════════════════════════════════════
|
|
395
|
+
// TOOLS OPERATIONS
|
|
396
|
+
// ══════════════════════════════════════════════════════
|
|
397
|
+
else if (resource === 'tools') {
|
|
398
|
+
throw new Error('Tools operations chưa có endpoints chính thức từ Supermachine API docs. Vui lòng check documentation.');
|
|
399
|
+
}
|
|
400
|
+
const responseData = await this.helpers.requestWithAuthentication.call(this, 'supermachineApi', requestOptions);
|
|
401
|
+
let jsonData;
|
|
402
|
+
if (operation === 'listModels' || operation === 'listImages' || operation === 'listLoras') {
|
|
403
|
+
jsonData = responseData;
|
|
404
|
+
}
|
|
405
|
+
else {
|
|
406
|
+
jsonData = responseData.items || responseData;
|
|
407
|
+
}
|
|
408
|
+
returnData.push({ json: jsonData });
|
|
409
|
+
}
|
|
410
|
+
catch (error) {
|
|
411
|
+
if (this.continueOnFail()) {
|
|
412
|
+
returnData.push({
|
|
413
|
+
json: {
|
|
414
|
+
error: error.message,
|
|
415
|
+
stack: error.stack,
|
|
416
|
+
}
|
|
417
|
+
});
|
|
418
|
+
continue;
|
|
419
|
+
}
|
|
420
|
+
throw error;
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
return [returnData];
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
exports.Supermachine = Supermachine;
|
|
427
|
+
|
|
428
|
+
//# sourceMappingURL=Supermachine.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../nodes/Supermachine/Supermachine.node.ts"],"names":[],"mappings":";;;AAWA,iDAOwB;AAExB,MAAa,YAAY;IACvB,WAAW,GAAyB;QAClC,WAAW,EAAE,cAAc;QAC3B,IAAI,EAAE,cAAc;QACpB,IAAI,EAAE,uBAAuB;QAC7B,KAAK,EAAE,CAAC,WAAW,CAAC;QACpB,OAAO,EAAE,CAAC;QACV,QAAQ,EAAE,8DAA8D;QACxE,WAAW,EAAE,yCAAyC;QACtD,QAAQ,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE;QAClC,MAAM,EAAE,CAAC,MAAM,CAAC;QAChB,OAAO,EAAE,CAAC,MAAM,CAAC;QACjB,WAAW,EAAE,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QAC1D,UAAU,EAAE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