--- title: TEXTure CPU Lite emoji: 🎨 colorFrom: green colorTo: pink sdk: gradio sdk_version: 6.2.0 app_file: app.py pinned: false license: mit --- # TEXTure CPU Lite - Text-Guided 3D Texturing Generate **proper UV texture maps** for 3D meshes using text prompts. Uses SD-2-Depth (same as original TEXTure paper) for depth-conditioned generation and xatlas for UV unwrapping. ## Features - **Proper UV Texture Output**: Creates UV atlas that can be applied to the mesh - **SD-2-Depth**: Native depth conditioning (same model as original TEXTure) - **OBJ Export**: Outputs OBJ + MTL + texture PNG ready to use - **xatlas UV Unwrapping**: Automatic UV coordinate generation ## How it works 1. Upload a 3D mesh (.obj, .stl, .ply, .glb) 2. Enter a text prompt describing the desired texture 3. xatlas generates UV coordinates 4. Depth is rendered from multiple viewpoints 5. SD-2-Depth generates textures conditioned on depth 6. Textures are projected back to UV space 7. Download textured mesh (OBJ + MTL + PNG) ## Models Used | Component | Model | Size | |-----------|-------|------| | SD-2-Depth | radames/stable-diffusion-2-depth-img2img | ~5GB | **Same architecture as original TEXTure paper** (SD-2-Depth) - has native depth conditioning built-in. Uses public community copy since official `stabilityai/stable-diffusion-2-depth` is gated. **Runtime:** - First run: Downloads ~5GB model (cached in `~/.cache/huggingface/`) - CPU uses INT8 quantization via `optimum.quanto` for 3-5x speedup - ONNX not supported (SD-2-Depth has 5-channel UNet) **Debug logs:** Check build logs for `[OK]`, `[ERROR]`, `[WARN]` messages if something fails. ## Performance | Device | Steps | Time per View | 4 Views Total | |--------|-------|---------------|---------------| | GPU (CUDA) | 20 | ~2-3 sec | ~12 sec | | CPU (INT8) | 10 | ~1.5 min | ~6 min | | CPU (INT8) | 20 | ~3 min | ~14 min | **Tip:** For faster results on CPU, use fewer steps (5-10) or fewer views (2-3). ## Local Development ```bash pip install -r requirements.txt python app.py ``` ## Files Structure ``` ├── app.py # Single-file implementation ├── requirements.txt ├── README.md └── shapes/ └── bunny.obj # Sample mesh ``` ## Credits - [TEXTure Paper](https://texturepaper.github.io/TEXTurePaper/) - Yael Vinker et al. - [ControlNet](https://github.com/lllyasviel/ControlNet) - Lvmin Zhang - [Stable Diffusion](https://huggingface.co/runwayml/stable-diffusion-v1-5) - RunwayML - [xatlas](https://github.com/jpcy/xatlas) - UV unwrapping