Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

fix(model-hunyuan3d): buildable image for the Hunyuan3D-2 lane

nirholas1084b4b04933
diff --git a/workers/model-hunyuan3d/Dockerfile b/workers/model-hunyuan3d/Dockerfile
index 031e488d0..daaf08eab 100644
--- a/workers/model-hunyuan3d/Dockerfile
+++ b/workers/model-hunyuan3d/Dockerfile
@@ -27,6 +27,22 @@ RUN pip install torch==2.3.1 torchvision==0.18.1 --index-url https://download.py
COPY requirements.txt /app/requirements.txt
RUN pip install -r /app/requirements.txt
+# hy3dgen from a pinned Tencent/Hunyuan3D-2 clone (moving `main` broke the
+# reproducibility bar today on model-trellis; never build from a branch). The
+# texgen pipeline needs two in-tree extensions compiled against the image's
+# torch: custom_rasterizer (CUDA) and differentiable_renderer's mesh_processor
+# (pybind11). --no-build-isolation is REQUIRED — their setup.py imports torch
+# at build time and PEP517 isolation would hide the one installed above.
+RUN git clone https://github.com/Tencent/Hunyuan3D-2.git /tmp/hy3d \
+ && cd /tmp/hy3d \
+ && git checkout f8db63096c8282cb27354314d896feba5ba6ff8a \
+ && pip install --no-build-isolation . \
+ && cd hy3dgen/texgen/custom_rasterizer \
+ && pip install --no-build-isolation . \
+ && cd ../differentiable_renderer \
+ && pip install --no-build-isolation . \
+ && rm -rf /tmp/hy3d
+
WORKDIR /app
COPY worker_security.py /app/worker_security.py
COPY main.py /app/main.py
diff --git a/workers/model-hunyuan3d/cloudbuild.yaml b/workers/model-hunyuan3d/cloudbuild.yaml
index fc125f1ce..f61e9ed11 100644
--- a/workers/model-hunyuan3d/cloudbuild.yaml
+++ b/workers/model-hunyuan3d/cloudbuild.yaml
@@ -5,12 +5,16 @@ substitutions:
_REPO: model-hunyuan3d
_GCS_BUCKET: three-ws-avatar-reconstructions
_WEIGHTS_BUCKET: three-ws-model-weights
- # min=1: model-trellis found a cold FUSE-mounted weight load (this tree is
- # 13.89 GiB, larger than TRELLIS's 3 GiB) can stall 15+ minutes instead of
- # loading in seconds — keeping one instance warm avoids paying that on every
- # idle-to-active transition. GCP credit budget covers the always-on GPU-hour.
+ # min=1: model-trellis found a cold FUSE-mounted weight load (this tree
+ # loads ~25 GiB across three sub-models, far larger than TRELLIS's 3 GiB)
+ # can stall 15+ minutes instead of loading in seconds — keeping one instance
+ # warm avoids paying that on every idle-to-active transition. GCP credit
+ # budget covers the always-on GPU-hour.
+ # max=1: the region's Cloud Run L4 allocation is shared with model-trellis
+ # (min 1) and unirig (min 1); one standing Hunyuan3D instance fills the
+ # known quota of 3, so a second instance could never schedule anyway.
_MIN_INSTANCES: "1"
- _MAX_INSTANCES: "3"
+ _MAX_INSTANCES: "1"
steps:
- id: build
@@ -57,7 +61,7 @@ steps:
- --allow-unauthenticated
- --add-volume=name=weights,type=cloud-storage,bucket=${_WEIGHTS_BUCKET}
- --add-volume-mount=volume=weights,mount-path=/weights
- - --set-env-vars=GCS_BUCKET=${_GCS_BUCKET},WEIGHTS_DIR=/weights/hunyuan3d-2.1,MAX_CONCURRENT=1
+ - --set-env-vars=GCS_BUCKET=${_GCS_BUCKET},WEIGHTS_DIR=/weights/hunyuan3d-2,MAX_CONCURRENT=1
- --set-secrets=API_KEY=avatar-reconstruction-key:latest
images:
diff --git a/workers/model-hunyuan3d/requirements.txt b/workers/model-hunyuan3d/requirements.txt
index a1e8112e6..fc25933c0 100644
--- a/workers/model-hunyuan3d/requirements.txt
+++ b/workers/model-hunyuan3d/requirements.txt
@@ -1,14 +1,29 @@
-# ── Hunyuan3D-2.1 ─────────────────────────────────────────────────────────────
-# Install from the official Tencent repo. The hy3dgen package includes both the
-# shape generation (DiT) and texture painting (Paint) pipelines.
-hy3dgen @ git+https://github.com/Tencent/Hunyuan3D-2.git@main#subdirectory=hy3dgen
+# hy3dgen itself is installed in the Dockerfile from a pinned clone of
+# Tencent/Hunyuan3D-2 (its texgen CUDA/pybind11 extensions must be compiled
+# in-tree; a bare pip VCS install of the package subdirectory does not build
+# them). Everything here is pinned or bounded: the 2026-07-16 model-trellis
+# outage proved an unpinned transformers resolves a torch-2.5-era release
+# (DTensor import) that fails to load on the torch pinned below.
-torch>=2.3.0
-diffusers>=0.31.0
-transformers>=4.44.0
-accelerate>=0.34.0
+# ── Model stack (torch 2.3.1/cu121 era, matching the Dockerfile pin) ─────────
+diffusers==0.31.0
+transformers==4.46.3
+accelerate==0.34.2
safetensors>=0.4.0
-trimesh>=4.4.0
+einops==0.8.0
+omegaconf==2.3.0
+numpy==1.26.4
+
+# ── Geometry / texture processing (hy3dgen shapegen + texgen runtime deps) ───
+trimesh==4.5.3
+pymeshlab==2023.12.post2
+pygltflib==1.16.2
+xatlas==0.0.9
+opencv-python-headless==4.10.0.84
+
+# ── Input preprocessing (hy3dgen.rembg background removal) ───────────────────
+rembg==2.0.59
+onnxruntime==1.20.1
# ── Image processing ──────────────────────────────────────────────────────────
Pillow>=10.3.0