Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion docs/tutorials/image_to_3d.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,32 @@ Generate **physically plausible 3D assets** from a single input image, supportin
---

## ⚡ Command-Line Usage
Support the use of [SAM3D](https://github.com/facebookresearch/sam-3d-objects) or [TRELLIS](https://github.com/microsoft/TRELLIS) as 3D generation model, modify `IMAGE3D_MODEL` in `embodied_gen/scripts/imageto3d.py` to switch model.
Three 3D generation backends are supported:

- [`SAM3D`](https://github.com/facebookresearch/sam-3d-objects) — local model (default)
- [`TRELLIS`](https://github.com/microsoft/TRELLIS) — local model
- `HUNYUAN3D` — Tencent Hunyuan3D Pro cloud API (no local GPU model needed)

Select the backend via `--image3d_model` (case-insensitive). Omit to use the default `SAM3D`.

```bash
img3d-cli --image_path apps/assets/example_image/sample_00.jpg \
apps/assets/example_image/sample_01.jpg \
--n_retry 2 --output_root outputs/imageto3d
```

### Using the Hunyuan3D Cloud Backend

Hunyuan3D Pro runs entirely on Tencent Cloud — useful when you don't have a local GPU. It requires Tencent Cloud Hunyuan3D `SecretId` / `SecretKey` and network access to `ai3d.tencentcloudapi.com` and the COS download host.

```bash
export TENCENT_SECRET_ID='your-secret-id'
export TENCENT_SECRET_KEY='your-secret-key'
img3d-cli --image3d_model HUNYUAN3D \
--image_path apps/assets/example_image/sample_00.jpg \
--output_root outputs/imageto3d_hunyuan
```

You will get the following results:

<div class="swiper swiper1" style="max-width: 1000px; margin: 20px auto; border-radius: 12px;">
Expand Down
21 changes: 21 additions & 0 deletions docs/tutorials/text_to_3d.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,27 @@ bash embodied_gen/scripts/textto3d.sh \

> Models with more permissive licenses can be found in `embodied_gen/models/image_comm_model.py`.

### Choosing the 3D Backend

Three 3D generation backends are supported via `--image3d_model` (case-insensitive):

- `SAM3D` (default) — text → image → 3D, local SAM3D model
- `TRELLIS` — text → image → 3D, local TRELLIS model
- `HUNYUAN3D` — Tencent Hunyuan3D Pro **text-to-3D** API; skips the text-to-image stage entirely and generates 3D directly from the prompt

### Using the Hunyuan3D Cloud Backend

Hunyuan3D Pro takes the prompt directly to a 3D mesh (no GPU model loaded locally; one job ≈ 3 minutes; Tencent Cloud is billed per submit). Set up credentials once:

```bash
export TENCENT_SECRET_ID='your-secret-id'
export TENCENT_SECRET_KEY='your-secret-key'
text3d-cli --image3d_model HUNYUAN3D \
--prompts "small bronze figurine of a lion" \
--output_root outputs/textto3d_hunyuan
```



The generated results are organized as follows:
```sh
Expand Down
2 changes: 1 addition & 1 deletion embodied_gen/data/backproject_v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ def parse_args():
parser.add_argument(
"--save_glb_path", type=str, default=None, help="Save glb path."
)
parser.add_argument("--n_max_faces", type=int, default=30000)
parser.add_argument("--n_max_faces", type=int, default=50000)
args, unknown = parser.parse_known_args()

return args
Expand Down
3 changes: 3 additions & 0 deletions embodied_gen/data/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,7 @@ def save_mesh_with_mtl(
output_path: str,
material_base=(250, 250, 250, 255),
mesh_process: bool = True,
glossiness: float = 250.0,
) -> trimesh.Trimesh:
if isinstance(texture, np.ndarray):
texture = Image.fromarray(texture)
Expand All @@ -742,6 +743,8 @@ def save_mesh_with_mtl(
diffuse=material_base,
ambient=material_base,
specular=material_base,
# 250 gives a tight visible highlight similar to glossy plastic.
glossiness=glossiness,
)

dir_name = os.path.dirname(output_path)
Expand Down
Loading
Loading