"""单图生 3D — image to model. tripocli image -i ./chair.png --wait -o chair.glb The local file is uploaded straight to S3 with SigV4 and then audited; both steps are required before the generation endpoint accepts the image. """ from . import _common NAME = "image" HELP = "单张图片生成 3D 模型(图生 3D)" def add_arguments(parser): parser.add_argument("-i", "--image", required=True, help="本地图片路径 (png/jpg/webp)") _common.add_generation_options(parser) _common.add_wait_options(parser, "生成完成后保存的 .glb 路径") def run(ctx): args = ctx.args ctx.out.line(f"📤 上传并审核图片: {args.image}") image = ctx.client.upload_image(args.image) body = _common.generation_body(args) data = ctx.client.get_data( "POST", "/v2/studio/operation/image_to_model", body={"image": image, **body} ) return _common.finish_single(ctx, data, output=args.output, wait=args.wait)