@meshy-ai/cli 0.3.0 → 0.3.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.
package/README.md CHANGED
@@ -347,7 +347,8 @@ status report instead of JSON. Single-file outputs get a per-file
347
347
  task that is not yet SUCCEEDED yields `downloads.state: "not_ready"` with exit 0.
348
348
 
349
349
  ```bash
350
- meshy-cli text-to-image create --ai-model nano-banana --prompt "a leaf" -o assets/leaf.jpeg
350
+ meshy-cli text-to-image create --ai-model nano-banana-2-lite --prompt "a leaf" -o assets/leaf.jpeg
351
+ meshy-cli text-to-image create --ai-model gpt-image-2-5-sunburst --aspect-ratio 3:2 --prompt "a leaf" -o assets/leaf-wide.png
351
352
  meshy-cli image-to-3d wait <id> -o out/robot/
352
353
  ```
353
354
 
@@ -1,15 +1,22 @@
1
1
  /**
2
2
  * Shared model/aspect-ratio table for the 2D image commands, so text-to-image
3
3
  * and image-to-image can't drift apart as Meshy ships new models.
4
+ *
5
+ * The ratio rules mirror the server's own per-model check
6
+ * (meshyd pkg/server/api_image_generation_handlers.go): every GPT Image model
7
+ * accepts all seven ratios; the nano-banana family rejects 3:2 and 2:3.
4
8
  */
5
- export declare const IMAGE_MODELS: readonly ["gpt-image-2", "nano-banana-pro", "nano-banana-2", "nano-banana-2-lite", "nano-banana"];
9
+ export declare const IMAGE_MODELS: readonly ["gpt-image-2", "gpt-image-2-5-flare", "gpt-image-2-5-sunburst", "nano-banana-pro", "nano-banana-2", "nano-banana-2-lite"];
6
10
  export declare const DEFAULT_IMAGE_MODEL = "gpt-image-2";
11
+ /** OpenAI GPT Image models of any generation — the ones that take every aspect ratio. */
12
+ export declare const GPT_IMAGE_MODELS: readonly ["gpt-image-2", "gpt-image-2-5-flare", "gpt-image-2-5-sunburst"];
7
13
  export declare const IMAGE_MODEL_HELP: string;
8
14
  export declare const ASPECT_RATIOS: readonly ["1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3"];
9
15
  export declare const ASPECT_RATIO_HELP: string;
16
+ export declare function isGptImageModel(model: string): boolean;
10
17
  /**
11
18
  * Cross-validate model × aspect-ratio × multi-view before any credits are
12
- * spent; the API's own 400 is less specific. When the model is unknown at
19
+ * spent, with a message that names the fix. When the model is unknown at
13
20
  * parse time (driven via --data), the ratio check is left to the server.
14
21
  */
