From c0d6531e929e4961b5aa1dfd5abc4798f54ed6a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Mon, 21 Sep 2026 19:38:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=89=E4=B8=AA=E5=85=A5=E5=8F=A3=E7=9A=84se?= =?UTF-8?q?ed=E5=8F=82=E6=95=B0=E5=9C=A8TS=E5=A5=91=E7=BA=A6=E9=87=8C?= =?UTF-8?q?=E6=94=B9=E7=94=A8bigint=20-=20seed=20=E6=98=AF=20i64=EF=BC=8CJ?= =?UTF-8?q?S=20number=20=E8=A1=A8=E7=A4=BA=E4=B8=8D=E4=BA=86=E5=85=A8?= =?UTF-8?q?=E9=83=A8=E5=8F=96=E5=80=BC=E5=8D=B4=E5=8F=88=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E8=8C=83=E5=9B=B4=E6=A0=A1=E9=AA=8C=EF=BC=8C=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E7=AB=AF=E4=BC=A0=2064=20=E4=BD=8D=E5=80=BC=E4=BC=9A=E8=A2=AB?= =?UTF-8?q?=E9=9D=99=E9=BB=98=E8=88=8D=E5=85=A5=20-=20text=5Fto=5Fmodel=20?= =?UTF-8?q?/=20image=5Fto=5Fmodel=20/=20multiview=5Fto=5Fmodel=20=E7=9A=84?= =?UTF-8?q?=20image=5Fseed=E3=80=81model=5Fseed=E3=80=81texture=5Fseed=20?= =?UTF-8?q?=E7=94=B1=20number|null=20=E6=94=B9=E4=B8=BA=20bigint|null=20-?= =?UTF-8?q?=20=E5=90=8C=E6=AD=A5=E9=87=8D=E6=96=B0=E7=94=9F=E6=88=90?= =?UTF-8?q?=E7=9A=84=20ts-rs=20=E7=BB=91=E5=AE=9A=EF=BC=8C=E4=BB=85?= =?UTF-8?q?=E8=BF=99=E4=B8=89=E4=B8=AA=E5=AD=97=E6=AE=B5=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../model3d/image-to-model/Model3dImageToModelParams.ts | 4 ++-- .../multiview-to-model/Model3dMultiviewToModelRequest.ts | 4 ++-- .../model3d/text-to-model/Model3dTextToModelParams.ts | 6 +++--- .../shared-contracts/src/model3d/image_to_model/params.rs | 5 +++-- .../src/model3d/multiview_to_model/request.rs | 5 +++-- .../shared-contracts/src/model3d/text_to_model/params.rs | 7 ++++--- 6 files changed, 17 insertions(+), 14 deletions(-) diff --git a/packages/shared/src/contracts/model3d/image-to-model/Model3dImageToModelParams.ts b/packages/shared/src/contracts/model3d/image-to-model/Model3dImageToModelParams.ts index 031f12a70..274ad169b 100644 --- a/packages/shared/src/contracts/model3d/image-to-model/Model3dImageToModelParams.ts +++ b/packages/shared/src/contracts/model3d/image-to-model/Model3dImageToModelParams.ts @@ -17,8 +17,8 @@ import type { Model3dTextureVersion } from '../common/Model3dTextureVersion'; export type Model3dImageToModelParams = { model: Model3dModelVersion; enableImageAutofix?: boolean | null; - modelSeed?: number | null; - textureSeed?: number | null; + modelSeed?: bigint | null; + textureSeed?: bigint | null; texture?: boolean | null; pbr?: boolean | null; textureQuality?: Model3dTextureQuality | null; diff --git a/packages/shared/src/contracts/model3d/multiview-to-model/Model3dMultiviewToModelRequest.ts b/packages/shared/src/contracts/model3d/multiview-to-model/Model3dMultiviewToModelRequest.ts index 152def9bb..f9fc93903 100644 --- a/packages/shared/src/contracts/model3d/multiview-to-model/Model3dMultiviewToModelRequest.ts +++ b/packages/shared/src/contracts/model3d/multiview-to-model/Model3dMultiviewToModelRequest.ts @@ -12,8 +12,8 @@ import type { Model3dMultiviewInputs } from './Model3dMultiviewInputs'; export type Model3dMultiviewToModelRequest = { inputs: Model3dMultiviewInputs; model: Model3dModelVersion; - modelSeed?: number | null; - textureSeed?: number | null; + modelSeed?: bigint | null; + textureSeed?: bigint | null; texture?: boolean | null; pbr?: boolean | null; textureQuality?: Model3dTextureQuality | null; diff --git a/packages/shared/src/contracts/model3d/text-to-model/Model3dTextToModelParams.ts b/packages/shared/src/contracts/model3d/text-to-model/Model3dTextToModelParams.ts index e8520db02..68f76b2f1 100644 --- a/packages/shared/src/contracts/model3d/text-to-model/Model3dTextToModelParams.ts +++ b/packages/shared/src/contracts/model3d/text-to-model/Model3dTextToModelParams.ts @@ -16,9 +16,9 @@ export type Model3dTextToModelParams = { prompt: string; model: Model3dModelVersion; negativePrompt?: string | null; - imageSeed?: number | null; - modelSeed?: number | null; - textureSeed?: number | null; + imageSeed?: bigint | null; + modelSeed?: bigint | null; + textureSeed?: bigint | null; texture?: boolean | null; pbr?: boolean | null; textureQuality?: Model3dTextureQuality | null; diff --git a/server-rs/crates/shared-contracts/src/model3d/image_to_model/params.rs b/server-rs/crates/shared-contracts/src/model3d/image_to_model/params.rs index 4e9464874..2780c45ea 100644 --- a/server-rs/crates/shared-contracts/src/model3d/image_to_model/params.rs +++ b/server-rs/crates/shared-contracts/src/model3d/image_to_model/params.rs @@ -19,10 +19,11 @@ pub struct Model3dImageToModelParams { pub model: Model3dModelVersion, #[ts(optional = nullable)] pub enable_image_autofix: Option, - #[ts(type = "number | null")] + // seed 是 i64,JS `number` 表示不了全部取值,因此按 bigint 导出,避免静默舍入。 + #[ts(type = "bigint | null")] #[ts(optional = nullable)] pub model_seed: Option, - #[ts(type = "number | null")] + #[ts(type = "bigint | null")] #[ts(optional = nullable)] pub texture_seed: Option, #[ts(optional = nullable)] diff --git a/server-rs/crates/shared-contracts/src/model3d/multiview_to_model/request.rs b/server-rs/crates/shared-contracts/src/model3d/multiview_to_model/request.rs index 6250e6adc..5196df866 100644 --- a/server-rs/crates/shared-contracts/src/model3d/multiview_to_model/request.rs +++ b/server-rs/crates/shared-contracts/src/model3d/multiview_to_model/request.rs @@ -45,10 +45,11 @@ pub enum Model3dMultiviewInputs { pub struct Model3dMultiviewToModelRequest { pub inputs: Model3dMultiviewInputs, pub model: Model3dModelVersion, - #[ts(type = "number | null")] + // seed 是 i64,JS `number` 表示不了全部取值,因此按 bigint 导出,避免静默舍入。 + #[ts(type = "bigint | null")] #[ts(optional = nullable)] pub model_seed: Option, - #[ts(type = "number | null")] + #[ts(type = "bigint | null")] #[ts(optional = nullable)] pub texture_seed: Option, #[ts(optional = nullable)] diff --git a/server-rs/crates/shared-contracts/src/model3d/text_to_model/params.rs b/server-rs/crates/shared-contracts/src/model3d/text_to_model/params.rs index 12d94b2f0..82abb7e24 100644 --- a/server-rs/crates/shared-contracts/src/model3d/text_to_model/params.rs +++ b/server-rs/crates/shared-contracts/src/model3d/text_to_model/params.rs @@ -19,13 +19,14 @@ pub struct Model3dTextToModelParams { pub model: Model3dModelVersion, #[ts(optional = nullable)] pub negative_prompt: Option, - #[ts(type = "number | null")] + // seed 是 i64,JS `number` 表示不了全部取值,因此按 bigint 导出,避免静默舍入。 + #[ts(type = "bigint | null")] #[ts(optional = nullable)] pub image_seed: Option, - #[ts(type = "number | null")] + #[ts(type = "bigint | null")] #[ts(optional = nullable)] pub model_seed: Option, - #[ts(type = "number | null")] + #[ts(type = "bigint | null")] #[ts(optional = nullable)] pub texture_seed: Option, #[ts(optional = nullable)]