> For the complete documentation index, see [llms.txt](https://docs.clore.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.clore.ai/guides/guides_v2-hi/3d-generation/trellis-3d.md).

# TRELLIS 3D Generation

Microsoft Research का TRELLIS एक एकल RGB छवि को लगभग 30 सेकंड में उच्च-गुणवत्ता 3D मैश, Gaussian splat, या radiance field में परिवर्तित करता है। MIT लाइसेंस के तहत जारी, यह वाणिज्यिक उपयोग के लिए पूरी तरह निःशुल्क है।

{% hint style="success" %}
सभी उदाहरण GPU सर्वरों पर चलते हैं जो कि के माध्यम से किराये पर लिए गए हैं [CLORE.AI मार्केटप्लेस](https://clore.ai/marketplace).
{% endhint %}

## प्रमुख विशेषताएँ

* **एकल छवि → 3D** — कोई मल्टी-व्यू कैप्चर नहीं, किसी टेक्स्ट प्रांप्ट की आवश्यकता नहीं
* **कई आउटपुट फ़ॉर्मैट** — GLB मैश, Gaussian splat (.ply), radiance field
* **प्रति एसेट \~30 सेकंड** RTX 3090/4090 पर
* **MIT लाइसेंस** — वाणिज्यिक उपयोग के लिए निःशुल्क
* **Gradio वेब UI** ब्राउज़र-आधारित इंटरैक्शन के लिए शामिल है
* **Python API** पाइपलाइन इंटीग्रेशन और बैच प्रोसेसिंग के लिए
* **ज़ीरो-शॉट** — बिना फाइन-ट्यूनिंग के किसी भी छवि पर काम करता है

## आवश्यकताएँ

| घटक    | न्यूनतम        | अनुशंसित       |
| ------ | -------------- | -------------- |
| GPU    | RTX 3090 24 GB | RTX 4090 24 GB |
| VRAM   | 24 GB          | 24 GB          |
| RAM    | 32 GB          | 64 GB          |
| डिस्क  | 30 GB          | 60 GB          |
| CUDA   | 11.8           | 12.1+          |
| Python | 3.10           | 3.10           |

**Clore.ai मूल्य निर्धारण:** RTX 4090 ≈ $0.5–2/दिन · RTX 3090 ≈ $0.3–1/दिन

TRELLIS की आवश्यकता है **24 GB VRAM**। RTX 3090 न्यूनतम व्यवहार्य GPU है।

## त्वरित प्रारम्भ

### 1. वातावरण सेट करें

TRELLIS विशिष्ट डिपेंडेंसी संस्करणों का उपयोग करता है — conda वातावरण की दृढ़ सिफारिश है:

```bash
# वातावरण बनाएं और सक्रिय करें
conda create -n trellis python=3.10 -y
conda activate trellis

# CUDA के साथ PyTorch इंस्टॉल करें
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121

# TRELLIS क्लोन करें
git clone https://github.com/microsoft/TRELLIS.git
cd TRELLIS

# निर्भरताएँ इंस्टॉल करें
pip install -r requirements.txt

# मैश एक्सपोर्ट के लिए अतिरिक्त पैकेज इंस्टॉल करें
pip install kaolin -f https://nvidia-kaolin.s3.us-east-2.amazonaws.com/torch-2.1.0_cu121.html
pip install spconv-cu121
```

### 2. Gradio वेब UI चलाएं

```bash
python app.py --share
```

यह Gradio इंटरफ़ेस लॉन्च करता है `http://0.0.0.0:7860`। साथ में `--share` आपको कोई भी ब्राउज़र से पहुंच योग्य सार्वजनिक URL मिलता है, जो हेडलेस Clore.ai सर्वर पर चलाते समय उपयोगी है।

एक छवि अपलोड करें, जनरेशन पैरामीटर समायोजित करें, और प्राप्त 3D एसेट डाउनलोड करें।

### 3. Python API का उपयोग करें

```python
from trellis.pipelines import TrellisImageTo3DPipeline
from PIL import Image

# पाइपलाइन लोड करें (पहली बार चलाने पर मॉडल वेट्स डाउनलोड होते हैं, ~5 GB)
pipeline = TrellisImageTo3DPipeline.from_pretrained("JeffreyXiang/TRELLIS-image-large")
pipeline.cuda()

# एक छवि से 3D उत्पन्न करें
image = Image.open("input.png")
outputs = pipeline.run(
    image,
    seed=42,
    sparse_structure_sampler_params={
        "steps": 12,
        "cfg_strength": 7.5,
    },
    slat_sampler_params={
        "steps": 12,
        "cfg_strength": 3.0,
    },
)
```

### 4. अलग-अलग फ़ॉर्मैट में निर्यात करें

```python
# GLB मैश के रूप में एक्सपोर्ट (गेम इंजन, वेब व्यूअर के लिए)
glb = pipeline.to_glb(
    outputs["gaussian"][0],
    outputs["mesh"][0],
    simplify=0.95,          # पोलिगन गणना को 95% तक कम करें
    texture_size=1024,
)
glb.export("output.glb")

# Gaussian splat को PLY के रूप में एक्सपोर्ट करें
outputs["gaussian"][0].save_ply("output.ply")

# मैश को OBJ के रूप में एक्सपोर्ट करें
import trimesh
mesh = trimesh.Trimesh(
    vertices=outputs["mesh"][0].vertices.cpu().numpy(),
    faces=outputs["mesh"][0].faces.cpu().numpy(),
)
mesh.export("output.obj")
```

## उपयोग के उदाहरण

### एक से अधिक छवियों के लिए बैच प्रोसेसिंग

```python
import glob
from pathlib import Path

input_dir = Path("/workspace/input-images")
output_dir = Path("/workspace/3d-output")
output_dir.mkdir(exist_ok=True)

for img_path in sorted(input_dir.glob("*.png")):
    image = Image.open(img_path)
    outputs = pipeline.run(image, seed=42)

    glb = pipeline.to_glb(
        outputs["gaussian"][0],
        outputs["mesh"][0],
        simplify=0.95,
        texture_size=1024,
    )
    glb.export(str(output_dir / f"{img_path.stem}.glb"))
    print(f"Exported: {img_path.stem}.glb")
```

### जनरेशन क्वालिटी को समायोजित करना

```python
# उच्च गुणवत्ता (धीमा, ~60 सेकंड)
outputs = pipeline.run(
    image,
    seed=42,
    sparse_structure_sampler_params={
        "steps": 20,
        "cfg_strength": 9.0,
    },
    slat_sampler_params={
        "steps": 20,
        "cfg_strength": 4.5,
    },
)

# तेज़ प्रिव्यू (कम गुणवत्ता, ~15 सेकंड)
outputs = pipeline.run(
    image,
    seed=42,
    sparse_structure_sampler_params={
        "steps": 6,
        "cfg_strength": 7.5,
    },
    slat_sampler_params={
        "steps": 6,
        "cfg_strength": 3.0,
    },
)
```

### 3D व्यूअर्स के लिए Gaussian Splat निकालें

```python
# SuperSplat, Luma, या Three.js splat renderer जैसे व्यूअर्स के लिए .ply के रूप में सहेजें
outputs["gaussian"][0].save_ply("scene.ply")
```

## प्रदर्शन संदर्भ

| GPU      | स्टेप्स (12/12) | समय        | नोट्स                    |
| -------- | --------------- | ---------- | ------------------------ |
| RTX 4090 | 12 / 12         | \~25 सेकंड | सबसे अच्छा कीमत/प्रदर्शन |
| RTX 3090 | 12 / 12         | \~35 सेकंड | TRELLIS के लिए न्यूनतम   |
| A100 40G | 12 / 12         | \~20 सेकंड | डेटा सेंटर विकल्प        |

## टिप्स

* **साफ़ पृष्ठभूमि वाली PNG का उपयोग करें** — पृष्ठभूमि हटाने के लिए `rembg` TRELLIS को फ़ीड करने से पहले सर्वोत्तम मैश गुणवत्ता के लिए
* **`simplify=0.95`** GLB एक्सपोर्ट में पोलिगन गणना को 95% तक कम करता है जबकि दृश्य गुणवत्ता को बनाए रखता है — वेब/गेम उपयोग के लिए आवश्यक
* **सेट करें `--share`** Gradio UI को Clore.ai पर चलाते समय सार्वजनिक URL पाने के लिए
* **सीड सुसंगतता** — फिक्स करें `seed` पुनरुत्पादन योग्य आउटपुट के लिए रन के बीच
* **टेक्सचर रेज़ोल्यूशन** — उपयोग करें `texture_size=2048` प्रिंट-गुणवत्ता टेक्सचर्स के लिए, `1024` रियल-टाइम अनुप्रयोगों के लिए
* **पहली बार चलाने पर \~5 GB डाउनलोड होता है** मॉडल वेट्स का — पर्याप्त डिस्क स्थान सुनिश्चित करें
* **Gaussian splats** रियल-टाइम रेंडरिंग के लिए आदर्श हैं; GLB मैश गेम इंजनों और 3D प्रिंटिंग के लिए बेहतर हैं

## समस्याओं का निवारण

| समस्या                        | समाधान                                                                                    |
| ----------------------------- | ----------------------------------------------------------------------------------------- |
| `CUDA में आउट ऑफ मेमोरी`      | TRELLIS को 24 GB VRAM चाहिए — RTX 3090/4090 या A100 का उपयोग करें                         |
| `kaolin` इंस्टॉल असफल होता है | kaolin संस्करण को अपने PyTorch + CUDA संस्करण से ठीक मिलान करें                           |
| `spconv` इम्पोर्ट एरर         | सही CUDA संस्करण इंस्टॉल करें: `pip install spconv-cu121`                                 |
| Gradio UI सुलभ नहीं है        | उपयोग करें `--share` एक सार्वजनिक टनल के लिए, या Clore.ai पर पोर्ट 7860 को एक्स्पोज़ करें |
| खराब मैश गुणवत्ता             | सुनिश्चित करें कि इनपुट इमेज की पृष्ठभूमि साफ़/निकाली हुई हो                              |
| पहली जेनरेशन धीमी है          | पहली बार रन पर मॉडल वेट्स डाउनलोड होते हैं — बाद की रन तेज़ होते हैं                      |
| GLB एक्सपोर्ट फेल होता है     | सुनिश्चित करें `trimesh` और `pygltflib` इंस्टॉल हैं                                       |

## संसाधन

* [TRELLIS GitHub](https://github.com/microsoft/TRELLIS)
* [पेपर: Scalable 3D Generation के लिए Structured 3D Latents](https://arxiv.org/abs/2412.01506)
* [CLORE.AI मार्केटप्लेस](https://clore.ai/marketplace)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.clore.ai/guides/guides_v2-hi/3d-generation/trellis-3d.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
