Why Run Trellis 2 Locally with ComfyUI?
Running trellis-2 through ComfyUI gives you powerful advantages:
- Unlimited generations — No API limits or costs
- Custom workflows — Chain with other AI tools
- Privacy — Your images never leave your computer
- Speed — No network latency, direct GPU access
- Control — Fine-tune every parameter
Prerequisites Before You Start
Hardware Requirements
| Component | Minimum | Recommended |
|---|---|---|
| GPU | NVIDIA RTX 3090 (24GB) | RTX 4090 / A100 |
| VRAM | 16GB | 24GB+ |
| System RAM | 32GB | 64GB |
| Storage | 100GB free | NVMe SSD |
Software Requirements
- Operating System: Linux (Ubuntu 22.04 recommended)
- CUDA Toolkit: 11.8 or 12.2
- Python: 3.10 or 3.11
- ComfyUI: Latest version
- Conda/Mamba: For environment management
Step 1: Install ComfyUI (If Not Already Installed)
# Clone ComfyUI
git clone https://github.com/comfyanonymous/ComfyUI.git
cd ComfyUI
# Create virtual environment
python -m venv venv
source venv/bin/activate # Linux/Mac
# OR: venv\Scripts\activate # Windows
# Install dependencies
pip install -r requirements.txt
# Test ComfyUI
python main.pyVisit http://127.0.0.1:8188 to verify ComfyUI is running.
Step 2: Install Trellis 2 Custom Nodes
Method A: ComfyUI Manager (Easiest)
- Install ComfyUI Manager if not installed
- Open ComfyUI → Manager → Install Custom Nodes
- Search for "Trellis" or "TRELLIS"
- Click Install
- Restart ComfyUI
Method B: Manual Installation
# Navigate to custom nodes directory
cd ComfyUI/custom_nodes
# Clone Trellis nodes
git clone https://github.com/microsoft/TRELLIS.git
cd TRELLIS
# Install dependencies
pip install -r requirements.txt
# Install additional dependencies
. ./setup.sh --basic --xformers --flash-attn --diffoctreerast --spconv --mipgaussian --kaolin --nvdiffrastStep 3: Download Trellis 2 Models
The models are hosted on Hugging Face. Download these to your ComfyUI models folder:
# Create model directory
mkdir -p ComfyUI/models/trellis
# Download using huggingface-cli
pip install huggingface_hub
huggingface-cli download microsoft/TRELLIS-image-large --local-dir ComfyUI/models/trellis/TRELLIS-image-large
# OR download manually from:
# https://huggingface.co/microsoft/TRELLIS-image-largeAvailable Models
| Model | Parameters | Use Case |
|---|---|---|
| TRELLIS-image-large | 1.2B | Best for image-to-3D |
| TRELLIS-text-base | 342M | Text-to-3D (basic) |
| TRELLIS-text-large | 1.1B | Text-to-3D (quality) |
| TRELLIS-text-xlarge | 2.0B | Text-to-3D (best) |
Step 4: Create Your First Trellis 2 Workflow
Basic Image-to-3D Workflow
- Load Image Node → Connect to Trellis Input
- Trellis Image-to-3D Node → Configure settings
- Save 3D Model Node → Export GLB/PLY
Node Configuration
Trellis Image-to-3D Settings:
├── seed: 42 (or random)
├── sparse_structure_steps: 12
├── sparse_structure_cfg: 7.5
├── slat_steps: 12
├── slat_cfg: 3.0
├── simplify: 0.95
└── texture_size: 1024Step 5: Optimize for Your GPU
For 16GB VRAM (RTX 4080, A4000)
# Add to ComfyUI launch
--lowvram --preview-method autoAdjust Trellis settings:
- Reduce texture_size to 512
- Lower resolution to 768
- Enable memory optimization flags
For 24GB+ VRAM (RTX 4090, A100)
Run at full settings:
- texture_size: 2048
- resolution: 1024
- All quality options enabled
Advanced Workflow: Chaining Trellis 2 with Other Nodes
Workflow: Image → Remove Background → Trellis 2 → Export
Load Image
↓
Background Removal (RMBG)
↓
Trellis 2 Image-to-3D
↓
[Optional] Mesh Simplification
↓
Save GLB + Preview VideoWorkflow: Text → Image (SDXL) → Trellis 2 → 3D
CLIP Text Encode
↓
KSampler (SDXL)
↓
VAE Decode
↓
Trellis 2 Image-to-3D
↓
Save 3D ModelTroubleshooting Common Issues
"CUDA out of memory"
Solutions:
- Close other GPU applications
- Use
--lowvramflag - Reduce texture_size and resolution
- Try CPU offloading for some operations
"Module not found" errors
# Reinstall dependencies
cd ComfyUI/custom_nodes/TRELLIS
pip install -r requirements.txt --force-reinstall"Flash attention not available"
# Install flash-attn manually
pip install flash-attn --no-build-isolation
# OR use xformers backend
export ATTN_BACKEND=xformersSlow generation speed
- Ensure CUDA is properly detected:
python -c "import torch; print(torch.cuda.is_available())" - Use SSD storage for models
- Close background applications
Performance Optimization Tips
Speed Optimization
| Technique | Speed Gain | Trade-off |
|---|---|---|
| Lower texture_size | 2x faster | Less texture detail |
| Reduce steps | 1.5x faster | Slightly lower quality |
| Enable xformers | 20% faster | Requires installation |
| Use FP16 | 1.5x faster | Minimal quality loss |
Quality Optimization
| Technique | Quality Gain | Trade-off |
|---|---|---|
| Higher texture_size | Sharper textures | Slower, more VRAM |
| More steps | Better details | Slower generation |
| Multiple seeds | Best result selection | More generations needed |
FAQ: ComfyUI + Trellis 2
Can I run Trellis 2 on Windows?
Windows support is experimental. Linux is strongly recommended. If you must use Windows, consider WSL2 with Ubuntu.
How much disk space do I need?
Plan for 50-100GB: ~15GB for models, ~30GB for dependencies, plus working space for outputs.
Can I use Trellis 2 with ControlNet?
Yes! Preprocess your image with ControlNet first, then feed the result to Trellis 2 for 3D generation.
Does ComfyUI Trellis support batch processing?
Yes, connect multiple images to process them in sequence. Useful for creating asset libraries.
Can I fine-tune Trellis 2 in ComfyUI?
Training requires separate setup outside ComfyUI. Use the official training scripts from the TRELLIS repository.
Next Steps
Now that you have trellis-2 running locally with ComfyUI:
- Experiment with different image types and settings
- Build custom workflows combining multiple AI tools
- Join the community — Share your workflows on ComfyUI forums
- Optimize your setup for your specific hardware
Ready to create 3D assets without limits? Your local trellis-2 setup is now complete!