n8n-nodes-supermachine 1.2.0 → 1.2.2

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.
@@ -594,24 +594,23 @@ class Supermachine {
594
594
  folderIdNumber = folderIdValue;
595
595
  }
596
596
  }
597
- // AUTO-FILL WIDTH/HEIGHT FROM IMAGE RATIO PRESET
598
- const imageRatioV3 = this.getNodeParameter('imageRatioV3', i, '9:16');
599
- const sizePresetV3 = this.getNodeParameter('sizePresetV3', i, '');
597
+ // AUTO-FILL WIDTH/HEIGHT FROM IMAGE SIZE DROPDOWN
598
+ const imageSizeV3 = this.getNodeParameter('imageSizeV3', i, '576x1024');
600
599
  let width = 576;
601
600
  let height = 1024;
602
- if (imageRatioV3 !== 'Custom' && sizePresetV3) {
603
- // Parse preset like "576x1024"
604
- const [w, h] = sizePresetV3.split('x').map(Number);
601
+ if (imageSizeV3 === 'custom') {
602
+ // Use custom width/height fields
603
+ width = this.getNodeParameter('widthV3', i, 576);
604
+ height = this.getNodeParameter('heightV3', i, 1024);
605
+ }
606
+ else {
607
+ // Parse size directly from dropdown value (e.g. '1024x768')
608
+ const [w, h] = imageSizeV3.split('x').map(Number);
605
609
  if (w && h) {
606
610
  width = w;
607
611
  height = h;
608
612
  }
609
613
  }
610
- else if (imageRatioV3 === 'Custom') {
611
- // Use custom width/height
612
- width = this.getNodeParameter('widthV3', i, 576);
613
- height = this.getNodeParameter('heightV3', i, 1024);
614
- }
615
614
  // END AUTO-FILL
616
615
  const body = {
617
616
  prompt: this.getNodeParameter('promptV3', i),
@@ -715,7 +714,7 @@ class Supermachine {
715
714
  await new Promise((resolve) => setTimeout(resolve, pollingInterval * 1000));
716
715
  continue;
717
716
  }
718
- const pollItems = pollResponse.items;
717
+ const pollItems = pollResponse.items.filter((item) => item.batchId === batchID);
719
718
  if (Array.isArray(pollItems) && pollItems.length > 0) {
720
719
  const firstItem = pollItems[0];
721
720
  const status = firstItem.status;
@@ -750,24 +749,23 @@ class Supermachine {
750
749
  prompt = `${prompt} a photo of ${characterEmbedCode}`.trim();
751
750
  }
752
751
  }
753
- // AUTO-FILL WIDTH/HEIGHT FROM IMAGE RATIO PRESET
754
- const imageRatio = this.getNodeParameter('imageRatio', i, '1:1');
755
- const sizePreset = this.getNodeParameter('sizePreset', i, '');
752
+ // AUTO-FILL WIDTH/HEIGHT FROM IMAGE SIZE DROPDOWN
753
+ const imageSize = this.getNodeParameter('imageSize', i, '1024x1024');
756
754
  let width = 1024;
757
- let height = 768;
758
- if (imageRatio !== 'Custom' && sizePreset) {
759
- // Parse preset like "1024x768"
760
- const [w, h] = sizePreset.split('x').map(Number);
755
+ let height = 1024;
756
+ if (imageSize === 'custom') {
757
+ // Use custom width/height fields
758
+ width = this.getNodeParameter('width', i, 1024);
759
+ height = this.getNodeParameter('height', i, 768);
760
+ }
761
+ else {
762
+ // Parse size directly from dropdown value (e.g. '1024x768')
763
+ const [w, h] = imageSize.split('x').map(Number);
761
764
  if (w && h) {
762
765
  width = w;
763
766
  height = h;
764
767
  }
765
768
  }
766
- else if (imageRatio === 'Custom') {
767
- // Use custom width/height
768
- width = this.getNodeParameter('width', i, 1024);
769
- height = this.getNodeParameter('height', i, 768);
770
- }
771
769
  // END AUTO-FILL
772
770
  const body = {
773
771
  prompt: prompt,
@@ -1066,7 +1064,7 @@ class Supermachine {
1066
1064
  await new Promise((resolve) => setTimeout(resolve, pollingInterval * 1000));
1067
1065
  continue;
1068
1066
  }
1069
- const pollItems = pollResponse.items;
1067
+ const pollItems = pollResponse.items.filter((item) => item.batchId === batchId);
1070
1068
  if (Array.isArray(pollItems) && pollItems.length > 0) {
1071
1069
  const firstItem = pollItems[0];
1072
1070
  const status = firstItem.status;
@@ -1383,7 +1381,7 @@ class Supermachine {
1383
1381
  await new Promise((resolve) => setTimeout(resolve, pollingInterval * 1000));
1384
1382
  continue;
1385
1383
  }
1386
- const pollItems = pollResponse.items;
1384
+ const pollItems = pollResponse.items.filter((item) => item.batchId === batchId);
1387
1385
  if (Array.isArray(pollItems) && pollItems.length > 0) {
1388
1386
  const firstItem = pollItems[0];
1389
1387
  const status = firstItem.status;
@@ -1524,7 +1522,7 @@ class Supermachine {
1524
1522
  await new Promise((resolve) => setTimeout(resolve, pollingInterval * 1000));
1525
1523
  continue;
1526
1524
  }
1527
- const pollItems = pollResponse.items;
1525
+ const pollItems = pollResponse.items.filter((item) => item.batchId === batchId);
1528
1526
  if (Array.isArray(pollItems) && pollItems.length > 0) {
1529
1527
  const firstItem = pollItems[0];
1530
1528
  const status = firstItem.status;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-supermachine",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "n8n community node for Supermachine AI Image API — Generate images, manage models, LoRAs, and characters",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",