# Triposplat

> TripoSplat is an open-source model from TripoAI / VAST AI Research that converts a single 2D image into high-quality 3D Gaussians using a novel learned density-control approach


## Overview

- **Endpoint**: `https://fal.run/tripo3d/triposplat`
- **Model ID**: `tripo3d/triposplat`
- **Category**: image-to-3d
- **Kind**: inference
**Tags**: 3D, gaussian-splat, 



## Pricing

- **Price**: $0.05 per generations

For more details, see [fal.ai pricing](https://fal.ai/pricing).

## API Information

This model can be used via our HTTP API or more conveniently via our client libraries.
See the input and output schema below, as well as the usage examples.


### Input Schema

The API accepts the following input parameters:


- **`image_url`** (`string`, _required_):
  URL of the input image to convert into a 3D Gaussian splat.
  - Examples: "https://raw.githubusercontent.com/VAST-AI-Research/TripoSplat/36b6deb0a1613e43c6910de441cb57d50352e44a/static/example_inputs/building_stone_house.webp", "https://raw.githubusercontent.com/VAST-AI-Research/TripoSplat/36b6deb0a1613e43c6910de441cb57d50352e44a/static/example_inputs/creature_butterfly.webp"

- **`num_gaussians`** (`integer`, _optional_):
  Target number of Gaussians in the output splat. Higher means more detail but larger files and slower rendering. Rounded to the nearest multiple of 32 internally. Default value: `262144`
  - Default: `262144`
  - Range: `32768` to `262144`

- **`num_inference_steps`** (`integer`, _optional_):
  Number of flow-matching sampler steps. More steps improve fidelity with a roughly linear runtime cost. Default value: `20`
  - Default: `20`
  - Range: `1` to `50`

- **`guidance_scale`** (`float`, _optional_):
  Classifier-free guidance strength. Values at or below 1.0 disable guidance; higher values increase detail and adherence to the input image, but too high can oversaturate colors. Default value: `3`
  - Default: `3`
  - Range: `0` to `10`

- **`output_format`** (`OutputFormatEnum`, _optional_):
  File format for the generated Gaussian splat. Default value: `"ply"`
  - Default: `"ply"`
  - Options: `"ply"`, `"splat"`

- **`seed`** (`integer`, _optional_):
  Random seed for reproducibility. If None, a random seed is generated.

- **`enable_safety_checker`** (`boolean`, _optional_):
  Enable safety checking of the input image. Default value: `true`
  - Default: `true`



**Required Parameters Example**:

```json
{
  "image_url": "https://raw.githubusercontent.com/VAST-AI-Research/TripoSplat/36b6deb0a1613e43c6910de441cb57d50352e44a/static/example_inputs/building_stone_house.webp"
}
```

**Full Example**:

```json
{
  "image_url": "https://raw.githubusercontent.com/VAST-AI-Research/TripoSplat/36b6deb0a1613e43c6910de441cb57d50352e44a/static/example_inputs/building_stone_house.webp",
  "num_gaussians": 262144,
  "num_inference_steps": 20,
  "guidance_scale": 3,
  "output_format": "ply",
  "enable_safety_checker": true
}
```


### Output Schema

The API returns the following output format:

- **`model_mesh`** (`File`, _required_):
  Generated 3D Gaussian splat file (.ply or .splat).

- **`preprocessed_image`** (`Image`, _required_):
  The background-removed RGB composite the model actually saw, rendered on a black background.

- **`num_gaussians`** (`integer`, _required_):
  The actual number of Gaussians produced.

- **`seed`** (`integer`, _required_):
  The seed used for generation.

- **`timings`** (`Timings`, _required_):
  Per-stage timings in seconds.



**Example Response**:

```json
{
  "model_mesh": {
    "url": "",
    "content_type": "image/png",
    "file_name": "z9RV14K95DvU.png",
    "file_size": 4404019
  },
  "preprocessed_image": {
    "url": "",
    "content_type": "image/png",
    "file_name": "z9RV14K95DvU.png",
    "file_size": 4404019,
    "width": 1024,
    "height": 1024
  }
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/tripo3d/triposplat \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "image_url": "https://raw.githubusercontent.com/VAST-AI-Research/TripoSplat/36b6deb0a1613e43c6910de441cb57d50352e44a/static/example_inputs/building_stone_house.webp"
   }'
```

### Python

Ensure you have the Python client installed:

```bash
pip install fal-client
```

Then use the API client to make requests:

```python
import fal_client

def on_queue_update(update):
    if isinstance(update, fal_client.InProgress):
        for log in update.logs:
           print(log["message"])

result = fal_client.subscribe(
    "tripo3d/triposplat",
    arguments={
        "image_url": "https://raw.githubusercontent.com/VAST-AI-Research/TripoSplat/36b6deb0a1613e43c6910de441cb57d50352e44a/static/example_inputs/building_stone_house.webp"
    },
    with_logs=True,
    on_queue_update=on_queue_update,
)
print(result)
```

### JavaScript

Ensure you have the JavaScript client installed:

```bash
npm install --save @fal-ai/client
```

Then use the API client to make requests:

```javascript
import { fal } from "@fal-ai/client";

const result = await fal.subscribe("tripo3d/triposplat", {
  input: {
    image_url: "https://raw.githubusercontent.com/VAST-AI-Research/TripoSplat/36b6deb0a1613e43c6910de441cb57d50352e44a/static/example_inputs/building_stone_house.webp"
  },
  logs: true,
  onQueueUpdate: (update) => {
    if (update.status === "IN_PROGRESS") {
      update.logs.map((log) => log.message).forEach(console.log);
    }
  },
});
console.log(result.data);
console.log(result.requestId);
```


## Additional Resources

### Documentation

- [Model Playground](https://fal.ai/models/tripo3d/triposplat)
- [API Documentation](https://fal.ai/models/tripo3d/triposplat/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=tripo3d/triposplat)

### fal.ai Platform

- [Platform Documentation](https://docs.fal.ai)
- [Python Client](https://docs.fal.ai/clients/python)
- [JavaScript Client](https://docs.fal.ai/clients/javascript)
