n8n-nodes-supermachine 1.1.5 → 1.2.1

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),
@@ -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,
@@ -74,10 +74,10 @@ exports.getImageFields = [
74
74
  description: 'Model AI dùng để generate ảnh. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
75
75
  required: true,
76
76
  },
77
- // Image Ratio for Generate v1
77
+ // Image Size (merged)
78
78
  {
79
- displayName: 'Image Ratio',
80
- name: 'imageRatio',
79
+ displayName: 'Image Size',
80
+ name: 'imageSize',
81
81
  type: 'options',
82
82
  displayOptions: {
83
83
  show: {
@@ -86,32 +86,20 @@ exports.getImageFields = [
86
86
  },
87
87
  },
88
88
  options: [
89
- { name: '1:1 (Square)', value: '1:1' },
90
- { name: '3:4 (Portrait)', value: '3:4' },
91
- { name: '9:16 (Vertical)', value: '9:16' },
92
- { name: '4:3 (Landscape)', value: '4:3' },
93
- { name: '16:9 (Widescreen)', value: '16:9' },
94
- { name: 'Custom', value: 'Custom' },
89
+ { name: '1024×1024 (1:1 Square)', value: '1024x1024' },
90
+ { name: '1280×1280 (1:1 Square)', value: '1280x1280' },
91
+ { name: '768×1024 (3:4 Portrait)', value: '768x1024' },
92
+ { name: '884×1184 (3:4 Portrait)', value: '884x1184' },
93
+ { name: '576×1024 (9:16 Vertical)', value: '576x1024' },
94
+ { name: '720×1280 (9:16 Vertical)', value: '720x1280' },
95
+ { name: '1024×768 (4:3 Landscape)', value: '1024x768' },
96
+ { name: '1184×884 (4:3 Landscape)', value: '1184x884' },
97
+ { name: '1024×576 (16:9 Widescreen)', value: '1024x576' },
98
+ { name: '1280×720 (16:9 Widescreen)', value: '1280x720' },
99
+ { name: 'Custom', value: 'custom' },
95
100
  ],
96
- default: '1:1',
97
- description: 'Aspect ratio preset. Select Custom to manually set width/height.',
98
- },
99
- {
100
- displayName: 'Size Preset',
101
- name: 'sizePreset',
102
- type: 'options',
103
- displayOptions: {
104
- show: {
105
- resource: ['image'],
106
- operation: ['generate'],
107
- imageRatio: ['1:1', '3:4', '9:16', '4:3', '16:9'],
108
- },
109
- },
110
- typeOptions: {
111
- loadOptionsMethod: 'getSizePresets',
112
- },
113
- default: '',
114
- description: 'Pre-defined sizes for selected ratio. Width and height will auto-fill.',
101
+ default: '1024x1024',
102
+ description: 'Select image dimensions',
115
103
  },
116
104
  {
117
105
  displayName: 'Prompt',
@@ -143,7 +131,7 @@ exports.getImageFields = [
143
131
  show: {
144
132
  resource: ['image'],
145
133
  operation: ['generate'],
146
- imageRatio: ['Custom'],
134
+ imageSize: ['custom'],
147
135
  },
148
136
  },
149
137
  default: 1024,
@@ -161,7 +149,7 @@ exports.getImageFields = [
161
149
  show: {
162
150
  resource: ['image'],
163
151
  operation: ['generate'],
164
- imageRatio: ['Custom'],
152
+ imageSize: ['custom'],
165
153
  },
166
154
  },
167
155
  default: 768,
@@ -470,10 +458,10 @@ exports.getImageFields = [
470
458
  required: true,
471
459
  description: 'AI model to use for image generation',
472
460
  },
473
- // Image Ratio for Generate v3
461
+ // Image Size v3 (merged)
474
462
  {
475
- displayName: 'Image Ratio',
476
- name: 'imageRatioV3',
463
+ displayName: 'Image Size',
464
+ name: 'imageSizeV3',
477
465
  type: 'options',
478
466
  displayOptions: {
479
467
  show: {
@@ -482,32 +470,20 @@ exports.getImageFields = [
482
470
  },
483
471
  },
484
472
  options: [
485
- { name: '1:1 (Square)', value: '1:1' },
486
- { name: '3:4 (Portrait)', value: '3:4' },
487
- { name: '9:16 (Vertical)', value: '9:16' },
488
- { name: '4:3 (Landscape)', value: '4:3' },
489
- { name: '16:9 (Widescreen)', value: '16:9' },
490
- { name: 'Custom', value: 'Custom' },
473
+ { name: '1024×1024 (1:1 Square)', value: '1024x1024' },
474
+ { name: '1280×1280 (1:1 Square)', value: '1280x1280' },
475
+ { name: '768×1024 (3:4 Portrait)', value: '768x1024' },
476
+ { name: '884×1184 (3:4 Portrait)', value: '884x1184' },
477
+ { name: '576×1024 (9:16 Vertical)', value: '576x1024' },
478
+ { name: '720×1280 (9:16 Vertical)', value: '720x1280' },
479
+ { name: '1024×768 (4:3 Landscape)', value: '1024x768' },
480
+ { name: '1184×884 (4:3 Landscape)', value: '1184x884' },
481
+ { name: '1024×576 (16:9 Widescreen)', value: '1024x576' },
482
+ { name: '1280×720 (16:9 Widescreen)', value: '1280x720' },
483
+ { name: 'Custom', value: 'custom' },
491
484
  ],
492
- default: '9:16',
493
- description: 'Aspect ratio preset. Select Custom to manually set width/height.',
494
- },
495
- {
496
- displayName: 'Size Preset',
497
- name: 'sizePresetV3',
498
- type: 'options',
499
- displayOptions: {
500
- show: {
501
- resource: ['image'],
502
- operation: ['generateV3'],
503
- imageRatioV3: ['1:1', '3:4', '9:16', '4:3', '16:9'],
504
- },
505
- },
506
- typeOptions: {
507
- loadOptionsMethod: 'getSizePresetsV3',
508
- },
509
- default: '',
510
- description: 'Pre-defined sizes for selected ratio. Width and height will auto-fill.',
485
+ default: '576x1024',
486
+ description: 'Select image dimensions',
511
487
  },
512
488
  {
513
489
  displayName: 'Prompt',
@@ -539,7 +515,7 @@ exports.getImageFields = [
539
515
  show: {
540
516
  resource: ['image'],
541
517
  operation: ['generateV3'],
542
- imageRatioV3: ['Custom'],
518
+ imageSizeV3: ['custom'],
543
519
  },
544
520
  },
545
521
  default: 576,
@@ -557,7 +533,7 @@ exports.getImageFields = [
557
533
  show: {
558
534
  resource: ['image'],
559
535
  operation: ['generateV3'],
560
- imageRatioV3: ['Custom'],
536
+ imageSizeV3: ['custom'],
561
537
  },
562
538
  },
563
539
  default: 1024,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-supermachine",
3
- "version": "1.1.5",
3
+ "version": "1.2.1",
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",