img2threejs is a Python-based tool that generates a Three.js Group factory from a single reference image, outputting TypeScript code and a JSON spec for animation-ready models.

What it is
Rebuild the object in a reference image as a code-only, procedural Three.js model. Quality-gated, animation-ready, and deliberately token-efficient — reconstruction-by-code, not photogrammetry, mesh extraction, or downloaded art packs.
How it works
The tool runs a staged pipeline where scripts gate each stage and the agent's vision approves passes. It generates a TypeScript factory (Three.js Group) for the current unlocked pass and renders a side-by-side comparison at each step. The process emphasizes a runtime hierarchy exposed via root.userData.sculptRuntime and outputs a diffable TypeScript plus a JSON spec.
Getting started
Quick start
- Install — place this folder in your skills directory:
git clone https://github.com/hoainho/img2threejs.git ~/.claude/skills/img2threejs
- Invoke — in Claude Code, attach or point to an object image and run:
/img2threejs Rebuild this object as a Three.js model, keep the proportions, angles, and colours.
- Follow the pipeline — the skill validates the image, writes an assessment and spec, generates the factory pass by pass, and shows you a side-by-side comparison at each step until the render matches.
The scripts run from the skill root and need only Python 3.10+ — nothing to install.
python3 forge/stage1_intake/probe_image.py <image>
python3 forge/stage2_spec/new_pre_spec_assessment.py "Name" --image <image> --out assessment.json
python3 forge/stage2_spec/new_sculpt_spec.py "Name" --image <image> --assessment assessment.json --out spec.json
python3 forge/stage2_spec/validate_sculpt_spec.py spec.json --strict-quality
python3 forge/stage3_build/generate_threejs_factory.py spec.json --out src/createObjectModel.ts
Recent releases
- none
Traction
- stars_1d: 482
License
MIT.






