tripocli v2.0.0:Tripo AI 3D 生成与加工 CLI(面向 Agent 与开发者,纯 Python 标准库、零第三方依赖)
覆盖文生 3D、图生 3D、多视图、批量生成,以及重拓扑、绑定、动画、智能分割、 纹理、PBR、智能 UV、部件补全、格式导出与下载。 代码组织:一个功能一个模块(tripo/features/),入口薄壳 tripocli.py。
This commit is contained in:
commit
977f97995a
60 files changed
+5622
No files matched your search
@@ -0,0 +1,36 @@
|
||||
"""图片资产列表 — list the image assets you have generated.
|
||||
|
||||
tripocli imgs --size 10
|
||||
|
||||
实测:`POST /v2/studio/image/image_assets` body `{page_num, page_size}`,
|
||||
返回 `{assets:[{asset_id, input:{prompt, prompt_image:[{bucket,key,url}]}, ...}]}`。
|
||||
"""
|
||||
|
||||
NAME = "imgs"
|
||||
HELP = "列出我的图片资产(生成过的参考图)"
|
||||
|
||||
|
||||
def add_arguments(parser):
|
||||
parser.add_argument("--page", type=int, default=1, help="页码(默认 1)")
|
||||
parser.add_argument("--size", type=int, default=8, help="每页数量(默认 8)")
|
||||
|
||||
|
||||
def run(ctx):
|
||||
args = ctx.args
|
||||
data = ctx.client.get_data(
|
||||
"POST", "/v2/studio/image/image_assets",
|
||||
body={"page_num": args.page, "page_size": args.size},
|
||||
) or {}
|
||||
assets = data.get("assets") or []
|
||||
|
||||
def show():
|
||||
for item in assets:
|
||||
source = item.get("input") or {}
|
||||
prompt = source.get("prompt_text") or source.get("prompt") or ""
|
||||
ctx.out.line(f" {item.get('asset_id')} [{item.get('status', '')}] {prompt[:56]}")
|
||||
pictures = ((item.get("output") or {}).get("data")) or source.get("prompt_image") or []
|
||||
for picture in pictures[:2]:
|
||||
ctx.out.line(f" {picture.get('url', '')[:100]}")
|
||||
|
||||
ctx.out.data({"assets": assets}, human=show)
|
||||
return data
|
||||
Reference in new issue
Block a user