n8n-nodes-apexapi 0.1.5 → 0.1.7

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.
@@ -137,7 +137,16 @@ class ApexApi {
137
137
  placeholder: 'Add Option',
138
138
  displayOptions: { show: { resource: ['image'] } },
139
139
  default: {},
140
- options: [{ displayName: 'Number of Images', name: 'n', type: 'number', default: 1 }],
140
+ options: [
141
+ { displayName: 'Number of Images', name: 'n', type: 'number', default: 1 },
142
+ {
143
+ displayName: 'Reference Image URL',
144
+ name: 'imageUrl',
145
+ type: 'string',
146
+ default: '',
147
+ description: 'Source image for image-editing / img2img models (e.g. fal flux/edit, nano-banana/edit). Ignored by text-to-image models.',
148
+ },
149
+ ],
141
150
  },
142
151
  // ---- Video ----
143
152
  {
@@ -161,6 +170,44 @@ class ApexApi {
161
170
  default: '',
162
171
  required: true,
163
172
  },
173
+ {
174
+ displayName: 'Aspect Ratio',
175
+ name: 'videoAspectRatio',
176
+ type: 'options',
177
+ displayOptions: { show: { resource: ['video'], operation: ['generate'] } },
178
+ options: [
179
+ { name: 'Landscape 16:9', value: '16:9' },
180
+ { name: 'Portrait 9:16', value: '9:16' },
181
+ { name: 'Square 1:1', value: '1:1' },
182
+ { name: 'Landscape 4:3', value: '4:3' },
183
+ { name: 'Portrait 3:4', value: '3:4' },
184
+ { name: 'Cinematic 21:9', value: '21:9' },
185
+ ],
186
+ default: '16:9',
187
+ description: 'Output aspect ratio. The API validates support per model.',
188
+ },
189
+ {
190
+ displayName: 'Resolution',
191
+ name: 'videoResolution',
192
+ type: 'options',
193
+ displayOptions: { show: { resource: ['video'], operation: ['generate'] } },
194
+ options: [
195
+ { name: '480p', value: '480p' },
196
+ { name: '720p', value: '720p' },
197
+ { name: '1080p', value: '1080p' },
198
+ ],
199
+ default: '720p',
200
+ description: 'Output resolution. Higher resolutions depend on the model (e.g. Seedance Fast tops out at 720p) — the API returns a clear error if unsupported.',
201
+ },
202
+ {
203
+ displayName: 'Duration (Seconds)',
204
+ name: 'videoDuration',
205
+ type: 'number',
206
+ typeOptions: { minValue: 1, maxValue: 60 },
207
+ displayOptions: { show: { resource: ['video'], operation: ['generate'] } },
208
+ default: 5,
209
+ description: 'Clip length in seconds. Supported values depend on the model (commonly 5 or 10) — the API validates.',
210
+ },
164
211
  {
165
212
  displayName: 'Job ID',
166
213
  name: 'jobId',
@@ -178,6 +225,28 @@ class ApexApi {
178
225
  displayOptions: { show: { resource: ['video'], operation: ['generate'] } },
179
226
  default: {},
180
227
  options: [
228
+ {
229
+ displayName: 'Reference Image URL',
230
+ name: 'imageUrl',
231
+ type: 'string',
232
+ default: '',
233
+ description: 'Starting/reference image for image-to-video models (e.g. Seedance image-to-video).',
234
+ },
235
+ {
236
+ displayName: 'End Image URL',
237
+ name: 'endImageUrl',
238
+ type: 'string',
239
+ default: '',
240
+ description: 'Last-frame image (supported by fal Seedance end-frame models).',
241
+ },
242
+ {
243
+ displayName: 'Reference Video URL',
244
+ name: 'videoUrl',
245
+ type: 'string',
246
+ default: '',
247
+ description: 'Reference video for reference-to-video models.',
248
+ },
249
+ { displayName: 'Generate Audio', name: 'audio', type: 'boolean', default: false },
181
250
  { displayName: 'Wait for Completion', name: 'waitForCompletion', type: 'boolean', default: true },
182
251
  { displayName: 'Max Poll Seconds', name: 'maxPollSeconds', type: 'number', default: 300 },
183
252
  { displayName: 'Poll Interval Seconds', name: 'pollIntervalSeconds', type: 'number', default: 5 },
@@ -231,6 +300,7 @@ class ApexApi {
231
300
  prompt: this.getNodeParameter('prompt', i),
232
301
  size,
233
302
  n: options.n,
303
+ imageUrl: options.imageUrl || undefined,
234
304
  });
235
305
  const resp = await (0, transport_1.apexApiRequest)(ctx, 'POST', '/images/generations', body);
236
306
  const parsed = (0, image_1.parseImageResponse)(resp);
@@ -261,6 +331,13 @@ class ApexApi {
261
331
  const body = (0, video_1.buildVideoBody)({
262
332
  model: this.getNodeParameter('model', i),
263
333
  prompt: this.getNodeParameter('prompt', i),
334
+ aspectRatio: this.getNodeParameter('videoAspectRatio', i, ''),
335
+ resolution: this.getNodeParameter('videoResolution', i, ''),
336
+ duration: this.getNodeParameter('videoDuration', i, 5),
337
+ audio: options.audio,
338
+ imageUrl: options.imageUrl || undefined,
339
+ endImageUrl: options.endImageUrl || undefined,
340
+ videoUrl: options.videoUrl || undefined,
264
341
  });
265
342
  json = (await (0, transport_1.generateVideo)(ctx, body, {
266
343
  waitForCompletion: options.waitForCompletion ?? true,
@@ -8,6 +8,8 @@ function buildImageBody(params) {
8
8
  body.size = params.size;
9
9
  if (params.n !== undefined)
10
10
  body.n = params.n;
11
+ if (params.imageUrl)
12
+ body.image_url = params.imageUrl;
11
13
  return body;
12
14
  }
13
15
  const DATA_URL_RE = /^data:([^;,]+);base64,(.+)$/;
@@ -3,7 +3,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.buildVideoBody = buildVideoBody;
4
4
  exports.isTerminalVideoStatus = isTerminalVideoStatus;
5
5
  function buildVideoBody(params) {
6
- return { model: params.model, prompt: params.prompt };
6
+ const body = { model: params.model, prompt: params.prompt };
7
+ if (params.aspectRatio)
8
+ body.aspect_ratio = params.aspectRatio;
9
+ if (params.resolution)
10
+ body.resolution = params.resolution;
11
+ if (params.duration !== undefined)
12
+ body.duration = params.duration;
13
+ if (params.audio !== undefined)
14
+ body.audio = params.audio;
15
+ if (params.imageUrl)
16
+ body.image_url = params.imageUrl;
17
+ if (params.endImageUrl)
18
+ body.end_image_url = params.endImageUrl;
19
+ if (params.videoUrl)
20
+ body.video_url = params.videoUrl;
21
+ return body;
7
22
  }
8
23
  const TERMINAL_STATUSES = new Set(['completed', 'failed']);
9
24
  function isTerminalVideoStatus(status) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-apexapi",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "n8n community node for ApexApi — call 14 AI providers (OpenAI, Anthropic, Google, Mistral, and more) through one OpenAI-compatible API.",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",