feat(model): Integrate Hunyuan3D Pro api as one of image/text-to-3D backend.#71
Open
HochCC wants to merge 6 commits into
Open
feat(model): Integrate Hunyuan3D Pro api as one of image/text-to-3D backend.#71HochCC wants to merge 6 commits into
HochCC wants to merge 6 commits into
Conversation
Adds HUNYUAN3D as a third backend alongside SAM3D and TRELLIS for both
img3d-cli and text3d-cli, calling Tencent Cloud Hunyuan3D Pro via the
SubmitHunyuanTo3DProJob action. Result tree (mesh/material.mtl +
Material.001.png + <asset>.obj/.glb/_collision.obj + 4 PBR PNGs +
<asset>.urdf + video.mp4) matches the SAM3D/TRELLIS layout; gs.ply is
intentionally absent since Hunyuan has no Gaussian output.
- embodied_gen/models/hunyuan3d.py: new module with TC3-HMAC-SHA256 client
(stdlib http.client + urllib, no new deps), submit/poll/download flow
shared between image and text endpoints, GLB->OBJ+MTL+PBR export with
optional pre-align rotation (text endpoint sits 90 offset around the
up axis vs image), URDFGen-scaled GLB rewrite that restores PBR maps
the trimesh roundtrip strips.
- embodied_gen/scripts/imageto3d.py: --image3d_model selector with lazy
per-backend pipeline cache; HUNYUAN3D path early-continues to
process_image after segmentation. SAM3D/TRELLIS main loop unchanged.
- embodied_gen/scripts/textto3d.py: --image3d_model forwarded to
imageto3d for SAM3D/TRELLIS; HUNYUAN3D skips text-to-image and runs
process_prompt directly. PIPE_IMG / BG_REMOVER / SEMANTIC_CHECKER /
SEG_CHECKER lazily constructed so HUNYUAN3D runs do not load SD/Flux.
--n_pipe_retry forced to 1 in HUNYUAN3D mode (Tencent API is billed
per submit).
- embodied_gen/data/utils.py: save_mesh_with_mtl glossiness default 250
so Blender's OBJ Phong path shows specular highlights instead of the
trimesh-default Ns=1 matte.
- embodied_gen/validators/urdf_convertor.py: URDF template empty
<gs_model></gs_model> to avoid the XML entity escape when no Gaussian
path is set.
- embodied_gen/data/backproject_v3.py: raise --n_max_faces default to
50000 for richer SAM3D output.
- docs/tutorials/{image,text}_to_3d.md: backend selector + Hunyuan3D
credential setup + proxy notes.
Credentials read from TENCENT_SECRET_ID / TENCENT_SECRET_KEY (or
TENCENTCLOUD_* fallbacks); missing credentials fail fast before any
network I/O. Logs never include secrets, signed headers, base64 image
payloads, or signed download URLs. HTTPS_PROXY tunneled via
HTTPSConnection.set_tunnel since http.client does not auto-honor the env.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds HUNYUAN3D as a third backend alongside SAM3D and TRELLIS for both img3d-cli and text3d-cli, calling Tencent Cloud Hunyuan3D Pro via the SubmitHunyuanTo3DProJob action.
