MCPcopy Index your code
hub / github.com/ejones/triposr-texture-gen

github.com/ejones/triposr-texture-gen @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
15 symbols 50 edges 2 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

triposr-texture-gen

before and after images of texture gen script

A script to generate a texture for a 3D mesh using Stable Diffusion and ControlNet. It's designed for the outputs of TripoSR, an image-to-3D model by Stability AI and Tripo AI, but might work on other meshes as well. TripoSR outputs more coarse-grained textures in the form of vertex colors, so this is helpful for (re)applying fine detail to the models.

Installation

Create a virtualenv and install requirements:

python3 -m virtualenv venv
venv/bin/pip install -r requirements.txt

Usage

Run the text2texture.py script with the output mesh from TripoSR along with a textual description of the desired appearance.

venv/bin/python text2texture.py ~/TripoSR/output/0/mesh.obj 'a chair that looks like an avocado'

The first time this runs, it will download a Stable Diffusion model (by default, Lykon/dreamshaper-8) and a ControlNet model. The image model can be configured, say, to a model you've already fetched from Hugging Face.


Copyright © 2024 Evan Jones

Core symbols most depended-on inside this repo

get_slices
called by 5
text2texture.py
process_tripo_mesh
called by 1
text2texture.py
raycast_mesh
called by 1
text2texture.py
find_raycast_bounding_box
called by 1
text2texture.py
raycast_mesh_multi
called by 1
text2texture.py
generate_normal_map
called by 1
text2texture.py
interpolate_pixels
called by 1
text2texture.py
compute_texture
called by 1
text2texture.py

Shape

Function 12
Method 2
Class 1

Languages

Python100%

Modules by API surface

text2texture.py12 symbols
depth_txt2img.py3 symbols

For agents

$ claude mcp add triposr-texture-gen \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact