Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions ENV_CONFIG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# TRELLIS Environment Variable Configuration

## Overview

The TRELLIS apps now support environment variable configuration for Gradio server settings.

## Environment Variables

### Gradio Server Configuration
These are handled directly in `app.py` and `app_text.py`:

- `GRADIO_SERVER_NAME` (default: `0.0.0.0`) - Server binding address
- `GRADIO_SERVER_PORT` (default: `7860`) - Server port
- `GRADIO_SHARE` (default: `false`) - Enable public sharing

## Usage

```bash
# Custom configuration
export GRADIO_SERVER_NAME=0.0.0.0
export GRADIO_SERVER_PORT=8080
export GRADIO_SHARE=true
python3 app.py
```
6 changes: 5 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,4 +400,8 @@ def split_image(image: Image.Image) -> List[Image.Image]:
if __name__ == "__main__":
pipeline = TrellisImageTo3DPipeline.from_pretrained("microsoft/TRELLIS-image-large")
pipeline.cuda()
demo.launch()
demo.launch(
server_name=os.environ.get('GRADIO_SERVER_NAME', '0.0.0.0'),
server_port=int(os.environ.get('GRADIO_SERVER_PORT', '7860')),
share=os.environ.get('GRADIO_SHARE', 'false').lower() == 'true'
)
6 changes: 5 additions & 1 deletion app_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,4 +263,8 @@ def extract_gaussian(state: dict, req: gr.Request) -> Tuple[str, str]:
if __name__ == "__main__":
pipeline = TrellisTextTo3DPipeline.from_pretrained("microsoft/TRELLIS-text-xlarge")
pipeline.cuda()
demo.launch()
demo.launch(
server_name=os.environ.get('GRADIO_SERVER_NAME', '0.0.0.0'),
server_port=int(os.environ.get('GRADIO_SERVER_PORT', '7860')),
share=os.environ.get('GRADIO_SHARE', 'false').lower() == 'true'
)