> 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/trellis-3d.md).

# TRELLIS 3D जनरेशन

Clore.ai पर Microsoft TRELLIS के साथ छवियों को 3D मेश और Gaussian splats में बदलें

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

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

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

* **एकल छवि → 3D** — न तो मल्टी-व्यू कैप्चर की आवश्यकता है, न टेक्स्ट प्रॉम्प्ट की
* **कई आउटपुट फ़ॉर्मेट** — GLB मेश, Gaussian splat (.ply), रेडिएंस फ़ील्ड
* **\~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   | 12.8+          | 12.8+          |
| Python | 3.10           | 3.10           |

**Clore.ai pricing:** RTX 4090 ≈ $0.14–0.42/घंटा · RTX 3090 ≈ $0.07–0.21/घंटा

TRELLIS को आवश्यकता है **24 GB VRAM की**. RTX 3090 न्यूनतम उपयोगी GPU है।

## त्वरित शुरुआत

### 1. पर्यावरण सेट करें

TRELLIS विशिष्ट dependency संस्करणों का उपयोग करता है — conda environment की जोरदार अनुशंसा की जाती है:

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

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

# 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 मिलता है जिसे किसी भी ब्राउज़र से एक्सेस किया जा सकता है, जो headless 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      | Steps (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`** Clore.ai पर Gradio UI चलाते समय सार्वजनिक URL पाने के लिए
* **सीड संगतता** — स्थिर करें `seed` रनों के बीच पुनरुत्पादनीय आउटपुट के लिए
* **टेक्सचर रिज़ॉल्यूशन** — उपयोग करें `texture_size=2048` प्रिंट-गुणवत्ता वाले टेक्सचर के लिए, `1024` रीयल-टाइम अनुप्रयोगों के लिए
* **पहली बार चलाने पर लगभग 5 GB डाउनलोड होता है** मॉडल वेट्स का — पर्याप्त डिस्क स्थान सुनिश्चित करें
* **Gaussian splats** रीयल-टाइम रेंडरिंग के लिए आदर्श हैं; GLB मेश गेम इंजन और 3D प्रिंटिंग के लिए बेहतर हैं

## समस्या निवारण

| समस्या                        | समाधान                                                                             |
| ----------------------------- | ---------------------------------------------------------------------------------- |
| `CUDA out of memory`          | 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)
* [पेपर: स्केलेबल 3D जनरेशन के लिए संरचित 3D लैटेंट्स](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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
