I Built an Image to 3D Model App using LangGraph
说明与用途
Core3D 是一个完整的自动化管道,使用 Gemini 进行几何预处理,Hunyuan3D‑2 生成 3D 模型,Trimesh 进行修复,并通过 FastAPI/Next.js 提供 API 和 UI。
问题
Can a single 2D image be turned into a usable 3D model?
结果
Core3D delivers a fully automated image‑to‑3D pipeline that runs in ~22 s, producing a clean, browser‑ready .GLB with automatic repair and validation, and a user interface for inspection and persistence.
工作流
- Upload image and optional prompt via POST /generate
- Preprocess image with U2‑Net/rembg, crop, pad, resize to 1024×1024
- Send preprocessed image to Gemini 3.1 Flash‑Lite for geometric description
- Use description as prompt for Hunyuan3D‑2 via Hugging Face ZeroGPU to generate raw GLB
- Process raw GLB with Trimesh: fix inversions, normals, holes, decimate if >45k faces
- Validate mesh (face count, is_valid flag); if invalid, retry once
- Return final GLB to frontend
- Render GLB in browser with
<model‑viewer> - Persist GLB in IndexedDB for reloads
证据
The end‑to‑end pipeline averages roughly 22 seconds in the project's benchmark.
The pipeline uses Trimesh repair functions to fix inversions, normals, and holes.
The frontend stores generated GLB assets in IndexedDB.
- 记录日期: 2026-09-07T06:25:14.951Z