Skip to content

SanBingYouYong/TRELLIS-API

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TRELLIS Text-to-3D API

REST API for Microsoft TRELLIS text-to-3D generation.

Quick Start

docker compose up --build

API available at http://localhost:8000 with interactive docs at /docs.

Test with: python test_api.py

  • application starting up may take some time, as well as downloading model weight in the first run - the weights will be cached for future use under ./cache by volume-mounting the container.

Alternatively, run the docker container manually with docker run -it --gpus all -v $(pwd)/cache:/root/.cache -p 8000:8000 --name trellis trellis and run python text_to_3d_api.py --host 0.0.0.0 --port 8000.

API Usage

# Generate 3D model
curl -X POST "http://localhost:8000/generate" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "A red sports car", "formats": ["mesh", "gaussian"]}'

# Download files from response URLs
curl -O "http://localhost:8000/files/{job_id}/model.glb"

Features

The Dockerfile also provides a way to use an updated torch+cuda environment to original TRELLIS repo.

  • REST API for text-to-3D generation
  • Multiple formats: GLB, PLY, MP4 preview videos
  • Docker deployment with GPU support
  • File management with automatic cleanup
  • Health monitoring and error handling

See API_README.md for detailed documentation.

About

A fork of """Official repo for paper "Structured 3D Latents for Scalable and Versatile 3D Generation" (CVPR'25 Spotlight).""" for using its text-to-3d functionality as a restful api. The Dockerfile also upgrades the environment to latest torch and cuda.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 97.6%
  • Shell 2.1%
  • Dockerfile 0.3%