@doufunao123/asset-gateway 0.20.0 → 0.21.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/README.md +2 -0
- package/dist/index.js +56 -20
- package/package.json +2 -2
package/README.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -472,6 +472,19 @@ var SCHEMAS = {
|
|
|
472
472
|
"--output-dir": { type: "string", default: "." }
|
|
473
473
|
}
|
|
474
474
|
},
|
|
475
|
+
animate: {
|
|
476
|
+
description: "Apply a preset animation to a rigged character. Common presets: 0=Idle, 1=Walk, 4=Attack, 8=Dead, 14=Run, 16=RunFast, 466=Jump. 500+ presets available.",
|
|
477
|
+
params: {
|
|
478
|
+
"--task-id": { type: "string", required: true, description: "Meshy rigging task ID" },
|
|
479
|
+
"--action-id": {
|
|
480
|
+
type: "number",
|
|
481
|
+
required: true,
|
|
482
|
+
description: "Animation preset ID (see docs for full list)"
|
|
483
|
+
},
|
|
484
|
+
"--fps": { type: "number", description: "Target frame rate: 24, 25, 30, or 60" },
|
|
485
|
+
"--output-dir": { type: "string", default: "." }
|
|
486
|
+
}
|
|
487
|
+
},
|
|
475
488
|
refine: {
|
|
476
489
|
description: "Refine a Meshy preview model into a higher quality result",
|
|
477
490
|
params: {
|
|
@@ -714,9 +727,9 @@ function createGenerateCommand() {
|
|
|
714
727
|
size: options.size,
|
|
715
728
|
transparent: options.transparent ? true : void 0,
|
|
716
729
|
input: options.input,
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
730
|
+
reference_images: options.ref,
|
|
731
|
+
edit_mode: options.editMode,
|
|
732
|
+
session_id: options.session
|
|
720
733
|
});
|
|
721
734
|
const localPath = await saveOutput(data, "image", options.outputDir);
|
|
722
735
|
if (localPath) data.local_path = localPath;
|
|
@@ -816,8 +829,8 @@ function createGenerateCommand() {
|
|
|
816
829
|
const ctx = createContext(this);
|
|
817
830
|
const data = await ctx.client.music(options.prompt, {
|
|
818
831
|
duration: options.duration ? Number(options.duration) : void 0,
|
|
819
|
-
|
|
820
|
-
|
|
832
|
+
force_instrumental: options.forceInstrumental ? true : void 0,
|
|
833
|
+
output_format: options.outputFormat
|
|
821
834
|
});
|
|
822
835
|
const localPath = await saveOutput(data, "music", options.outputDir);
|
|
823
836
|
if (localPath) data.local_path = localPath;
|
|
@@ -858,12 +871,12 @@ function createGenerateCommand() {
|
|
|
858
871
|
const data = await ctx.client.model3d(options.prompt ?? "", {
|
|
859
872
|
input: toInputFile(options.image),
|
|
860
873
|
format: options.format,
|
|
861
|
-
|
|
874
|
+
ai_model: options.aiModel,
|
|
862
875
|
polycount: options.polycount ? Number(options.polycount) : void 0,
|
|
863
876
|
pbr: options.pbr ? true : void 0,
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
877
|
+
hd_texture: options.hdTexture ? true : void 0,
|
|
878
|
+
pose_mode: options.poseMode,
|
|
879
|
+
auto_size: options.autoSize ? true : void 0,
|
|
867
880
|
params: Object.keys(params).length > 0 ? toJsonObject(params) : void 0
|
|
868
881
|
});
|
|
869
882
|
const localPath = await saveOutput(data, "model3d", options.outputDir, options.format);
|
|
@@ -886,10 +899,10 @@ function createGenerateCommand() {
|
|
|
886
899
|
format: options.format,
|
|
887
900
|
polycount: options.polycount ? Number(options.polycount) : void 0,
|
|
888
901
|
pbr: options.pbr ? true : void 0,
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
902
|
+
hd_texture: options.hdTexture ? true : void 0,
|
|
903
|
+
pose_mode: options.poseMode,
|
|
904
|
+
ai_model: options.aiModel,
|
|
905
|
+
auto_size: options.autoSize ? true : void 0
|
|
893
906
|
});
|
|
894
907
|
const localPath = await saveOutput(data, "character", options.outputDir, options.format);
|
|
895
908
|
if (localPath) data.local_path = localPath;
|
|
@@ -911,10 +924,10 @@ function createGenerateCommand() {
|
|
|
911
924
|
format: options.format,
|
|
912
925
|
polycount: options.polycount ? Number(options.polycount) : void 0,
|
|
913
926
|
pbr: options.pbr ? true : void 0,
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
927
|
+
hd_texture: options.hdTexture ? true : void 0,
|
|
928
|
+
ai_model: options.aiModel,
|
|
929
|
+
auto_size: options.autoSize ? true : void 0,
|
|
930
|
+
texture_prompt: options.texturePrompt
|
|
918
931
|
});
|
|
919
932
|
const localPath = await saveOutput(data, "prop", options.outputDir, options.format);
|
|
920
933
|
if (localPath) data.local_path = localPath;
|
|
@@ -930,7 +943,7 @@ function createGenerateCommand() {
|
|
|
930
943
|
const ctx = createContext(this);
|
|
931
944
|
const data = await ctx.client.text(options.prompt, {
|
|
932
945
|
model: options.model,
|
|
933
|
-
|
|
946
|
+
max_tokens: options.maxTokens ? Number(options.maxTokens) : void 0
|
|
934
947
|
});
|
|
935
948
|
const localPath = await saveOutput(data, "text", options.outputDir);
|
|
936
949
|
if (localPath) data.local_path = localPath;
|
|
@@ -951,7 +964,7 @@ function createGenerateCommand() {
|
|
|
951
964
|
};
|
|
952
965
|
const data = await ctx.client.sprite(options.prompt, {
|
|
953
966
|
input: toInputFile(options.input),
|
|
954
|
-
|
|
967
|
+
animation_type: options.animationType,
|
|
955
968
|
style: options.style,
|
|
956
969
|
params: toJsonObject(params)
|
|
957
970
|
});
|
|
@@ -970,7 +983,7 @@ function createGenerateCommand() {
|
|
|
970
983
|
const data = await ctx.client.world(options.prompt, {
|
|
971
984
|
input: toInputFile(options.input),
|
|
972
985
|
model: options.model,
|
|
973
|
-
|
|
986
|
+
display_name: options.displayName
|
|
974
987
|
});
|
|
975
988
|
const localPath = await saveOutput(data, "world", options.outputDir);
|
|
976
989
|
if (localPath) data.local_path = localPath;
|
|
@@ -1361,6 +1374,29 @@ function createProcess3dCommand() {
|
|
|
1361
1374
|
}
|
|
1362
1375
|
})
|
|
1363
1376
|
);
|
|
1377
|
+
command.addCommand(
|
|
1378
|
+
new Command7("animate").description("Apply a preset animation to a rigged Meshy character").requiredOption("--task-id <id>", "Meshy rigging task ID").requiredOption("--action-id <n>", "Animation preset ID (see docs for full list)").option("--fps <n>", "Target frame rate: 24, 25, 30, or 60").option("--output-dir <dir>", "Directory to save output", ".").action(async function(options) {
|
|
1379
|
+
try {
|
|
1380
|
+
const ctx = createContext(this);
|
|
1381
|
+
const params = {
|
|
1382
|
+
action_id: Number(options.actionId)
|
|
1383
|
+
};
|
|
1384
|
+
if (options.fps) {
|
|
1385
|
+
params.fps = Number(options.fps);
|
|
1386
|
+
}
|
|
1387
|
+
const data = await ctx.client.process3d({
|
|
1388
|
+
task_id: options.taskId,
|
|
1389
|
+
operation: "animate",
|
|
1390
|
+
params: toJsonObject2(params)
|
|
1391
|
+
});
|
|
1392
|
+
const localPath = await saveProcess3dOutput(data, "animate", options.outputDir);
|
|
1393
|
+
if (localPath) data.local_path = localPath;
|
|
1394
|
+
printSuccess("process3d.animate", data, ctx);
|
|
1395
|
+
} catch (error2) {
|
|
1396
|
+
printError("process3d.animate", error2);
|
|
1397
|
+
}
|
|
1398
|
+
})
|
|
1399
|
+
);
|
|
1364
1400
|
command.addCommand(
|
|
1365
1401
|
new Command7("refine").description("Refine a Meshy preview model into a higher quality result").requiredOption("--task-id <id>", "Meshy preview task ID").option("--pbr", "Enable PBR materials").option("--hd-texture", "Request 4K texture output").option("--texture-prompt <text>", "Optional texture prompt for the refinement pass").option("--ai-model <name>", "Meshy model: meshy-5, meshy-6, latest").option("--output-dir <dir>", "Directory to save output", ".").action(async function(options) {
|
|
1366
1402
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@doufunao123/asset-gateway",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.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.4.0",
|
|
31
31
|
"commander": "^13.1.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|