@flatkey-ai/cli 0.2.5 → 0.2.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/api.js +10 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flatkey-ai/cli",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "description": "Flatkey media generation CLI for image, video, audio, credits, status, and models.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/api.js CHANGED
@@ -82,14 +82,16 @@ export function planVideoRequest(options) {
82
82
  "ratio",
83
83
  );
84
84
  const resolution = validateOptionalValue(
85
- options.resolution,
86
- ["480p", "720p", "1080p"],
85
+ options.resolution ?? (isMiniMaxModel(model) ? "768P" : undefined),
86
+ isMiniMaxModel(model) ? ["768P", "2K"] : ["480p", "720p", "1080p"],
87
87
  "resolution",
88
88
  );
89
89
  const basePayload = cleanObject({
90
90
  model,
91
91
  prompt: options.prompt,
92
- duration: parseOptionalInteger(options.duration),
92
+ duration: options.duration === undefined && isMiniMaxModel(model)
93
+ ? 5
94
+ : parseOptionalInteger(options.duration),
93
95
  aspect: ratio,
94
96
  ratio,
95
97
  resolution,
@@ -99,7 +101,7 @@ export function planVideoRequest(options) {
99
101
  images: !isSeedanceModel(model) && imageUrls.length > 0 ? imageUrls : undefined,
100
102
  });
101
103
  const seedanceContent = buildSeedanceContent(options);
102
- if (isSeedanceModel(model) && seedanceContent.length > 0) {
104
+ if ((isSeedanceModel(model) || isMiniMaxModel(model)) && seedanceContent.length > 0) {
103
105
  return planJsonPost(options, "/v1/video/generations", cleanObject({
104
106
  ...basePayload,
105
107
  content: seedanceContent,
@@ -378,6 +380,10 @@ function isSeedanceModel(model) {
378
380
  return /seedance/i.test(model);
379
381
  }
380
382
 
383
+ function isMiniMaxModel(model) {
384
+ return /^minimax-h3$/i.test(model);
385
+ }
386
+
381
387
  function buildSeedanceContent(options) {
382
388
  const content = [];
383
389
  if (options.prompt !== undefined) {