@doufunao123/asset-gateway 0.24.0 → 0.25.0
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/index.js +78 -10
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -15,7 +15,7 @@ import { AssetForgeError } from "@doufunao123/assetforge-sdk";
|
|
|
15
15
|
|
|
16
16
|
// src/meta.ts
|
|
17
17
|
var CLI_NAME = "asset-gateway";
|
|
18
|
-
var CLI_VERSION = "0.
|
|
18
|
+
var CLI_VERSION = "0.25.0";
|
|
19
19
|
var CLI_DESCRIPTION = "Universal asset generation gateway CLI";
|
|
20
20
|
var DEFAULT_GATEWAY_URL = "https://asset.origingame.dev";
|
|
21
21
|
|
|
@@ -989,16 +989,32 @@ function createGenerateCommand() {
|
|
|
989
989
|
})
|
|
990
990
|
);
|
|
991
991
|
command.addCommand(
|
|
992
|
-
new Command3("model").description(
|
|
992
|
+
new Command3("model").description(
|
|
993
|
+
"Generate a 3D model with Meshy AI. Default --quality=preview returns a single preview mesh (fast); --quality=full chains preview \u2192 refine \u2192 remesh to deliver a production-ready mesh."
|
|
994
|
+
).option("--image <input>", "Reference image path or URL").option("--format <fmt>", "Output format: glb, fbx, obj, usdz, stl, 3mf", "glb").option("--prompt <text>", "Model description prompt").option(
|
|
995
|
+
"--quality <mode>",
|
|
996
|
+
"Pipeline mode: preview (single stage, ~30s) or full (chained: preview \u2192 refine \u2192 remesh, ~5-10min)"
|
|
997
|
+
).option("--ai-model <name>", "Meshy model: meshy-5, meshy-6, latest").option("--polycount <n>", "Target polygon count (full quality only)").option("--pbr", "Enable PBR textures").option("--hd-texture", "Request 4K texture output (requires --ai-model meshy-6)").option("--pose-mode <mode>", "Character pose mode: a-pose or t-pose").option("--auto-size", "Estimate real-world size automatically").option("--negative-prompt <text>", "Negative prompt").option("--multiview <inputs>", "Comma-separated multiview image paths or URLs").option("--output-dir <dir>", "Directory to save output", ".").option(
|
|
998
|
+
"--async",
|
|
999
|
+
"Submit asynchronously; return job_id immediately without waiting. Poll with: asset-gateway job status <id>"
|
|
1000
|
+
).action(async function(options) {
|
|
993
1001
|
try {
|
|
994
1002
|
assertHas3dInput(options.prompt, options.image, options.multiview);
|
|
1003
|
+
if (options.hdTexture && options.aiModel && options.aiModel !== "meshy-6") {
|
|
1004
|
+
throw new Error(
|
|
1005
|
+
"--hd-texture requires --ai-model meshy-6 (got '" + options.aiModel + "'); preview would succeed but refine would 400 and waste credits"
|
|
1006
|
+
);
|
|
1007
|
+
}
|
|
995
1008
|
const ctx = createContext(this);
|
|
996
1009
|
const params = {};
|
|
997
1010
|
if (options.negativePrompt) params.negative_prompt = options.negativePrompt;
|
|
998
1011
|
if (options.multiview) {
|
|
999
1012
|
params.multiview = parseCommaSeparatedValues(options.multiview).map((value) => toInputFile(value)).filter((value) => Boolean(value));
|
|
1000
1013
|
}
|
|
1001
|
-
|
|
1014
|
+
if (options.quality) {
|
|
1015
|
+
params.model3d_quality = options.quality;
|
|
1016
|
+
}
|
|
1017
|
+
const sdkOptions = {
|
|
1002
1018
|
input: toInputFile(options.image),
|
|
1003
1019
|
format: options.format,
|
|
1004
1020
|
ai_model: options.aiModel,
|
|
@@ -1008,7 +1024,19 @@ function createGenerateCommand() {
|
|
|
1008
1024
|
pose_mode: options.poseMode,
|
|
1009
1025
|
auto_size: options.autoSize ? true : void 0,
|
|
1010
1026
|
params: Object.keys(params).length > 0 ? toJsonObject(params) : void 0
|
|
1011
|
-
}
|
|
1027
|
+
};
|
|
1028
|
+
if (options.async) {
|
|
1029
|
+
const ack = await ctx.client.model3d(options.prompt ?? "", {
|
|
1030
|
+
...sdkOptions,
|
|
1031
|
+
async: true
|
|
1032
|
+
});
|
|
1033
|
+
printSuccess("generate.model", ack, ctx);
|
|
1034
|
+
return;
|
|
1035
|
+
}
|
|
1036
|
+
const data = await ctx.client.model3d(
|
|
1037
|
+
options.prompt ?? "",
|
|
1038
|
+
sdkOptions
|
|
1039
|
+
);
|
|
1012
1040
|
const localPath = await saveOutput(data, "model3d", options.outputDir, options.format);
|
|
1013
1041
|
if (localPath) data.local_path = localPath;
|
|
1014
1042
|
printSuccess("generate.model", data, ctx);
|
|
@@ -1018,12 +1046,20 @@ function createGenerateCommand() {
|
|
|
1018
1046
|
})
|
|
1019
1047
|
);
|
|
1020
1048
|
command.addCommand(
|
|
1021
|
-
new Command3("character").description("Generate a fully processed 3D character with Meshy AI").option("--prompt <text>", "Character description prompt").option("--image <input>", "Reference image path or URL").option("--images <inputs>", "Comma-separated reference image paths or URLs").option("--format <fmt>", "Output format: glb, fbx, obj, usdz, stl, 3mf", "glb").option("--polycount <n>", "Target polygon count").option("--pbr", "Enable PBR textures").option("--hd-texture", "Request 4K texture output").option("--pose-mode <mode>", "Character pose mode: a-pose or t-pose").option("--ai-model <name>", "Meshy model: meshy-5, meshy-6, latest").option("--auto-size", "Estimate real-world size automatically").option("--output-dir <dir>", "Directory to save output", ".").
|
|
1049
|
+
new Command3("character").description("Generate a fully processed 3D character with Meshy AI (chained preview \u2192 refine \u2192 remesh \u2192 rig)").option("--prompt <text>", "Character description prompt").option("--image <input>", "Reference image path or URL").option("--images <inputs>", "Comma-separated reference image paths or URLs").option("--format <fmt>", "Output format: glb, fbx, obj, usdz, stl, 3mf", "glb").option("--polycount <n>", "Target polygon count").option("--pbr", "Enable PBR textures").option("--hd-texture", "Request 4K texture output (requires --ai-model meshy-6)").option("--pose-mode <mode>", "Character pose mode: a-pose or t-pose").option("--ai-model <name>", "Meshy model: meshy-5, meshy-6, latest").option("--auto-size", "Estimate real-world size automatically").option("--output-dir <dir>", "Directory to save output", ".").option(
|
|
1050
|
+
"--async",
|
|
1051
|
+
"Submit asynchronously; return job_id immediately without waiting. Poll with: asset-gateway job status <id>"
|
|
1052
|
+
).action(async function(options) {
|
|
1022
1053
|
try {
|
|
1023
1054
|
assertHas3dInput(options.prompt, options.image, options.images);
|
|
1055
|
+
if (options.hdTexture && options.aiModel && options.aiModel !== "meshy-6") {
|
|
1056
|
+
throw new Error(
|
|
1057
|
+
"--hd-texture requires --ai-model meshy-6 (got '" + options.aiModel + "'); preview would succeed but refine would 400 and waste credits"
|
|
1058
|
+
);
|
|
1059
|
+
}
|
|
1024
1060
|
const ctx = createContext(this);
|
|
1025
1061
|
const images = parseCommaSeparatedValues(options.images).map((value) => toInputFile(value)).filter((value) => Boolean(value));
|
|
1026
|
-
const
|
|
1062
|
+
const sdkOptions = {
|
|
1027
1063
|
input: toInputFile(options.image),
|
|
1028
1064
|
images: images.length > 0 ? images : void 0,
|
|
1029
1065
|
format: options.format,
|
|
@@ -1033,7 +1069,19 @@ function createGenerateCommand() {
|
|
|
1033
1069
|
pose_mode: options.poseMode,
|
|
1034
1070
|
ai_model: options.aiModel,
|
|
1035
1071
|
auto_size: options.autoSize ? true : void 0
|
|
1036
|
-
}
|
|
1072
|
+
};
|
|
1073
|
+
if (options.async) {
|
|
1074
|
+
const ack = await ctx.client.character(options.prompt ?? "", {
|
|
1075
|
+
...sdkOptions,
|
|
1076
|
+
async: true
|
|
1077
|
+
});
|
|
1078
|
+
printSuccess("generate.character", ack, ctx);
|
|
1079
|
+
return;
|
|
1080
|
+
}
|
|
1081
|
+
const data = await ctx.client.character(
|
|
1082
|
+
options.prompt ?? "",
|
|
1083
|
+
sdkOptions
|
|
1084
|
+
);
|
|
1037
1085
|
const localPath = await saveOutput(data, "character", options.outputDir, options.format);
|
|
1038
1086
|
if (localPath) data.local_path = localPath;
|
|
1039
1087
|
printSuccess("generate.character", data, ctx);
|
|
@@ -1043,12 +1091,20 @@ function createGenerateCommand() {
|
|
|
1043
1091
|
})
|
|
1044
1092
|
);
|
|
1045
1093
|
command.addCommand(
|
|
1046
|
-
new Command3("prop").description("Generate a fully processed 3D prop with Meshy AI").option("--prompt <text>", "Prop description prompt").option("--image <input>", "Reference image path or URL").option("--images <inputs>", "Comma-separated reference image paths or URLs").option("--format <fmt>", "Output format: glb, fbx, obj, usdz, stl, 3mf", "glb").option("--polycount <n>", "Target polygon count").option("--pbr", "Enable PBR textures").option("--hd-texture", "Request 4K texture output").option("--ai-model <name>", "Meshy model: meshy-5, meshy-6, latest").option("--auto-size", "Estimate real-world size automatically").option("--texture-prompt <text>", "Optional texture prompt for the final material pass").option("--output-dir <dir>", "Directory to save output", ".").
|
|
1094
|
+
new Command3("prop").description("Generate a fully processed 3D prop with Meshy AI (chained preview \u2192 refine \u2192 remesh)").option("--prompt <text>", "Prop description prompt").option("--image <input>", "Reference image path or URL").option("--images <inputs>", "Comma-separated reference image paths or URLs").option("--format <fmt>", "Output format: glb, fbx, obj, usdz, stl, 3mf", "glb").option("--polycount <n>", "Target polygon count").option("--pbr", "Enable PBR textures").option("--hd-texture", "Request 4K texture output (requires --ai-model meshy-6)").option("--ai-model <name>", "Meshy model: meshy-5, meshy-6, latest").option("--auto-size", "Estimate real-world size automatically").option("--texture-prompt <text>", "Optional texture prompt for the final material pass").option("--output-dir <dir>", "Directory to save output", ".").option(
|
|
1095
|
+
"--async",
|
|
1096
|
+
"Submit asynchronously; return job_id immediately without waiting. Poll with: asset-gateway job status <id>"
|
|
1097
|
+
).action(async function(options) {
|
|
1047
1098
|
try {
|
|
1048
1099
|
assertHas3dInput(options.prompt, options.image, options.images);
|
|
1100
|
+
if (options.hdTexture && options.aiModel && options.aiModel !== "meshy-6") {
|
|
1101
|
+
throw new Error(
|
|
1102
|
+
"--hd-texture requires --ai-model meshy-6 (got '" + options.aiModel + "'); preview would succeed but refine would 400 and waste credits"
|
|
1103
|
+
);
|
|
1104
|
+
}
|
|
1049
1105
|
const ctx = createContext(this);
|
|
1050
1106
|
const images = parseCommaSeparatedValues(options.images).map((value) => toInputFile(value)).filter((value) => Boolean(value));
|
|
1051
|
-
const
|
|
1107
|
+
const sdkOptions = {
|
|
1052
1108
|
input: toInputFile(options.image),
|
|
1053
1109
|
images: images.length > 0 ? images : void 0,
|
|
1054
1110
|
format: options.format,
|
|
@@ -1058,7 +1114,19 @@ function createGenerateCommand() {
|
|
|
1058
1114
|
ai_model: options.aiModel,
|
|
1059
1115
|
auto_size: options.autoSize ? true : void 0,
|
|
1060
1116
|
texture_prompt: options.texturePrompt
|
|
1061
|
-
}
|
|
1117
|
+
};
|
|
1118
|
+
if (options.async) {
|
|
1119
|
+
const ack = await ctx.client.prop(options.prompt ?? "", {
|
|
1120
|
+
...sdkOptions,
|
|
1121
|
+
async: true
|
|
1122
|
+
});
|
|
1123
|
+
printSuccess("generate.prop", ack, ctx);
|
|
1124
|
+
return;
|
|
1125
|
+
}
|
|
1126
|
+
const data = await ctx.client.prop(
|
|
1127
|
+
options.prompt ?? "",
|
|
1128
|
+
sdkOptions
|
|
1129
|
+
);
|
|
1062
1130
|
const localPath = await saveOutput(data, "prop", options.outputDir, options.format);
|
|
1063
1131
|
if (localPath) data.local_path = localPath;
|
|
1064
1132
|
printSuccess("generate.prop", data, ctx);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@doufunao123/asset-gateway",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.0",
|
|
4
4
|
"description": "Universal asset generation gateway CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"node": ">=20"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@doufunao123/assetforge-sdk": "^0.
|
|
30
|
+
"@doufunao123/assetforge-sdk": "^0.11.0",
|
|
31
31
|
"commander": "^13.1.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|