n8n-nodes-supermachine 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.
|
@@ -242,11 +242,10 @@ class Supermachine {
|
|
|
242
242
|
}
|
|
243
243
|
return items.map((character) => {
|
|
244
244
|
const embedCode = character.embedCode;
|
|
245
|
-
const embedHint = embedCode ? ` | Use: "${embedCode}"` : '';
|
|
246
245
|
return {
|
|
247
246
|
name: character.name,
|
|
248
|
-
value: String(character.id),
|
|
249
|
-
description:
|
|
247
|
+
value: embedCode || String(character.id),
|
|
248
|
+
description: embedCode ? `Embed: "${embedCode}" (will auto-add as "a photo of ${embedCode}")` : character.slug,
|
|
250
249
|
};
|
|
251
250
|
});
|
|
252
251
|
}
|
|
@@ -334,8 +333,18 @@ class Supermachine {
|
|
|
334
333
|
else if (resource === 'image') {
|
|
335
334
|
if (operation === 'generate') {
|
|
336
335
|
const additionalFields = this.getNodeParameter('additionalFields', i, {});
|
|
336
|
+
// Get base prompt
|
|
337
|
+
let prompt = this.getNodeParameter('prompt', i);
|
|
338
|
+
// ✅ TỰ ĐỘNG THÊM CHARACTER EMBED CODE VÀO PROMPT
|
|
339
|
+
if (additionalFields.characterId) {
|
|
340
|
+
const characterEmbedCode = additionalFields.characterId;
|
|
341
|
+
if (characterEmbedCode) {
|
|
342
|
+
// Nối vào cuối prompt với format "a photo of <embedCode>"
|
|
343
|
+
prompt = `${prompt} a photo of ${characterEmbedCode}`.trim();
|
|
344
|
+
}
|
|
345
|
+
}
|
|
337
346
|
const body = {
|
|
338
|
-
prompt:
|
|
347
|
+
prompt: prompt,
|
|
339
348
|
model: this.getNodeParameter('model', i),
|
|
340
349
|
width: this.getNodeParameter('width', i, 1024),
|
|
341
350
|
height: this.getNodeParameter('height', i, 768),
|
|
@@ -368,9 +377,6 @@ class Supermachine {
|
|
|
368
377
|
}));
|
|
369
378
|
}
|
|
370
379
|
}
|
|
371
|
-
if (additionalFields.characterId) {
|
|
372
|
-
body.characterId = additionalFields.characterId;
|
|
373
|
-
}
|
|
374
380
|
if (additionalFields.img2img) {
|
|
375
381
|
const img2imgData = additionalFields.img2img;
|
|
376
382
|
const img2imgValues = img2imgData.img2imgValues;
|
|
@@ -422,6 +428,7 @@ class Supermachine {
|
|
|
422
428
|
returnData.push({
|
|
423
429
|
json: {
|
|
424
430
|
batchId,
|
|
431
|
+
finalPrompt: prompt,
|
|
425
432
|
...completedImage,
|
|
426
433
|
}
|
|
427
434
|
});
|
|
@@ -253,7 +253,7 @@ exports.getImageFields = [
|
|
|
253
253
|
},
|
|
254
254
|
},
|
|
255
255
|
default: '',
|
|
256
|
-
description: 'Chọn character. ⚠️ Phải chọn Model và Category trước! Embed code sẽ
|
|
256
|
+
description: 'Chọn character. ⚠️ Phải chọn Model và Category trước! Embed code (vd: h4kum1) sẽ tự động nối vào cuối prompt dưới dạng "a photo of <embedCode>". Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
|
257
257
|
},
|
|
258
258
|
{
|
|
259
259
|
displayName: 'Image to Image',
|
package/package.json
CHANGED