Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
I

img2threejs

> AI 编程
Open source

Rebuild the object in a reference image as a code-only, procedural, quality-gated, animation-ready Three.js model. Token-efficient image-to-3D.

8.9K stars0 likes1 views
WebsiteGitHub

About

Rebuild the object in a reference image as a code-only, procedural, quality-gated, animation-ready Three.js model. Token-efficient image-to-3D.

Reference images reconstructed in code as animation-ready Three.js models, running live in the browser.

→ Open the Live Demo Gallery

Every model in the gallery is generated code, running in your browser. No mesh files, no downloads.


Live demos

Reconstructions built entirely from primitives, procedural shaders, and generated geometry. Open any model to orbit it, inspect its reference, and read the generated source.

Demo Subject Built with View Source
Dual-Sword Warrior — TypeScript procedural surfaces ⚠︎ character v1.5.1 Live code
Low-Poly Humanoid — Rigged Character ⚠︎ character v1.5.0 Live code
★ Talon Knife | Doppler Ruby (Factory New) object v1.4.4 Live code
AWP | Medusa (Minimal Wear) · V2 rebuild object V2 Live code
Pikachu 10K Star Celebration ⚠︎ character v1.5-beta Live code
Glock-18 | Ghost Protocol (Well-Worn) object v1.4.1 Live code
Classic Knife | Fade (Minimal Wear) object v1.3 Live code
BMX Endurance Bike object v1.3 Live code
M9 Bayonet | Doppler Phase 2 object v1.3 Live code
Sony WF-1000XM3 Earbuds + Case object v1.2 Live code
ISSACA 12 Gauge Shotgun object v1.2 Live code
Gerber Paracord Knife object v1.2 Live code
Doraemon House (isometric diorama) object v1.2 Live code
War-Hauler "SECTOR 07" object v1.2 Live code
Crowned Loot Chest ⚠︎ object v1.2 Live code

⚠︎ marks a demo whose registry status is still placeholder rather than final — it renders, but it is not finished work. The Built with column is the version each demo's own registry entry records in generatedWith, not an inference from dates; awp-medusa-v2 records V2, which is that demo's rebuild pass rather than a release number. Rows are ordered newest first by the commit that added the demo.

The gallery source lives in img2threejs/img2threejs-showcase. If this project is useful, a star on this repo helps others find it.


What it does

You give it one reference image of an object. It produces a THREE.Group factory written in TypeScript that recreates that object from primitives, procedural shaders, and generated geometry — with a runtime hierarchy (pivots, sockets, colliders) so the result is ready to animate, not an inert lump.

It runs under Claude Code, Codex, or OpenCode. It is agent-agnostic: wherever the docs say "agent vision" or "agent browser tool", it uses whatever the host provides — native image reading, a browser MCP, the project preview, or a user-supplied screenshot.

Subjects and detail accuracy

  • Objects and characters. Each subject is classified object, character, or hybrid. Objects follow the hard-surface pipeline; characters route through an anatomy-aware track (head-unit proportions, facial landmarks, pose) documented in grimoire/character/reconstruction.md.
  • Detail-first analysis. Before code generation the pipeline enumerates a detailInventory of identity-defining small details (gloss, bevel/rounding, screws/rivets, engraved or painted linework, contours, stains and wear). Every detail must map to a real component or material entry, and a strict-quality gate blocks generation until the inventory is complete. Taxonomy: grimoire/intake/detail_inventory.md.
  • Maximum likeness for a specific person or character. An opt-in projection-first path fits a parametric template to image landmarks, de-lights the photo, camera-matches the render, and projects the reference onto the mesh. A single image cannot guarantee 100 percent likeness, so the pipeline reports per-region confidence and asks for more views when it matters. Details: grimoire/character/likeness_maximization.md.
  • Multi-view silhouette carving. An opt-in geometryDescriptor.visualHull intersects at least two deterministic orthographic binary silhouettes into a bounded, welded voxel mesh. It records unseen areas as low-confidence rather than inventing hidden detail. Schema and runtime check: grimoire/scripts.md.
  • CS2 weapon review gates. Knife and Glock-18 routes use family-specific component contracts. The review records exactness tier, family identity, painted-region and projection coverage, per-region confidence, approximation notes, and versioned review-scene metadata; component-coverage and map-stripped blockout gates prevent a convincing texture from standing in for real structure. Ships with the CS2 domain plugin; see its docs/cs2/review-gates.md.
  • Resumable local workflow. forge/state.py records an ordered, evidence-backed intake/pass checklist for the generic profile and every registered domain (in-repo character, plus installed domain plugins such as CS2 and animated-character from plugin-character). forge/next.py --state resumes from that checklist while the existing spec, render, and review gates remain authoritative.
  • Material reference pipeline. Every visible material region can be cropped, analyzed, resolved against the versioned Three.js material registry, fitted into ObjectSculptSpec, rendered from controlled camera views, and accepted only after a per-region comparison gate. See docs/materials/README.md.
  • Python-assisted browser rendering. Python may orchestrate camera batches, hashes, manifests, and deterministic diagnostics, but the target browser Three.js route remains the rendering authority. See grimoire/build/python_threejs_render_bridge.md.

