覆盖文生 3D、图生 3D、多视图、批量生成,以及重拓扑、绑定、动画、智能分割、 纹理、PBR、智能 UV、部件补全、格式导出与下载。 代码组织:一个功能一个模块(tripo/features/),入口薄壳 tripocli.py。
40 lines
1.5 KiB
Python
40 lines
1.5 KiB
Python
"""纹理放大 — upscale an existing texture.
|
||
|
||
tripocli upscale -p <project_id> --wait
|
||
|
||
实测(页面上真操作抓到的请求):
|
||
|
||
POST /v2/studio/operation/texture_upscaler
|
||
{"model_version": "v3.0-20250812", "project_id": "...", "texture_quality": "detailed"}
|
||
|
||
⚠️ 字段是 `texture_quality`(值为 `detailed`),不是 `texture_resolution`——
|
||
写成后者会得到 `1001 Fatal error on the server side`。
|
||
`model_version` 用项目当前的模型版本(从项目详情读取)。
|
||
界面上的 4K / 8K 选择**没有**出现在请求体里(实测默认档 4K 的请求体只有上面三个字段)。
|
||
"""
|
||
|
||
from . import _common
|
||
|
||
NAME = "upscale"
|
||
HELP = "纹理放大:提升贴图分辨率"
|
||
|
||
|
||
def add_arguments(parser):
|
||
_common.add_op_options(parser, "放大后的模型保存到该路径(可选)")
|
||
parser.add_argument("--quality", default="detailed", help="贴图质量(默认 detailed)")
|
||
|
||
|
||
def run(ctx):
|
||
args = ctx.args
|
||
model_version = _common.project_version(ctx.client, args.project, args.model)
|
||
if not model_version:
|
||
raise ValueError(f"无法读取项目 {args.project} 的 model_version,请用 -m 显式指定")
|
||
|
||
body = {
|
||
"project_id": args.project,
|
||
"model_version": model_version,
|
||
"texture_quality": args.quality,
|
||
}
|
||
data = ctx.client.get_data("POST", "/v2/studio/operation/texture_upscaler", body=body)
|
||
return _common.run_operator(ctx, data, output=args.output, wait=args.wait, label="纹理放大")
|