15
22
  export declare function checkImageCombo(opts: {
@@ -1 +1 @@
1
- {"version":3,"file":"image-models.d.ts","sourceRoot":"","sources":["../../src/internal/image-models.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,eAAO,MAAM,YAAY,YACvB,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,oBAAoB,EACpB,aAAa,CACL,CAAC;AAEX,eAAO,MAAM,mBAAmB,gBAAgB,CAAC;AAEjD,eAAO,MAAM,gBAAgB,QAEoC,CAAC;AAElE,eAAO,MAAM,aAAa,YAAI,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAU,CAAC;AAE1F,eAAO,MAAM,iBAAiB,QAGmB,CAAC;AAKlD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,GAAG,IAAI,CAcP"}
1
+ {"version":3,"file":"image-models.d.ts","sourceRoot":"","sources":["../../src/internal/image-models.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,eAAO,MAAM,YAAY,YACvB,aAAa,EACb,qBAAqB,EACrB,wBAAwB,EACxB,iBAAiB,EACjB,eAAe,EACf,oBAAoB,CACZ,CAAC;AAEX,eAAO,MAAM,mBAAmB,gBAAgB,CAAC;AAEjD,yFAAyF;AACzF,eAAO,MAAM,gBAAgB,YAAI,aAAa,EAAE,qBAAqB,EAAE,wBAAwB,CAAU,CAAC;AAE1G,eAAO,MAAM,gBAAgB,QAG6B,CAAC;AAE3D,eAAO,MAAM,aAAa,YAAI,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAU,CAAC;AAE1F,eAAO,MAAM,iBAAiB,QAGmB,CAAC;AAKlD,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,GAAG,IAAI,CAcP"}
@@ -1,27 +1,38 @@
1
1
  /**
2
2
  * Shared model/aspect-ratio table for the 2D image commands, so text-to-image
3
3
  * and image-to-image can't drift apart as Meshy ships new models.
4
+ *
5
+ * The ratio rules mirror the server's own per-model check
6
+ * (meshyd pkg/server/api_image_generation_handlers.go): every GPT Image model
7
+ * accepts all seven ratios; the nano-banana family rejects 3:2 and 2:3.
4
8
  */
5
9
  import { UsageError } from "./errors.js";
6
10
  export const IMAGE_MODELS = [
7
11
  "gpt-image-2",
12
+ "gpt-image-2-5-flare",
13
+ "gpt-image-2-5-sunburst",
8
14
  "nano-banana-pro",
9
15
  "nano-banana-2",
10
16
  "nano-banana-2-lite",
11
- "nano-banana",
12
17
  ];
13
18
  export const DEFAULT_IMAGE_MODEL = "gpt-image-2";
14
- export const IMAGE_MODEL_HELP = "gpt-image-2 (default, best; ratios 1:1|16:9|9:16|3:2|2:3) | nano-banana-pro | nano-banana-2 | " +
15
- "nano-banana-2-lite (fastest, cheapest) | nano-banana (legacy)";
19
+ /** OpenAI GPT Image models of any generation — the ones that take every aspect ratio. */
20
+ export const GPT_IMAGE_MODELS = ["gpt-image-2", "gpt-image-2-5-flare", "gpt-image-2-5-sunburst"];
21
+ export const IMAGE_MODEL_HELP = "gpt-image-2 (default) | gpt-image-2-5-flare (GPT Image 2.5, fast tier) | " +
22
+ "gpt-image-2-5-sunburst (GPT Image 2.5, precision-edit tier) | nano-banana-pro | " +
23
+ "nano-banana-2 | nano-banana-2-lite (fastest, cheapest)";
16
24
  export const ASPECT_RATIOS = ["1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3"];
17
- export const ASPECT_RATIO_HELP = "default: 1:1. nano-banana*: 1:1|16:9|9:16|4:3|3:4. " +
18
- "gpt-image-2: 1:1|16:9|9:16|3:2|2:3. " +
25
+ export const ASPECT_RATIO_HELP = "default: 1:1. gpt-image-*: 1:1|16:9|9:16|4:3|3:4|3:2|2:3. " +
26
+ "nano-banana*: 1:1|16:9|9:16|4:3|3:4. " +
19
27
  "Mutually exclusive with --generate-multi-view";
20
- const GPT_IMAGE_2_RATIOS = new Set(["1:1", "16:9", "9:16", "3:2", "2:3"]);
28
+ const GPT_IMAGE_MODEL_SET = new Set(GPT_IMAGE_MODELS);
21
29
  const NANO_BANANA_RATIOS = new Set(["1:1", "16:9", "9:16", "4:3", "3:4"]);
30
+ export function isGptImageModel(model) {
31
+ return GPT_IMAGE_MODEL_SET.has(model);
32
+ }
22
33
  /**
23
34
  * Cross-validate model × aspect-ratio × multi-view before any credits are
24
- * spent; the API's own 400 is less specific. When the model is unknown at
35
+ * spent, with a message that names the fix. When the model is unknown at
25
36
  * parse time (driven via --data), the ratio check is left to the server.
26
37
  */
27
38
  export function checkImageCombo(opts) {
@@ -31,11 +42,12 @@ export function checkImageCombo(opts) {
31
42
  const ratio = opts.aspectRatio;
32
43
  if (!ratio || !opts.aiModel)
33
44
  return;
34
- const supported = opts.aiModel === "gpt-image-2" ? GPT_IMAGE_2_RATIOS : NANO_BANANA_RATIOS;
35
- if (!supported.has(ratio)) {
36
- throw new UsageError(opts.aiModel === "gpt-image-2"
37
- ? `--aspect-ratio ${ratio} is not supported by gpt-image-2 (use 1:1, 16:9, 9:16, 3:2, or 2:3)`
38
- : `--aspect-ratio ${ratio} is only supported by gpt-image-2`);
45
+ // GPT Image models (2 and 2.5) accept every ratio the flag offers; only the
46
+ // nano-banana family is narrower.
47
+ if (isGptImageModel(opts.aiModel))
48
+ return;
49
+ if (!NANO_BANANA_RATIOS.has(ratio)) {
50
+ throw new UsageError(`--aspect-ratio ${ratio} is only supported by the GPT Image models (${GPT_IMAGE_MODELS.join(", ")})`);
39
51
  }
40
52
  }
41
53
  //# sourceMappingURL=image-models.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"image-models.js","sourceRoot":"","sources":["../../src/internal/image-models.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,aAAa;IACb,iBAAiB;IACjB,eAAe;IACf,oBAAoB;IACpB,aAAa;CACL,CAAC;AAEX,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAa,CAAC;AAEjD,MAAM,CAAC,MAAM,gBAAgB,GAC3B,gGAAgG;IAChG,+DAA+D,CAAC;AAElE,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAU,CAAC;AAE1F,MAAM,CAAC,MAAM,iBAAiB,GAC5B,qDAAqD;IACrD,sCAAsC;IACtC,+CAA+C,CAAC;AAElD,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;AAC1E,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;AAE1E;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,IAI/B;IACC,IAAI,IAAI,CAAC,iBAAiB,KAAK,IAAI,IAAI,IAAI,CAAC,WAAW,EAA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C5B,4DAA4D;IAC5D,uCAAuC;IACvC,+CAA+C,CAAC;AAElD,MAAM,mBAAmB,GAAwB,IAAI,GAAG,CAAC,gBAAgB,CAAC,CAAC;AAC3E,MAAM,kBAAkB,GAAwB,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;AAE/F,MAAM,UAAU,eAAe,CAAC,KAAa;IAC3C,OAAO,mBAAmB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACxC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,IAI/B;IACC,IAAI,IAAI,CAAC,iBAAiB,KAAK,IAAI,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;QACxD,MAAM,IAAI,UAAU,CAAC,sEAAsE,CAAC,CAAC;IAC/F,CAAC;IACD,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC;IAC/B,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,OAAO;QAAE,OAAO;IACpC,4EAA4E;IAC5E,kCAAkC;IAClC,IAAI,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC;QAAE,OAAO;IAC1C,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;QACnC,MAAM,IAAI,UAAU,CAClB,kBAAkB,KAAK,+CAA+C,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CACrG,CAAC;IACJ,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meshy-ai/cli",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Official command-line interface for the Meshy AI API — text-to-3D, image-to-3D, text-to-motion, remesh, UV unwrap, rigging, animate, retexture, 2D images, multi-color print, Creative Lab, balance — plus selective downloads, project folders, face checks, OBJ print preparation and slicer launch.",
5
5
  "license": "MIT",
6
6
  "type": "module",