How it works

A staged sculpting pipeline turns the reference image into a spec, then generates and vision-reviews one build pass at a time — blockout → structural → form → material → surface → lighting → interaction → optimization — self-correcting until every identity-defining feature clears its threshold.

→ Full pipeline diagram, gates, self-correction logic, and the token-efficiency design: docs/ARCHITECTURE.md A staged sculpting pipeline turns the reference image into a spec, then generates and vision-reviews one build pass at a time — blockout → structural → form → material → surface → lighting → interaction → optimization — self-correcting until every identity-defining feature clears its threshold. Deterministic Python scripts handle validation and gating; model tokens are spent only on visual judgment and code.

→ Full pipeline diagram, gates, self-correction logic, script reference, and the token-efficiency design: docs/ARCHITECTURE.md


Quick start

  1. Install — place this folder in your skills directory:

    bash
    git clone https://github.com/img2threejs/img2threejs.git ~/.claude/skills/img2threejs

    If you use more than one host, keep a single checkout and point each entrypoint at it as a symlink, so they cannot drift apart:

    ~/.claude/skills/img2threejs -> <your checkout>
    ~/.codex/skills/img2threejs  -> <your checkout>
  2. Add domain plugins (optional) — domain knowledge (CS2 skins today) lives in installed plugins, not in this checkout. Install the img2 harness once, then add plugins to it:

    bash
    npx github:img2threejs/img2 install   # ~/.img2, the plugin registry, and an `img2` launcher
    img2 add img2threejs/plugin-cs2       # clone @ newest tag, pin SHA, link host skills
    img2 doctor                           # fail-loud static audit of every installed plugin

    An installed domain plugin contributes its own checklist steps, evidence collection, spec augmentation (quality floors merge raise-only), and a blocking review gate — and registers its profile with forge/state.py init --profile <id>. With no plugins installed, generic, and character are available; a profile whose plugin is missing (cs2, animated-character) fails loud naming what is installed, never silently downgrades. img2 remove <id> reverses cleanly.

    Official plugins:

    Plugin Adds Install
    plugin-cs2 cs2 profile — CS2 weapon-skin reconstruction: family adapters, finish rules, domain review gate img2 add img2threejs/plugin-cs2
    plugin-character animated-character profile — everything character has plus the Stage R rigging/animation gates img2 add img2threejs/plugin-character
    plugin-img2glb image → glb emission target via the hosted TRELLIS space img2 add img2threejs/plugin-img2glb
    plugin-hello-cube minimal reference plugin — copy it to write your own img2 add img2threejs/plugin-hello-cube

    Writing your own: the harness repo's docs/WRITING_A_PLUGIN.md.

  3. 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.

    That is enough: the skill classifies the subject, runs the detail inventory, and gates every

Issues· 91 open

View all issuesOpen on GitHub
  • #150

    [Contribution]: Remove duplicate text in README’s “How it works” section

    contribution: proposedUpdated Sep 28, 2026
  • #148

    [Contribution]: post-rig plugin gate sweep for #125

    triage: needs-reviewUpdated Sep 28, 2026
  • #145

    Ship the npx installer (bin/cli.mjs) so users can install the img2threejs skill with one command

    enhancementhelp wantedUpdated Sep 23, 2026
  • #139

    [Bug]: search-specs CLI crashes with UnicodeEncodeError on non-UTF-8 consoles

    triage: needs-reviewUpdated Sep 15, 2026
  • #135

    strict-quality is unsatisfiable for any fabric material with a woven cue (blocks codegen)

    triage: needs-reviewUpdated Sep 10, 2026
  • #136

    extract_pbr_evidence: interior crops can be masked away entirely, and confidence does not drop

    triage: needs-reviewUpdated Sep 10, 2026
  • #137

    analyze_texture assigns metal finish classes to fabric and silently rewrites authored roughness

    triage: needs-reviewUpdated Sep 10, 2026
  • #116

    [Bug]: Codex CLI is supported? Cause i get nonsense results, pretty far from the reference image

    bugUpdated Sep 8, 2026
  • #126

    [Contribution]: Investigate why LLM-assisted generation produces incomplete models vs. the official Pikachu demo

    triage: needs-reviewUpdated Sep 4, 2026
  • #125

    A base-owned post-rig gate sweep row, so a rig gate can re-block

    triage: needs-reviewUpdated Sep 4, 2026

> Tags

Python3dai-agentsclaude-codecomputer-graphics

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 29, 2026
CategoryAI 编程
PricingOpen source

> Related tools

G
GitHub Copilot
GitHub 官方 AI 编程助手,覆盖补全、Chat 与 Agent 模式。
C
Cursor
AI 原生代码编辑器,对话改代码、多文件 Agent 与规则体系是其核心。
S
skills
Skills for Real Engineers. Straight from my .agents directory.