种子字段的对外类型改成普通数字,不再导出 bigint
- shared-contracts:多视图请求与文生 / 图生参数的 seed 注记从 `bigint | null` 改成 `number | null`,并写明只支持 JS 安全整数范围(2^53-1)内的取值;Rust 侧仍是 `Option<i64>`,反序列化行为不变 - packages/shared:重新生成 model3d 绑定,seed 变成 `number | null`,请求体可以直接 JSON 序列化(带 bigint 的请求在 JSON.stringify 阶段必定抛错);顺带补上此前漏生成的多视图请求文档注释(「多视图生 3D」→「多视图生成 3D」) - docs/technical:在 Tripo Provider 集成方案里写明 seed 为什么按 number 导出、代价是超出 2^53-1 的取值无法从 TS 侧精确构造
This commit is contained in:
@@ -19,11 +19,12 @@ pub struct Model3dImageToModelParams {
|
||||
pub model: Model3dModelVersion,
|
||||
#[ts(optional = nullable)]
|
||||
pub enable_image_autofix: Option<bool>,
|
||||
// seed 是 i64,JS `number` 表示不了全部取值,因此按 bigint 导出,避免静默舍入。
|
||||
#[ts(type = "bigint | null")]
|
||||
// seed 是 i64;对外只按 JSON 数字传递,前端能精确表示的上限是 2^53-1(JS 安全整数),
|
||||
// 超出该范围的取值没法在前端精确构造,服务端仍按 i64 反序列化。
|
||||
#[ts(type = "number | null")]
|
||||
#[ts(optional = nullable)]
|
||||
pub model_seed: Option<i64>,
|
||||
#[ts(type = "bigint | null")]
|
||||
#[ts(type = "number | null")]
|
||||
#[ts(optional = nullable)]
|
||||
pub texture_seed: Option<i64>,
|
||||
#[ts(optional = nullable)]
|
||||
|
||||
@@ -79,13 +79,14 @@ pub struct Model3dMultiviewToModelRequest {
|
||||
pub inputs: Model3dMultiviewInputs,
|
||||
/// 模型版本;决定模型家族与可用的生成能力。
|
||||
pub model: Model3dModelVersion,
|
||||
// seed 是 i64,JS `number` 表示不了全部取值,因此按 bigint 导出,避免静默舍入。
|
||||
// seed 是 i64;对外只按 JSON 数字传递,前端能精确表示的上限是 2^53-1(JS 安全整数),
|
||||
// 超出该范围的取值没法在前端精确构造,服务端仍按 i64 反序列化。
|
||||
/// 模型随机种子;固定后可复现同一几何体。
|
||||
#[ts(type = "bigint | null")]
|
||||
#[ts(type = "number | null")]
|
||||
#[ts(optional = nullable)]
|
||||
pub model_seed: Option<i64>,
|
||||
/// 贴图随机种子;固定后可复现同一贴图。
|
||||
#[ts(type = "bigint | null")]
|
||||
#[ts(type = "number | null")]
|
||||
#[ts(optional = nullable)]
|
||||
pub texture_seed: Option<i64>,
|
||||
/// 是否生成贴图;`false` 时只产出白模几何体。
|
||||
|
||||
@@ -19,14 +19,15 @@ pub struct Model3dTextToModelParams {
|
||||
pub model: Model3dModelVersion,
|
||||
#[ts(optional = nullable)]
|
||||
pub negative_prompt: Option<String>,
|
||||
// seed 是 i64,JS `number` 表示不了全部取值,因此按 bigint 导出,避免静默舍入。
|
||||
#[ts(type = "bigint | null")]
|
||||
// seed 是 i64;对外只按 JSON 数字传递,前端能精确表示的上限是 2^53-1(JS 安全整数),
|
||||
// 超出该范围的取值没法在前端精确构造,服务端仍按 i64 反序列化。
|
||||
#[ts(type = "number | null")]
|
||||
#[ts(optional = nullable)]
|
||||
pub image_seed: Option<i64>,
|
||||
#[ts(type = "bigint | null")]
|
||||
#[ts(type = "number | null")]
|
||||
#[ts(optional = nullable)]
|
||||
pub model_seed: Option<i64>,
|
||||
#[ts(type = "bigint | null")]
|
||||
#[ts(type = "number | null")]
|
||||
#[ts(optional = nullable)]
|
||||
pub texture_seed: Option<i64>,
|
||||
#[ts(optional = nullable)]
|
||||
|
||||
Reference in New Issue
Block a user