refactor: rename project to hy3d, full CLI overhaul

- package hunyuan3dweb/ -> hy3d/ (imports: from hy3d import ...)
- CLI: MiniMax-style verb/noun commands (quota/list/status/formats/
  download/text/image/multi-view/sketch/animate/texture/topo/cancel/
  share/auth/config), global --json/--cookies, env HY3D_COOKIES/HY3D_JSON
- exit codes: 0 ok / 1 env / 2 auth-expired / 3 cookie-missing
- generation commands support --wait polling with stderr progress
- local images auto-upload to COS in image/multi-view/sketch/animate/texture/topo
- old commands removed (no backwards compat)
- config dir kept at ~/.config/hunyuan3dweb to preserve existing cookies
- deps: requests>=2.32.3, browser extras cloakbrowser>=0.3.31/playwright>=1.40
- skill updated: bin/hy3d shim replaces driver.sh; all commands live-verified
This commit is contained in:
2026-08-15 22:31:50 +08:00
parent 956b015ee0
commit acfe5e7ac2
23 changed files with 842 additions and 862 deletions
+18 -18
View File
@@ -60,7 +60,7 @@ sign = HMAC-SHA256(param_str, key="Hf6d6KFB3D")
4. 获得 `resourceUrl` 供后续图生3D API 使用
```python
from hunyuan3dweb.cos_upload import upload_image
from hy3d.cos_upload import upload_image
resource_url = upload_image("/path/to/image.png")
```
@@ -71,15 +71,15 @@ resource_url = upload_image("/path/to/image.png")
| 文件 | 说明 |
|------|------|
| `hunyuan3dweb/sign.py` | 签名算法纯 Python 实现 |
| `hunyuan3dweb/api.py` | 基础 API 客户端(图生3D、文生3D) |
| `hunyuan3dweb/api_complete.py` | 完整 API 客户端(所有生成模式) |
| `hunyuan3dweb/cos_upload.py` | 纯 Python COS 上传工具(无需浏览器) |
| `hunyuan3dweb/config.py` | 用户配置路径管理(cookie、profile |
| `hunyuan3dweb/cli.py` | CLI 入口 |
| `hunyuan3dweb/browser/login.py` | 浏览器自动化登录工具 |
| `hunyuan3dweb/browser/generator.py` | 浏览器自动化图生3D |
| `hunyuan3dweb/browser/sniffer.py` | API 请求嗅探工具 |
| `hy3d/sign.py` | 签名算法纯 Python 实现 |
| `hy3d/api.py` | 基础 API 客户端(图生3D、文生3D) |
| `hy3d/api_complete.py` | 完整 API 客户端(所有生成模式) |
| `hy3d/cos_upload.py` | 纯 Python COS 上传工具(无需浏览器) |
| `hy3d/config.py` | 用户配置路径管理(cookie、profile |
| `hy3d/cli.py` | CLI 入口 |
| `hy3d/browser/login.py` | 浏览器自动化登录工具 |
| `hy3d/browser/generator.py` | 浏览器自动化图生3D |
| `hy3d/browser/sniffer.py` | API 请求嗅探工具 |
---
@@ -88,7 +88,7 @@ resource_url = upload_image("/path/to/image.png")
### 1. 登录获取 Cookie
```bash
hunyuan3dweb-login
hy3d-login
# 按提示输入邮箱和验证码
# 登录状态自动保存到 ~/.config/hunyuan3dweb/profile
# Cookie 同时导出到 ~/.config/hunyuan3dweb/cookies.txt
@@ -102,7 +102,7 @@ hunyuan3dweb-login
### 2. 纯 Python 生成3D模型
```python
from hunyuan3dweb import Hunyuan3DAPI
from hy3d import Hunyuan3DAPI
# 自动从 ~/.config/hunyuan3dweb/cookies.txt 加载 cookie
api = Hunyuan3DAPI()
@@ -120,8 +120,8 @@ status = api.get_generation_status(result["creationsId"])
### 3. 本地图片上传 + 图生3D(纯 Python
```python
from hunyuan3dweb.cos_upload import upload_image
from hunyuan3dweb import Hunyuan3DAPIComplete
from hy3d.cos_upload import upload_image
from hy3d import Hunyuan3DAPIComplete
# 上传本地图片到 COS
resource_url = upload_image("/path/to/image.png")
@@ -135,16 +135,16 @@ result = api.generate_from_image(resource_url, title="我的模型")
```bash
# 列出某个创作所有可用的下载格式
hunyuan3dweb formats <creation_id>
hy3d formats <creation_id>
# 包含转换格式(fbx, stl, usdz, mp4, gif
hunyuan3dweb formats <creation_id> --converted
hy3d formats <creation_id> --converted
# 下载指定格式(默认 glb
hunyuan3dweb download <creation_id> --format glb -o model.glb
hy3d download <creation_id> --format glb -o model.glb
# 下载转换格式(如 usdz
hunyuan3dweb download <creation_id> --format usdz --converted -o model.usdz
hy3d download <creation_id> --format usdz --converted -o model.usdz
```
---