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 TripoSR mesh extraction; build UniRig on the CUDA devel base

nirholas8b2b8c1d97e7
diff --git a/workers/model-triposr/main.py b/workers/model-triposr/main.py
index 84e89d7fb..403e3beed 100644
--- a/workers/model-triposr/main.py
+++ b/workers/model-triposr/main.py
@@ -139,7 +139,10 @@ async def _run_inference(task_id: str, images: list[str], body_type: str) -> Non
def _generate():
with torch.no_grad():
scene_codes = _model([img_nobg], device="cuda")
- meshes = _model.extract_mesh(scene_codes, resolution=256)
+ # has_vertex_color is a required positional in current TripoSR;
+ # True also bakes vertex colors so the GLB isn't an untextured
+ # flat-grey mesh (TripoSR emits no PBR materials).
+ meshes = _model.extract_mesh(scene_codes, True, resolution=256)
mesh = meshes[0]
buf = io.BytesIO()
mesh.export(buf, file_type="glb")
diff --git a/workers/unirig/Dockerfile b/workers/unirig/Dockerfile
index cbf455a39..f605539ad 100644
--- a/workers/unirig/Dockerfile
+++ b/workers/unirig/Dockerfile
@@ -1,20 +1,26 @@
-FROM nvidia/cuda:12.1.1-cudnn8-runtime-ubuntu22.04
+FROM nvidia/cuda:12.1.1-cudnn8-devel-ubuntu22.04
+# devel (not runtime) base: the git-sourced UniRig package compiles CUDA point-
+# cloud / sparse-conv ops at install time and needs nvcc + a C++ toolchain.
+# TORCH_CUDA_ARCH_LIST targets the Cloud Run L4 (compute capability 8.9).
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
- DEBIAN_FRONTEND=noninteractive
+ DEBIAN_FRONTEND=noninteractive \
+ TORCH_CUDA_ARCH_LIST="8.9+PTX"
RUN apt-get update && apt-get install -y --no-install-recommends \
python3.10 python3.10-dev python3-pip \
- git curl wget \
+ git curl wget build-essential ninja-build \
libgl1 libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/* \
&& ln -sf /usr/bin/python3.10 /usr/bin/python3 \
&& ln -sf /usr/bin/python3.10 /usr/bin/python \
&& pip install --upgrade pip setuptools wheel
-RUN pip install torch==2.3.1 --index-url https://download.pytorch.org/whl/cu121
+# torch + torchvision first (cached layer), matching the CUDA 12.1 base. UniRig's
+# image/render utilities import torchvision, which isn't pulled in transitively.
+RUN pip install torch==2.3.1 torchvision==0.18.1 --index-url https://download.pytorch.org/whl/cu121
COPY requirements.txt /app/requirements.txt
RUN pip install -r /app/requirements.txt