I Built an Image to 3D Model App using LangGraph
Описание и применение
Core3D – это полностью автоматизированный конвейер, преобразующий одно изображение в интерактивную 3D‑модель, используя Gemini для геометрической подготовки, Hunyuan3D‑2 для генерации, 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