> 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-de/3d-generierung/triposr.md).

# TripoSR

Erzeuge 3D-Modelle aus einzelnen Bildern in weniger als einer Sekunde.

{% hint style="success" %}
Alle Beispiele können auf GPU-Servern ausgeführt werden, die über [CLORE.AI Marketplace](https://clore.ai/marketplace).
{% endhint %}

## Mieten auf CLORE.AI

1. Besuchen Sie [CLORE.AI Marketplace](https://clore.ai/marketplace)
2. Nach GPU-Typ, VRAM und Preis filtern
3. Wählen **On-Demand** (Festpreis) oder **Spot** (Gebotspreis)
4. Konfigurieren Sie Ihre Bestellung:
   * Docker-Image auswählen
   * Ports festlegen (TCP für SSH, HTTP für Web-UIs)
   * Umgebungsvariablen bei Bedarf hinzufügen
   * Startbefehl eingeben
5. Zahlung auswählen: **CLORE**, **BTC**, oder **USDT/USDC**
6. Bestellung erstellen und auf Bereitstellung warten

### Zugriff auf Ihren Server

* Verbindungsdetails finden Sie in **Meine Bestellungen**
* Webschnittstellen: Verwenden Sie die HTTP-Port-URL
* SSH: `ssh -p <port> root@<proxy-address>`

## Was ist TripoSR?

TripoSR von Stability AI und Tripo AI ermöglicht:

* Erzeugung von 3D-Meshes aus einzelnen Bildern
* Inference-Geschwindigkeit unter einer Sekunde
* Hochwertige texturierte Meshes
* Export nach OBJ, GLB und andere Formate

## Ressourcen

* **GitHub:** [VAST-AI-Research/TripoSR](https://github.com/VAST-AI-Research/TripoSR)
* **HuggingFace:** [stabilityai/TripoSR](https://huggingface.co/stabilityai/TripoSR)
* **Paper:** [TripoSR-Paper](https://arxiv.org/abs/2403.02151)
* **Demo:** [HuggingFace Space](https://huggingface.co/spaces/stabilityai/TripoSR)

## Empfohlene Hardware

| Komponente | Minimum       | Empfohlen     | Optimal       |
| ---------- | ------------- | ------------- | ------------- |
| GPU        | RTX 3060 12GB | RTX 4080 16GB | RTX 4090 24GB |
| VRAM       | 8GB           | 12GB          | 16GB          |
| CPU        | 4 Kerne       | 8 Kerne       | 16 Kerne      |
| RAM        | 16GB          | 32GB          | 64GB          |
| Speicher   | 20GB SSD      | 50GB NVMe     | 100GB NVMe    |
| Internet   | 100 Mbps      | 500 Mbps      | 1 Gbps        |

## Schnelle Bereitstellung auf CLORE.AI

**Docker-Image:**

```
pytorch/pytorch:2.5.1-cuda12.4-cudnn9-devel
```

**Ports:**

```
22/tcp
7860/http
```

**Befehl:**

```bash
cd /workspace && \
git clone https://github.com/VAST-AI-Research/TripoSR.git && \
cd TripoSR && \
pip install -r requirements.txt && \
python gradio_app.py
```

## Zugriff auf Ihren Dienst

Nach der Bereitstellung finden Sie Ihre `http_pub` URL in **Meine Bestellungen**:

1. Gehen Sie zur **Meine Bestellungen** Seite
2. Klicken Sie auf Ihre Bestellung
3. Finden Sie die `http_pub` URL (z. B., `abc123.clorecloud.net`)

Verwenden Sie `https://IHRE_HTTP_PUB_URL` anstelle von `localhost` in den Beispielen unten.

## Installation

```bash
git clone https://github.com/VAST-AI-Research/TripoSR.git
cd TripoSR
pip install -r requirements.txt

# Modelle werden beim ersten Start automatisch heruntergeladen
```

## Was Sie erstellen können

### Gaming & VR

* Konzeptkunst in 3D-Assets umwandeln
* Schnelles Prototyping für Spielobjekte
* Charaktermodell-Generierung
* Umgebungs-Requisiten

### E-Commerce

* 3D-Produktvisualisierung
* AR-Anprobeerlebnisse
* 360-Grad-Produktansichten
* Virtuelle Showrooms

### Architektur

* Schnelle 3D-Modelle aus Skizzen
* Visualisierung für Innenarchitektur
* Möbelprototypen
* Erzeugung von Bauelementen

### Bildung

* 3D-Modelle für Lernmaterialien
* Wissenschaftliche Visualisierung
* Rekonstruktion historischer Artefakte
* Anatomiemodelle

### Kreative Projekte

* Digitale Kunst und NFTs
* Animations-Assets
* Vorbereitung für 3D-Druck
* Meme- und Avatar-Erstellung

## Grundlegende Verwendung

### Kommandozeile

```bash
python run.py input_image.png \
    --output-dir output/ \
    --render
```

### Python-API

```python
import torch
from PIL import Image
from tsr.system import TSR
from tsr.utils import remove_background, save_video

# Modell laden
model = TSR.from_pretrained(
    "stabilityai/TripoSR",
    config_name="config.yaml",
    weight_name="model.ckpt"
)
model.to("cuda")

# Bild laden und vorverarbeiten
image = Image.open("input.png")

# 3D-Mesh erzeugen
with torch.no_grad():
    scene_codes = model([image], device="cuda")

# Mesh extrahieren
meshes = model.extract_mesh(scene_codes)

# Mesh speichern
meshes[0].export("output.obj")
```

### Mit Hintergrundentfernung

```python
from tsr.system import TSR
from tsr.utils import remove_background
from PIL import Image

model = TSR.from_pretrained("stabilityai/TripoSR")
model.to("cuda")

# Bild laden und Hintergrund entfernen
image = Image.open("photo.jpg")
image_no_bg = remove_background(image)

# 3D erzeugen
with torch.no_grad():
    scene_codes = model([image_no_bg], device="cuda")

mesh = model.extract_mesh(scene_codes)[0]
mesh.export("model.glb")  # Als GLB für Web exportieren
```

## Batch-Verarbeitung

```python
import os
from PIL import Image
import torch
from tsr.system import TSR
from tsr.utils import remove_background

model = TSR.from_pretrained("stabilityai/TripoSR")
model.to("cuda")

input_dir = "./images"
output_dir = "./3d_models"
os.makedirs(output_dir, exist_ok=True)

images_to_process = []
filenames = []

for filename in os.listdir(input_dir):
    if not filename.endswith(('.jpg', '.png')):
        continue

    image = Image.open(os.path.join(input_dir, filename))
    image_no_bg = remove_background(image)
    images_to_process.append(image_no_bg)
    filenames.append(filename)

# In Chargen verarbeiten
batch_size = 4
for i in range(0, len(images_to_process), batch_size):
    batch = images_to_process[i:i+batch_size]
    batch_names = filenames[i:i+batch_size]

    with torch.no_grad():
        scene_codes = model(batch, device="cuda")

    meshes = model.extract_mesh(scene_codes)

    for mesh, name in zip(meshes, batch_names):
        output_name = name.rsplit('.', 1)[0] + '.obj'
        mesh.export(os.path.join(output_dir, output_name))
        print(f"Generiert: {output_name}")
```

## Exportformate

```python
from tsr.system import TSR
from PIL import Image

model = TSR.from_pretrained("stabilityai/TripoSR")
model.to("cuda")

image = Image.open("input.png")

with torch.no_grad():
    scene_codes = model([image], device="cuda")

mesh = model.extract_mesh(scene_codes)[0]

# Verschiedene Exportformate
mesh.export("model.obj")   # Wavefront OBJ
mesh.export("model.glb")   # GLTF-Binär (webbereit)
mesh.export("model.ply")   # PLY-Format
mesh.export("model.stl")   # STL (3D-Druck)
```

## Vorschauvideo rendern

```python
from tsr.system import TSR
from tsr.utils import save_video
from PIL import Image
import torch

model = TSR.from_pretrained("stabilityai/TripoSR")
model.to("cuda")

image = Image.open("input.png")

with torch.no_grad():
    scene_codes = model([image], device="cuda")

# 360-Grad-Video rendern
render_images = model.render(
    scene_codes,
    n_views=30,
    return_type="pil"
)

save_video(render_images[0], "preview.mp4", fps=30)
```

## Gradio-Oberfläche

```python
import gradio as gr
import torch
from PIL import Image
from tsr.system import TSR
from tsr.utils import remove_background
import tempfile

model = TSR.from_pretrained("stabilityai/TripoSR")
model.to("cuda")

def generate_3d(image, remove_bg, output_format):
    if remove_bg:
        image = remove_background(image)

    with torch.no_grad():
        scene_codes = model([image], device="cuda")

    mesh = model.extract_mesh(scene_codes)[0]

    with tempfile.NamedTemporaryFile(suffix=f".{output_format}", delete=False) as f:
        mesh.export(f.name)
        return f.name, image

demo = gr.Interface(
    fn=generate_3d,
    inputs=[
        gr.Image(type="pil", label="Eingabebild"),
        gr.Checkbox(label="Hintergrund entfernen", value=True),
        gr.Dropdown(choices=["obj", "glb", "ply", "stl"], value="glb", label="Ausgabeformat")
    ],
    outputs=[
        gr.File(label="3D-Modell"),
        gr.Image(label="Verarbeitetes Eingabebild")
    ],
    title="TripoSR - Bild zu 3D",
    description="Erzeuge 3D-Modelle aus einzelnen Bildern in Sekunden. Läuft auf CLORE.AI GPU-Servern."
)

demo.launch(server_name="0.0.0.0", server_port=7860)
```

## Mit Mesh-Verfeinerung

```python
from tsr.system import TSR
from PIL import Image
import torch

model = TSR.from_pretrained("stabilityai/TripoSR")
model.to("cuda")

image = Image.open("input.png")

with torch.no_grad():
    scene_codes = model([image], device="cuda")

# Mit höherer Auflösung extrahieren
mesh = model.extract_mesh(
    scene_codes,
    resolution=256  # Höher = mehr Detail, Standard ist 128
)[0]

mesh.export("high_detail.obj")
```

## Leistung

| Auflösung      | GPU      | Geschwindigkeit | Qualität |
| -------------- | -------- | --------------- | -------- |
| 128 (Standard) | RTX 3090 | 0.5s            | Gut      |
| 128            | RTX 4090 | 0.3s            | Gut      |
| 256            | RTX 4090 | 1.2s            | Besser   |
| 256            | A100     | 0.8s            | Besser   |

## Häufige Probleme & Lösungen

### Schlechte 3D-Qualität

**Problem:** Generiertes Mesh sieht falsch oder verzerrt aus

**Lösungen:**

* Verwende Bilder mit klarem Motiv und einfachem Hintergrund
* Entferne den Hintergrund vor der Verarbeitung
* Verwende eine frontale Ansicht des Objekts
* Sorge für gute Beleuchtung im Quellbild

```python

# Entferne immer den Hintergrund für beste Ergebnisse
from tsr.utils import remove_background

image = Image.open("photo.jpg")
clean_image = remove_background(image)
```

### Hintergrundentfernung schlägt fehl

**Problem:** Hintergrundentfernung hinterlässt Artefakte

**Lösungen:**

* Vorverarbeiten mit einem dedizierten Tool wie rembg
* Hintergrund des Bildes manuell bearbeiten
* Verwende Bilder mit einfachen Hintergründen

```bash
pip install rembg
```

```python
from rembg import remove
from PIL import Image

image = Image.open("photo.jpg")
image_no_bg = remove(image)
image_no_bg.save("clean.png")
```

### Kein Speicher mehr

**Problem:** CUDA OOM bei hoher Auflösung

**Lösungen:**

```python

# Niedrigere Auflösung verwenden
mesh = model.extract_mesh(scene_codes, resolution=128)

# Oder Cache zwischen Chargen leeren
import torch
torch.cuda.empty_cache()
```

### Mesh hat Löcher

**Problem:** Generiertes Mesh hat fehlende Teile

**Lösungen:**

* Verwende Extraktion mit höherer Auflösung
* Probiere einen anderen Blickwinkel des Motivs
* Nachbearbeitung des Meshes in Blender oder MeshLab
* Verwende Bilder mit vollständiger Sichtbarkeit des Objekts

### Langsame Verarbeitung

**Problem:** Dauert zu lange pro Bild

**Lösungen:**

* Verwende Chargenverarbeitung für mehrere Bilder
* Niedrigere Auflösung für Prototypen
* Verwende RTX 4090 oder A100 GPU

## Fehlerbehebung

### 3D-Mesh-Qualität schlecht

* Verwende Bilder mit klaren Objektumrissen
* Hintergrund entfernen oder maskieren
* Frontansichten funktionieren am besten

### Export schlägt fehl

* Überprüfe, ob das Ausgabeverzeichnis existiert
* Vergewissere dich, dass das Mesh-Format unterstützt wird
* Stelle sicher, dass genügend Festplattenspeicher vorhanden ist

### Textur fehlt

* Einige Exporte schließen keine Textur ein
* Verwende das GLB-Format für texturierte Ausgabe
* Überprüfe Einstellungen für Materialexport

{% hint style="danger" %}
**Kein Speicher mehr**
{% endhint %}

* TripoSR ist effizient, benötigt aber 6GB+
* Reduziere die Ausgaberauflösung
* Verarbeite ein Bild nach dem anderen

## Kostenabschätzung

Typische CLORE.AI-Marktplatztarife (Stand 2024):

| GPU       | Stundensatz | Tagessatz | 4-Stunden-Sitzung |
| --------- | ----------- | --------- | ----------------- |
| RTX 3060  | \~$0.03     | \~$0.70   | \~$0.12           |
| RTX 3090  | \~$0.06     | \~$1.50   | \~$0.25           |
| RTX 4090  | \~$0.10     | \~$2.30   | \~$0.40           |
| A100 40GB | \~$0.17     | \~$4.00   | \~$0.70           |
| A100 80GB | \~$0.25     | \~$6.00   | \~$1.00           |

*Preise variieren je nach Anbieter und Nachfrage. Prüfen Sie* [*CLORE.AI Marketplace*](https://clore.ai/marketplace) *auf aktuelle Preise.*

**Geld sparen:**

* Verwenden Sie **Spot** Markt für flexible Workloads (oft 30–50% günstiger)
* Bezahlen mit **CLORE** Token
* Preise bei verschiedenen Anbietern vergleichen

## Nächste Schritte

* Stable Diffusion - Eingabebilder generieren
* [IC-Light](/guides/guides_v2-de/bildverarbeitung/iclight.md) - Bilder vor dem 3D-Prozess neu beleuchten
* ComfyUI - Workflow-Integration


---

# 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:

```
GET https://docs.clore.ai/guides/guides_v2-de/3d-generierung/triposr.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
