Installation instructions · Download source code (ZIP)
Image to Three.js helps Codex build an object from an image as a controllable 3D scene made of code. Use it for an interactive illustration, product view or prototype that you can rotate and change in a browser.
Tool features
This card covers img2threejs. It gives the assistant a skill and a workflow for shape, details, materials, lighting, interaction and checking the result.
The default output is Three.js code, not a ready-made mesh extracted from a photograph. For example, the assistant can construct a bicycle's frame, wheels and handlebars from separate parts. Unseen surfaces are inferred; extra views help refine the shape. This is not a way to obtain exact manufacturing dimensions.
For a generated model file from an image, see the different approach in TRELLIS.2. Do not confuse it with the base img2threejs workflow. Export capabilities and extra plugins are separate choices.
How to connect it to Codex
The installer requires Node.js 18 or newer and Git. Reconstruction scripts require Python 3.10 or newer. First have the assistant check what is installed, the selected client and any existing skill copy. The official CLI includes a codex host.
After agreeing to the installation, use the Codex-only route:
npx --yes img2threejs@latest install --host codex --dry-run
npx --yes img2threejs@latest install --host codex
npx --yes img2threejs@latest doctor
Without --host codex, the installer selects all detected hosts. Here, --yes allows npx to download the CLI package; it does not permit replacing another installation. --dry-run previews the skill installation without writing it, but npx may still download and execute the CLI. Get approval before previewing as well.
doctor checks the installed skill links, not the quality of a future model. The assistant checks whether img2threejs is available in the current task and identifies its source. If the client has not discovered it yet, it checks that client’s refresh instructions. The installer keeps a shared release checkout and host links; it refuses to blindly replace existing manual installations.
The separate @img2threejs/img2 package manages plugins. Installing it does not automatically install the base skill. Start with img2threejs alone and select extensions only for a required output.
How to make your first scene
- Provide your own image of one object and explain the scene's purpose. Agree on important details, useful views and acceptable simplifications. Supply another photo for an unknown rear view or agree on an approximate shape.
- Ask for a rough model, open it locally and compare its silhouette with the reference. Approve the basic shape before adding details, materials and lighting. Set an iteration limit to avoid spending usage on small details before checking the foundation.
- Test rotation, scale and touch controls, and check that the object is visible on desktop and mobile. Compare several views and check for blank or cropped scenes. Then optimise it for the intended site.
For a product card, proportions and a readable silhouette come before the body material. Reflections cannot fix the wrong shape. Keep the original image and scene code for later comparisons.
Where it fits in a guide
Use it at the useful 3D scene stage of interface design. Choose 3D when rotation helps someone understand an object; a normal illustration can remain an image.
Three.js Skills can help with cameras, materials, lighting and controls for an existing scene. It is extra guidance, not a required installation alongside img2threejs.
This route produces editable code and a local preview you can inspect. A complete website, a GLB file and an online deployment are separate outputs that need explicit agreement.
How to troubleshoot and update
For a blank scene, first check the project start command, browser errors, camera and object framing. If it looks wrong, revisit proportions and viewing angle instead of adding detail over the mistake.
Use the official update command with the selected host and a checked release. First determine whether the skill is CLI-managed or manually installed, and preserve custom changes. Do not place both installations at the same skill path.
Disconnecting the skill does not revert the scene code. To remove a connection, have the assistant locate the exact host link and explain what it will remove. Do not delete a shared release folder while other clients use it. Revert website code separately through project history. The repository uses Apache-2.0; check image rights and dependency licences separately.
Prompt for a scene from an image
Paste this into Codex or Work with project access and attach your image. The assistant agrees on the output and connection first, then builds and checks the scene.
Find the current project, its rules and my attached image. Help me build the pictured object as an editable Three.js scene with browser rotation. Find the available img2threejs skill. If it is missing, check Node.js, Git and Python, show the official --host codex installation for my client and wait for approval before running npx or changing connections. Do not install extra plugins automatically.
Agree on important details, acceptable simplifications and an iteration limit. Do not present unseen surfaces or dimensions as facts from the photograph. Build the rough shape first and show a local comparison with the reference. After approval, add details, materials and lighting using the current stack.
Check several views, mouse and touch controls, desktop and mobile, and that the canvas is not blank and the object is not cropped. Keep the source image and editable code. Fix shape and performance problems and show remaining differences. Do not upload the image to external services or publish the site without agreement.