@meshy-ai/cli 0.4.2 → 0.4.4
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/dist/cmd/analyze-printability.js +1 -1
- package/dist/cmd/analyze-printability.js.map +1 -1
- package/dist/cmd/image-to-3d.d.ts +4 -4
- package/dist/cmd/image-to-3d.d.ts.map +1 -1
- package/dist/cmd/image-to-3d.js +17 -14
- package/dist/cmd/image-to-3d.js.map +1 -1
- package/dist/cmd/multi-image-to-3d.d.ts +2 -2
- package/dist/cmd/multi-image-to-3d.js +2 -2
- package/dist/cmd/repair-printability.js +1 -1
- package/dist/cmd/repair-printability.js.map +1 -1
- package/dist/cmd/text-to-3d.d.ts +3 -3
- package/dist/cmd/text-to-3d.d.ts.map +1 -1
- package/dist/cmd/text-to-3d.js +13 -13
- package/dist/cmd/text-to-3d.js.map +1 -1
- package/dist/internal/smart-topology.d.ts +13 -0
- package/dist/internal/smart-topology.d.ts.map +1 -0
- package/dist/internal/smart-topology.js +40 -0
- package/dist/internal/smart-topology.js.map +1 -0
- package/package.json +1 -1
- package/skills/meshy-cli/SKILL.md +3 -2
|
@@ -47,7 +47,7 @@ const spec = {
|
|
|
47
47
|
configure(cmd) {
|
|
48
48
|
cmd
|
|
49
49
|
.option("--input-task-id <id>", "source SUCCEEDED task: image-to-3d, multi-image-to-3d, text-to-3d, remesh or retexture (Meshy 6 or newer), or repair-printability")
|
|
50
|
-
.option("--model-url <src>", "3D model: an http(s) URL (.glb/.gltf/.obj/.fbx/.stl, max
|
|
50
|
+
.option("--model-url <src>", "3D model: an http(s) URL (.glb/.gltf/.obj/.fbx/.stl, max 400MB) or a local .glb/.gltf file (max 100MB) — the API takes inline uploads as glTF only, so host .stl/.obj/.fbx at a URL");
|
|
51
51
|
return printSizeOptions(cmd, "check");
|
|
52
52
|
},
|
|
53
53
|
toPayload(opts) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyze-printability.js","sour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AI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,IAAI;YAAE,MAAM,IAAI,UAAU,CAAC,GAAG,CAAC,2CAA2C,CAAC,CAAC;IACxH,CAAC;AACH,CAAC;AAED,MAAM,IAAI,GAAwB;IAChC,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EACT,wEAAwE;QACxE,mFAAmF;QACnF,wFAAwF;QACxF,2DAA2D;IAC7D,MAAM,EAAE;QACN,WAAW,EAAE,qCAAqC;QAClD,SAAS,CAAC,GAAG;YACX,GAAG;iBACA,MAAM,CACL,sBAAsB,EACtB,mIAAmI,CACpI;iBACA,MAAM,CACL,mBAAmB,EACnB,
|
|
1
|
+
{"version":3,"file":"analyze-printability.js","sourceRoot":"","sources":["../../src/cmd/analyze-printability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,MAAM,EAAgB,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAA4B,MAAM,6BAA6B,CAAC;AAE7F,8EAA8E;AAC9E,MAAM,UAAU,gBAAgB,CAAC,GAAY,EAAE,IAAY;IACzD,OAAO,GAAG;SACP,SAAS,CACR,IAAI,MAAM,CACR,uBAAuB,EACvB,GAAG,IAAI,yHAAyH,CACjI,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC,CACxC;SACA,MAAM,CAAC,iCAAiC,EAAE,mGAAmG,EAAE,WAAW,CAAC;SAC3J,MAAM,CAAC,uCAAuC,EAAE,oDAAoD,EAAE,WAAW,CAAC,CAAC;AACxH,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,IAA6B;IAC5D,OAAO;QACL,YAAY,EAAE,IAAI,CAAC,WAAW;QAC9B,wBAAwB,EAAE,IAAI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AAI,CAAC,WAAW;gBAC/B,SAAS,EAAE,IAAI,CAAC,QAAQ;gBACxB,GAAG,gBAAgB,CAAC,IAAI,CAAC;aAC1B,CAAC;QACJ,CAAC;QACD,eAAe,EAAE,iBAAiB;KACnC;IACD,UAAU,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,mBAAmB;CACzC,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* image-to-3d — https://docs.meshy.ai/en/api/image-to-3d
|
|
3
3
|
*
|
|
4
|
-
* The mode
|
|
4
|
+
* The mode picks the model:
|
|
5
5
|
* - standard → meshy-7.1 (server default "latest") — full-detail
|
|
6
6
|
* generation; polycount is remesh's job afterwards.
|
|
7
|
-
* - smart-topology → meshy-t2 (
|
|
8
|
-
*
|
|
9
|
-
* geometry.
|
|
7
|
+
* - smart-topology → meshy-t2.5 (CLI default), or meshy-t2 with
|
|
8
|
+
* --ai-model — component-aware low-poly with a native
|
|
9
|
+
* --target-polycount; the budget pick for game-ready geometry.
|
|
10
10
|
*
|
|
11
11
|
* The Ultra geometry pass (--geometry-resolution 2k|4k, or the deprecated
|
|
12
12
|
* --ultra-mode) rides on standard only: it needs meshy-7.1, so pairing it with
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-to-3d.d.ts","sourceRoot":"","sources":["../../src/cmd/image-to-3d.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;
|
|
1
|
+
{"version":3,"file":"image-to-3d.d.ts","sourceRoot":"","sources":["../../src/cmd/image-to-3d.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAgLH,eAAO,MAAM,gBAAgB,6BAA6B,CAAC"}
|
package/dist/cmd/image-to-3d.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* image-to-3d — https://docs.meshy.ai/en/api/image-to-3d
|
|
3
3
|
*
|
|
4
|
-
* The mode
|
|
4
|
+
* The mode picks the model:
|
|
5
5
|
* - standard → meshy-7.1 (server default "latest") — full-detail
|
|
6
6
|
* generation; polycount is remesh's job afterwards.
|
|
7
|
-
* - smart-topology → meshy-t2 (
|
|
8
|
-
*
|
|
9
|
-
* geometry.
|
|
7
|
+
* - smart-topology → meshy-t2.5 (CLI default), or meshy-t2 with
|
|
8
|
+
* --ai-model — component-aware low-poly with a native
|
|
9
|
+
* --target-polycount; the budget pick for game-ready geometry.
|
|
10
10
|
*
|
|
11
11
|
* The Ultra geometry pass (--geometry-resolution 2k|4k, or the deprecated
|
|
12
12
|
* --ultra-mode) rides on standard only: it needs meshy-7.1, so pairing it with
|
|
@@ -16,6 +16,7 @@ import { Option } from "commander";
|
|
|
16
16
|
import { parseBool, parseCsv, parseInt10 } from "../internal/flags.js";
|
|
17
17
|
import { UsageError } from "../internal/errors.js";
|
|
18
18
|
import { buildResourceCommand } from "../internal/task-command.js";
|
|
19
|
+
import { prepareSmartTopologyPayload, SMART_TOPOLOGY_MODELS } from "../internal/smart-topology.js";
|
|
19
20
|
const spec = {
|
|
20
21
|
name: "image-to-3d",
|
|
21
22
|
description: "Generate a 3D model from a single reference image (clean backgrounds and clear edges " +
|
|
@@ -29,8 +30,9 @@ const spec = {
|
|
|
29
30
|
return cmd
|
|
30
31
|
.option("--image-url <src>", "reference image; http(s) URL or local file path")
|
|
31
32
|
.option("--input-task-id <id>", "alternative to --image-url: a SUCCEEDED text-to-image or image-to-image task whose output becomes the source image")
|
|
32
|
-
.addOption(new Option("--model-type <kind>", "standard (default; meshy-7.1 full-detail generation) | smart-topology (
|
|
33
|
-
.
|
|
33
|
+
.addOption(new Option("--model-type <kind>", "standard (default; meshy-7.1 full-detail generation) | smart-topology (component-aware low-poly: clean topology, separated parts; meshy-t2.5 by default)").choices(["standard", "smart-topology"]))
|
|
34
|
+
.addOption(new Option("--ai-model <model>", "smart-topology only: meshy-t2.5 (default; polycount up to 30000) | meshy-t2").choices([...SMART_TOPOLOGY_MODELS]))
|
|
35
|
+
.option("--target-polycount <n>", "smart-topology only: target triangle count — meshy-t2 100-15000 (default: 10000), meshy-t2.5 100-30000 (default: the API's 15000). For standard outputs use remesh", parseInt10)
|
|
34
36
|
.addOption(new Option("--geometry-resolution <res>", "standard mode only: standard (default) | 2k | 4k — the Ultra geometry pass at 2048³ / 4096³ for finer surface detail (needs meshy-7.1 / latest, the default; billed on top of the mesh)").choices(["standard", "2k", "4k"]))
|
|
35
37
|
.option("--ultra-mode <bool>", "deprecated: use --geometry-resolution 2k (true is the same pass)", parseBool)
|
|
36
38
|
.option("--should-texture <bool>", "generate textures (default: false — draft white mesh, the preview stage; texture later with retexture)", parseBool)
|
|
@@ -52,10 +54,10 @@ const spec = {
|
|
|
52
54
|
}
|
|
53
55
|
// The Ultra pass needs meshy-7.1, which only standard mode resolves to.
|
|
54
56
|
if (opts.ultraMode === true && smart) {
|
|
55
|
-
throw new UsageError("--ultra-mode applies to --model-type standard only (it needs meshy-7.1
|
|
57
|
+
throw new UsageError("--ultra-mode applies to --model-type standard only (it needs meshy-7.1)");
|
|
56
58
|
}
|
|
57
59
|
if (smart && opts.geometryResolution !== undefined && opts.geometryResolution !== "standard") {
|
|
58
|
-
throw new UsageError("--geometry-resolution 2k/4k applies to --model-type standard only (it needs meshy-7.1
|
|
60
|
+
throw new UsageError("--geometry-resolution 2k/4k applies to --model-type standard only (it needs meshy-7.1)");
|
|
59
61
|
}
|
|
60
62
|
if (opts.ultraMode !== undefined && opts.geometryResolution !== undefined) {
|
|
61
63
|
throw new UsageError("--ultra-mode is the deprecated spelling of --geometry-resolution 2k; pass only --geometry-resolution");
|
|
@@ -76,6 +78,7 @@ const spec = {
|
|
|
76
78
|
image_url: opts.imageUrl,
|
|
77
79
|
input_task_id: opts.inputTaskId,
|
|
78
80
|
model_type: opts.modelType,
|
|
81
|
+
ai_model: opts.aiModel,
|
|
79
82
|
target_polycount: opts.targetPolycount,
|
|
80
83
|
ultra_mode: opts.ultraMode,
|
|
81
84
|
geometry_resolution: opts.geometryResolution,
|
|
@@ -95,9 +98,9 @@ const spec = {
|
|
|
95
98
|
// texturing is its own step, and the API rejects texture knobs on
|
|
96
99
|
// untextured runs, so they ride only when texturing is on — then the
|
|
97
100
|
// game-ready defaults apply: full PBR map set, 4k base color. The
|
|
98
|
-
//
|
|
99
|
-
//
|
|
100
|
-
//
|
|
101
|
+
// standard follows the server's meshy-7.1 default. Smart Topology's
|
|
102
|
+
// model and polycount defaults are applied after payload merging.
|
|
103
|
+
// The Ultra pass stays off
|
|
101
104
|
// unless asked for: it bills extra. GLB-only output — omitting target_formats
|
|
102
105
|
// makes the API produce every format.
|
|
103
106
|
const texturing = opts.shouldTexture === true;
|
|
@@ -105,16 +108,16 @@ const spec = {
|
|
|
105
108
|
should_texture: false,
|
|
106
109
|
enable_pbr: texturing ? true : undefined,
|
|
107
110
|
texture_resolution: texturing ? "4k" : undefined,
|
|
108
|
-
target_polycount: opts.modelType === "smart-topology" ? 10_000 : undefined,
|
|
109
111
|
target_formats: ["glb"],
|
|
110
112
|
};
|
|
111
113
|
},
|
|
112
114
|
validatePayload(payload) {
|
|
113
|
-
|
|
115
|
+
prepareSmartTopologyPayload(payload);
|
|
116
|
+
// Smart topology has neither knob; v1 answers 400 for either (it does not ignore them).
|
|
114
117
|
if (payload.model_type === "smart-topology") {
|
|
115
118
|
for (const [flag, key] of [["--remove-lighting", "remove_lighting"], ["--image-enhancement", "image_enhancement"]]) {
|
|
116
119
|
if (payload[key] !== undefined) {
|
|
117
|
-
throw new UsageError(`${flag} applies to --model-type standard only (
|
|
120
|
+
throw new UsageError(`${flag} applies to --model-type standard only (the API refuses it for smart-topology)`);
|
|
118
121
|
}
|
|
119
122
|
}
|
|
120
123
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-to-3d.js","sourceRoot":"","sources":["../../src/cmd/image-to-3d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E,CAAC;oBAC5H,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE,CAAC;wBAC/B,MAAM,IAAI,UAAU,CAAC,GAAG,IAAI,gFAAgF,CAAC,CAAC;oBAChH,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;KACF;IACD,UAAU,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS;CAC/B,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* multi-image-to-3d — https://docs.meshy.ai/en/api/multi-image-to-3d
|
|
3
3
|
*
|
|
4
|
-
* No model flag
|
|
5
|
-
* "latest" is Meshy 7.1. geometry_resolution "2k" runs the Ultra pass (+5
|
|
4
|
+
* No model flag (the Smart Topology models are not offered here): the API
|
|
5
|
+
* default "latest" is Meshy 7.1. geometry_resolution "2k" runs the Ultra pass (+5
|
|
6
6
|
* credits; the same geometry setting as the web app's Ultra 2K) and needs
|
|
7
7
|
* meshy-7.1 / latest; the deprecated ultra_mode boolean is its old spelling.
|
|
8
8
|
* "4k" is single-image only — the API refuses it here. Only the enum is
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* multi-image-to-3d — https://docs.meshy.ai/en/api/multi-image-to-3d
|
|
3
3
|
*
|
|
4
|
-
* No model flag
|
|
5
|
-
* "latest" is Meshy 7.1. geometry_resolution "2k" runs the Ultra pass (+5
|
|
4
|
+
* No model flag (the Smart Topology models are not offered here): the API
|
|
5
|
+
* default "latest" is Meshy 7.1. geometry_resolution "2k" runs the Ultra pass (+5
|
|
6
6
|
* credits; the same geometry setting as the web app's Ultra 2K) and needs
|
|
7
7
|
* meshy-7.1 / latest; the deprecated ultra_mode boolean is its old spelling.
|
|
8
8
|
* "4k" is single-image only — the API refuses it here. Only the enum is
|
|
@@ -18,7 +18,7 @@ const spec = {
|
|
|
18
18
|
configure(cmd) {
|
|
19
19
|
cmd
|
|
20
20
|
.option("--input-task-id <id>", "source SUCCEEDED task: image-to-3d, multi-image-to-3d, text-to-3d, remesh, retexture or analyze-printability — takes priority over --model-url")
|
|
21
|
-
.option("--model-url <src>", "3D model: an http(s) URL (.glb/.gltf/.obj/.fbx/.stl, max
|
|
21
|
+
.option("--model-url <src>", "3D model: an http(s) URL (.glb/.gltf/.obj/.fbx/.stl, max 400MB; the output keeps the input format) or a local .glb/.gltf file (max 100MB) — the API takes inline uploads as glTF only, so host .stl/.obj/.fbx at a URL")
|
|
22
22
|
.option("--alpha-thumbnail <bool>", "also render a transparent-background preview (alpha_thumbnail_url; default: false)", parseBool);
|
|
23
23
|
return printSizeOptions(cmd, "thicken");
|
|
24
24
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repair-printability.js","sourceRoot":"","sources":["../../src/cmd/repair-printability.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAA4B,MAAM,6BAA6B,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAElG,MAAM,IAAI,GAAwB;IAChC,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EACT,wFAAwF;QACxF,8FAA8F;QAC9F,8DAA8D;IAChE,MAAM,EAAE;QACN,WAAW,EAAE,mCAAmC;QAChD,SAAS,CAAC,GAAG;YACX,GAAG;iBACA,MAAM,CACL,sBAAsB,EACtB,gJAAgJ,CACjJ;iBACA,MAAM,CACL,mBAAmB,EACnB,
|
|
1
|
+
{"version":3,"file":"repair-printability.js","sourceRoot":"","sources":["../../src/cmd/repair-printability.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH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-to-3d.d.ts
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
* The flag surface is deliberately minimal: topology and polycount are
|
|
8
8
|
* remesh's job (except smart topology's native polycount), resizing is
|
|
9
9
|
* resize's job, deprecated parameters (symmetry_mode, lowpoly, ultra_mode)
|
|
10
|
-
* are gone, and
|
|
11
|
-
*
|
|
12
|
-
* `--data` escape hatch still reaches anything the API accepts.
|
|
10
|
+
* are gone, and the mode picks the model: standard runs the server default
|
|
11
|
+
* "latest" (Meshy 7.1), smart-topology runs meshy-t2.5, or meshy-t2 with
|
|
12
|
+
* --ai-model. The `--data` escape hatch still reaches anything the API accepts.
|
|
13
13
|
*/
|
|
14
14
|
export declare const textTo3dCommand: import("commander").Command;
|
|
15
15
|
//# sourceMappingURL=text-to-3d.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-to-3d.d.ts","sourceRoot":"","sources":["../../src/cmd/text-to-3d.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"text-to-3d.d.ts","sourceRoot":"","sources":["../../src/cmd/text-to-3d.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAqIH,eAAO,MAAM,eAAe,6BAA6B,CAAC"}
|
package/dist/cmd/text-to-3d.js
CHANGED
|
@@ -7,14 +7,15 @@
|
|
|
7
7
|
* The flag surface is deliberately minimal: topology and polycount are
|
|
8
8
|
* remesh's job (except smart topology's native polycount), resizing is
|
|
9
9
|
* resize's job, deprecated parameters (symmetry_mode, lowpoly, ultra_mode)
|
|
10
|
-
* are gone, and
|
|
11
|
-
*
|
|
12
|
-
* `--data` escape hatch still reaches anything the API accepts.
|
|
10
|
+
* are gone, and the mode picks the model: standard runs the server default
|
|
11
|
+
* "latest" (Meshy 7.1), smart-topology runs meshy-t2.5, or meshy-t2 with
|
|
12
|
+
* --ai-model. The `--data` escape hatch still reaches anything the API accepts.
|
|
13
13
|
*/
|
|
14
14
|
import { Option } from "commander";
|
|
15
15
|
import { parseBool, parseCsv, parseInt10 } from "../internal/flags.js";
|
|
16
16
|
import { UsageError } from "../internal/errors.js";
|
|
17
17
|
import { buildResourceCommand } from "../internal/task-command.js";
|
|
18
|
+
import { prepareSmartTopologyPayload, SMART_TOPOLOGY_MODELS } from "../internal/smart-topology.js";
|
|
18
19
|
const spec = {
|
|
19
20
|
name: "text-to-3d",
|
|
20
21
|
description: "Generate 3D models from text prompts (two-stage: preview → refine). " +
|
|
@@ -30,8 +31,9 @@ const spec = {
|
|
|
30
31
|
"consumes the preview's latents, so uploaded models or image-to-3d/remesh outputs " +
|
|
31
32
|
"cannot be refined (use retexture for those)")
|
|
32
33
|
.addOption(new Option("--pose-mode <pose>", "preview only. a-pose | t-pose pre-pose characters for rigging; auto (default) lets the model decide").choices(["a-pose", "t-pose", "auto"]))
|
|
33
|
-
.addOption(new Option("--model-type <kind>", "preview only. standard (default; full-detail generation) | smart-topology (
|
|
34
|
-
.
|
|
34
|
+
.addOption(new Option("--model-type <kind>", "preview only. standard (default; full-detail generation) | smart-topology (clean triangle topology, separated parts, native --target-polycount; meshy-t2.5 by default)").choices(["standard", "smart-topology"]))
|
|
35
|
+
.addOption(new Option("--ai-model <model>", "preview, smart-topology only: meshy-t2.5 (default; polycount up to 30000) | meshy-t2").choices([...SMART_TOPOLOGY_MODELS]))
|
|
36
|
+
.option("--target-polycount <n>", "preview, smart-topology only: target face count — meshy-t2 100-15000 (default: 10000), meshy-t2.5 100-30000 (default: the API's 15000)", parseInt10)
|
|
35
37
|
.addOption(new Option("--geometry-resolution <res>", "preview, standard only: standard (default) | 2k | 4k — the Ultra geometry pass at 2048³ / 4096³ (needs meshy-7.1 / latest, the default; billed on top)").choices(["standard", "2k", "4k"]))
|
|
36
38
|
.option("--enable-pbr <bool>", "refine only. Generate normal/metallic/roughness maps, plus an emission map on meshy-6 below 8k (default: true, so game-engine imports carry the full map set)", parseBool)
|
|
37
39
|
.option("--texture-prompt <text>", "refine only. Extra texture guidance (max 800 chars)")
|
|
@@ -48,7 +50,7 @@ const spec = {
|
|
|
48
50
|
throw new UsageError("--mode refine requires --preview-task-id");
|
|
49
51
|
}
|
|
50
52
|
if (mode === "refine") {
|
|
51
|
-
for (const [flag, value] of [["--model-type", opts.modelType], ["--target-polycount", opts.targetPolycount], ["--geometry-resolution", opts.geometryResolution]]) {
|
|
53
|
+
for (const [flag, value] of [["--model-type", opts.modelType], ["--ai-model", opts.aiModel], ["--target-polycount", opts.targetPolycount], ["--geometry-resolution", opts.geometryResolution]]) {
|
|
52
54
|
if (value !== undefined)
|
|
53
55
|
throw new UsageError(`${flag} applies to --mode preview only (refine inherits the preview's geometry)`);
|
|
54
56
|
}
|
|
@@ -57,11 +59,8 @@ const spec = {
|
|
|
57
59
|
if (opts.targetPolycount !== undefined && !smart) {
|
|
58
60
|
throw new UsageError("--target-polycount applies to --model-type smart-topology only; for standard outputs chain `remesh` afterwards");
|
|
59
61
|
}
|
|
60
|
-
if (opts.targetPolycount !== undefined && (opts.targetPolycount < 100 || opts.targetPolycount > 15000)) {
|
|
61
|
-
throw new UsageError("--target-polycount must be between 100 and 15000");
|
|
62
|
-
}
|
|
63
62
|
if (smart && opts.geometryResolution !== undefined && opts.geometryResolution !== "standard") {
|
|
64
|
-
throw new UsageError("--geometry-resolution 2k/4k needs meshy-7.1 (standard)
|
|
63
|
+
throw new UsageError("--geometry-resolution 2k/4k needs meshy-7.1 (standard), not smart-topology");
|
|
65
64
|
}
|
|
66
65
|
return {
|
|
67
66
|
mode,
|
|
@@ -70,6 +69,7 @@ const spec = {
|
|
|
70
69
|
// "auto" means "let the model decide" — the API's default, expressed by omission.
|
|
71
70
|
pose_mode: opts.poseMode === "auto" ? undefined : opts.poseMode,
|
|
72
71
|
model_type: opts.modelType,
|
|
72
|
+
ai_model: opts.aiModel,
|
|
73
73
|
target_polycount: opts.targetPolycount,
|
|
74
74
|
geometry_resolution: opts.geometryResolution,
|
|
75
75
|
enable_pbr: opts.enablePbr,
|
|
@@ -88,15 +88,15 @@ const spec = {
|
|
|
88
88
|
// removed on meshy-6/7) apply otherwise. `make` still asks for 4k: it
|
|
89
89
|
// made the preview itself, on latest.
|
|
90
90
|
// GLB-only output — omitting target_formats makes the API produce
|
|
91
|
-
// every format. Smart
|
|
92
|
-
//
|
|
91
|
+
// every format. Smart Topology's model and polycount defaults are
|
|
92
|
+
// applied after payload merging, as on image-to-3d.
|
|
93
93
|
const refine = opts.mode === "refine";
|
|
94
94
|
return {
|
|
95
95
|
enable_pbr: refine ? true : undefined,
|
|
96
|
-
target_polycount: opts.modelType === "smart-topology" ? 10_000 : undefined,
|
|
97
96
|
target_formats: ["glb"],
|
|
98
97
|
};
|
|
99
98
|
},
|
|
99
|
+
validatePayload: prepareSmartTopologyPayload,
|
|
100
100
|
},
|
|
101
101
|
endpointOf: (c) => c.textTo3d,
|
|
102
102
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-to-3d.js","sourceRoot":"","sources":["../../src/cmd/text-to-3d.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAA4B,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"text-to-3d.js","sourceRoot":"","sources":["../../src/cmd/text-to-3d.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EA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,CAAC,CAAC,CAAC,QAAQ;CAC9B,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Smart Topology models, shared by image-to-3d and text-to-3d preview so the
|
|
3
|
+
* two commands cannot drift apart.
|
|
4
|
+
*
|
|
5
|
+
* The CLI pins meshy-t2.5 when Smart Topology has no explicit ai_model.
|
|
6
|
+
* meshy-t2.5 takes a polycount up to 30,000 (meshy-t2: 15,000).
|
|
7
|
+
* Both need model_type "smart-topology", and both output triangles only.
|
|
8
|
+
*/
|
|
9
|
+
export declare const SMART_TOPOLOGY_MODELS: readonly ["meshy-t2", "meshy-t2.5"];
|
|
10
|
+
export declare const DEFAULT_SMART_TOPOLOGY_MODEL = "meshy-t2.5";
|
|
11
|
+
/** Applies conditional defaults and validates after --data and flags have merged. */
|
|
12
|
+
export declare function prepareSmartTopologyPayload(payload: Record<string, unknown>): void;
|
|
13
|
+
//# sourceMappingURL=smart-topology.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smart-topology.d.ts","sourceRoot":"","sources":["../../src/internal/smart-topology.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,eAAO,MAAM,qBAAqB,YAAI,UAAU,EAAE,YAAY,CAAU,CAAC;AACzE,eAAO,MAAM,4BAA4B,eAAe,CAAC;AAIzD,qFAAqF;AACrF,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAyBlF"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Smart Topology models, shared by image-to-3d and text-to-3d preview so the
|
|
3
|
+
* two commands cannot drift apart.
|
|
4
|
+
*
|
|
5
|
+
* The CLI pins meshy-t2.5 when Smart Topology has no explicit ai_model.
|
|
6
|
+
* meshy-t2.5 takes a polycount up to 30,000 (meshy-t2: 15,000).
|
|
7
|
+
* Both need model_type "smart-topology", and both output triangles only.
|
|
8
|
+
*/
|
|
9
|
+
import { UsageError } from "./errors.js";
|
|
10
|
+
export const SMART_TOPOLOGY_MODELS = ["meshy-t2", "meshy-t2.5"];
|
|
11
|
+
export const DEFAULT_SMART_TOPOLOGY_MODEL = "meshy-t2.5";
|
|
12
|
+
const MAX_POLYCOUNT = { "meshy-t2": 15_000, "meshy-t2.5": 30_000 };
|
|
13
|
+
/** Applies conditional defaults and validates after --data and flags have merged. */
|
|
14
|
+
export function prepareSmartTopologyPayload(payload) {
|
|
15
|
+
const smart = payload.model_type === "smart-topology";
|
|
16
|
+
if (smart) {
|
|
17
|
+
payload.ai_model ??= DEFAULT_SMART_TOPOLOGY_MODEL;
|
|
18
|
+
// Keep the explicit T2 option's rigging-friendly 10k default; T2.5 uses
|
|
19
|
+
// the API's own 15k. Resolve this after merging so --data works like flags.
|
|
20
|
+
if (payload.ai_model === "meshy-t2")
|
|
21
|
+
payload.target_polycount ??= 10_000;
|
|
22
|
+
}
|
|
23
|
+
const model = typeof payload.ai_model === "string" ? payload.ai_model : undefined;
|
|
24
|
+
if (model && model in MAX_POLYCOUNT && !smart) {
|
|
25
|
+
throw new UsageError(`${model} is a Smart Topology model: pass --model-type smart-topology`);
|
|
26
|
+
}
|
|
27
|
+
if (!smart)
|
|
28
|
+
return;
|
|
29
|
+
if (payload.topology === "quad") {
|
|
30
|
+
throw new UsageError("smart-topology output is triangle-only; for quads chain `remesh --topology quad` afterwards");
|
|
31
|
+
}
|
|
32
|
+
const n = payload.target_polycount;
|
|
33
|
+
const max = MAX_POLYCOUNT[model ?? "meshy-t2"]; // another model sent through --data is left to the API
|
|
34
|
+
if (max !== undefined && typeof n === "number" && (n < 100 || n > max)) {
|
|
35
|
+
throw new UsageError(model === "meshy-t2.5"
|
|
36
|
+
? "--target-polycount must be between 100 and 30000 on meshy-t2.5"
|
|
37
|
+
: "--target-polycount must be between 100 and 15000 on meshy-t2 (--ai-model meshy-t2.5 takes up to 30000)");
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=smart-topology.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smart-topology.js","sourceRoot":"","sources":["../../src/internal/smart-topology.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,UAAU,EAAE,YAAY,CAAU,CAAC;AACzE,MAAM,CAAC,MAAM,4BAA4B,GAAG,YAAY,CAAC;AAEzD,MAAM,aAAa,GAAqC,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC;AAErG,qFAAqF;AACrF,MAAM,UAAU,2BAA2B,CAAC,OAAgC;IAC1E,MAAM,KAAK,GAAG,OAAO,CAAC,UAAU,KAAK,gBAAgB,CAAC;IACtD,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,CAAC,QAAQ,KAAK,4BAA4B,CAAC;QAClD,wEAAwE;QACxE,4EAA4E;QAC5E,IAAI,OAAO,CAAC,QAAQ,KAAK,UAAU;YAAE,OAAO,CAAC,gBAAgB,KAAK,MAAM,CAAC;IAC3E,CAAC;IACD,MAAM,KAAK,GAAG,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;IAClF,IAAI,KAAK,IAAI,KAAK,IAAI,aAAa,IAAI,CAAC,KAAK,EAAE,CAAC;QAC9C,MAAM,IAAI,UAAU,CAAC,GAAG,KAAK,8DAA8D,CAAC,CAAC;IAC/F,CAAC;IACD,IAAI,CAAC,KAAK;QAAE,OAAO;IACnB,IAAI,OAAO,CAAC,QAAQ,KAAK,MAAM,EAAE,CAAC;QAChC,MAAM,IAAI,UAAU,CAAC,6FAA6F,CAAC,CAAC;IACtH,CAAC;IACD,MAAM,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC;IACnC,MAAM,GAAG,GAAG,aAAa,CAAC,KAAK,IAAI,UAAU,CAAC,CAAC,CAAC,uDAAuD;IACvG,IAAI,GAAG,KAAK,SAAS,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,GAAG,CAAC,EAAE,CAAC;QACvE,MAAM,IAAI,UAAU,CAClB,KAAK,KAAK,YAAY;YACpB,CAAC,CAAC,gEAAgE;YAClE,CAAC,CAAC,wGAAwG,CAC7G,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meshy-ai/cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
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, printability, auto split, multi-color print, Creative Lab, balance and usage — plus selective downloads, project folders, face checks, OBJ print preparation and slicer launch.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -165,8 +165,9 @@ These are API rules, not preferences — ignoring them produces failed tasks:
|
|
|
165
165
|
`--geometry-resolution 2k|4k` runs the Ultra geometry pass (+5 credits;
|
|
166
166
|
text-to-3d: preview only; multi-image: `2k` only; not with smart-topology);
|
|
167
167
|
`--ultra-mode` on image-to-3d is its deprecated spelling of `2k`.
|
|
168
|
-
`--model-type smart-topology` (
|
|
169
|
-
|
|
168
|
+
`--model-type smart-topology` (text-to-3d and image-to-3d) has a native
|
|
169
|
+
`--target-polycount`: meshy-t2.5 is the CLI default, 100-30000 (default
|
|
170
|
+
15000); `--ai-model meshy-t2` selects T2, 100-15000 (default 10000). `retexture`'s
|
|
170
171
|
`--multiview-image-urls` needs Meshy 7 — it takes 1-4 views of **the same
|
|
171
172
|
object**, not style references.
|
|
172
173
|
- Printing: `analyze-`/`repair-printability` take `--printer-type
|