explaingit

hoainho/img2threejs

Analysis updated 2026-05-18

1,903PythonAudience · developerComplexity · 4/5LicenseSetup · hard

TLDR

Turns one photo of an object into a working, animatable 3D model built entirely from code, using an AI coding agent.

Mindmap

mindmap
  root((img2threejs))
    What it does
      Photo to 3D model
      Code only reconstruction
      Animation ready
    Tech stack
      Python
      Three.js
      TypeScript
    Use cases
      Product visualization
      Game asset generation
      Character prototyping
    Audience
      Developers
      AI agent users

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Turn a product photo into a 3D model you can rotate and view in a browser.

USE CASE 2

Generate game-ready 3D assets from reference images without manual 3D modeling.

USE CASE 3

Build animation-ready 3D characters or props from a single picture.

USE CASE 4

Prototype 3D scenes quickly using an AI coding agent instead of a 3D modeling tool.

What is it built with?

PythonThree.jsTypeScript

How does it compare?

hoainho/img2threejsfacebookresearch/denoisertencent-hunyuan/hy-world-2.0
Stars1,9031,9001,911
LanguagePythonPythonPython
Last pushed2023-03-14
MaintenanceDormant
Setup difficultyhardmoderatehard
Complexity4/53/55/5
Audiencedevelopergeneralresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1h+

Requires running inside an AI coding agent (Claude Code, Codex, or OpenCode) with image or browser tooling available.

MIT license: free to use, modify, and share, including commercially, as long as you keep the copyright notice.

In plain English

img2threejs takes a single reference photo of an object and turns it into a working 3D model made entirely of code. Instead of extracting a mesh from the photo or downloading ready-made art, it writes a program that builds the shape from basic 3D building blocks, shaders, and generated geometry, so what you get is a live, animatable model rather than a static file. The tool is meant to be run inside an AI coding agent such as Claude Code, Codex, or OpenCode. Whichever agent is hosting it, img2threejs uses that agent's own way of looking at images, whether that is reading the picture directly, using a browser tool, or working from a screenshot someone provides. It handles both objects and characters differently. Plain objects, like a knife or a shotgun, go through a pipeline built for hard surfaces. Characters go through a separate track that pays attention to things like head proportions, facial features, and pose. Before it writes any code, the tool first lists out every small identifying detail in the photo, such as bevels, screws, engravings, or wear marks, and it will not move forward until that list is complete enough for the object's complexity. Building the model happens in a fixed sequence of passes, starting from a rough blockout and moving through structure, materials, surface detail, lighting, and final optimization. After each pass, the tool renders the model, takes a screenshot, and compares it against the reference image. It only continues to the next pass if that comparison scores well enough, and if a pass falls short, the tool automatically goes back and fixes either the plan or the code before trying again. The end result is a Three.js model with a real internal structure, meaning parts like pivots, sockets, and moving pieces are already set up, so the model is ready to animate rather than being an inert 3D shape.

Copy-paste prompts

Prompt 1
Use img2threejs to reconstruct this reference image as a Three.js model.
Prompt 2
Explain the staged sculpting pipeline img2threejs uses to build a 3D model from a photo.
Prompt 3
What is the difference between how img2threejs handles objects versus characters?
Prompt 4
Walk me through how img2threejs decides when a build pass is good enough to continue.
Prompt 5
Show me how to run img2threejs inside Claude Code or Codex.

Frequently asked questions

What is img2threejs?

Turns one photo of an object into a working, animatable 3D model built entirely from code, using an AI coding agent.

What language is img2threejs written in?

Mainly Python. The stack also includes Python, Three.js, TypeScript.

What license does img2threejs use?

MIT license: free to use, modify, and share, including commercially, as long as you keep the copyright notice.

How hard is img2threejs to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is img2threejs for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.