# TRELLIS.2 LoRA Inference

> Run inference on LoRA adapters for TRELLIS.2 model


## Overview

- **Endpoint**: `https://fal.run/fal-ai/trellis-2-lora`
- **Model ID**: `fal-ai/trellis-2-lora`
- **Category**: image-to-3d
- **Kind**: inference
**Description**: It converts a single input image into a textured 3D GLB using TRELLIS.2 plus one or more stage-specific LoRA adapters



## Pricing

Your request will cost 0.25 $ for 512p resolution, and 0.3 $ for 1024p resolution.

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 to a 3D model.

- **`sparse_structure_lora_url`** (`string`, _optional_):
  Optional safetensors LoRA checkpoint trained for the sparse structure denoiser.

- **`geometry_lora_url`** (`string`, _optional_):
  Optional safetensors LoRA checkpoint trained for the geometry denoiser.

- **`texture_lora_url`** (`string`, _optional_):
  Optional safetensors LoRA checkpoint trained for the texture denoiser.

- **`seed`** (`integer`, _optional_):
  Random seed for reproducible generation.

- **`resolution`** (`ResolutionEnum`, _optional_):
  Generation resolution. Must match the resolution the provided LoRA adapters were trained at (1024 runs the cascade pipeline). Default value: `"512"`
  - Default: `512`
  - Options: `512`, `1024`

- **`ss_guidance_strength`** (`float`, _optional_):
  Classifier-free guidance strength for the sparse-structure stage. Default value: `7.5`
  - Default: `7.5`
  - Range: `0` to `10`

- **`ss_guidance_rescale`** (`float`, _optional_):
  Guidance rescale for the sparse-structure stage; higher stabilizes output. Default value: `0.7`
  - Default: `0.7`
  - Range: `0` to `1`

- **`ss_guidance_interval_start`** (`float`, _optional_):
  Denoising fraction at which guidance starts for the sparse-structure stage. Default value: `0.6`
  - Default: `0.6`
  - Range: `0` to `1`

- **`ss_guidance_interval_end`** (`float`, _optional_):
  Denoising fraction at which guidance ends for the sparse-structure stage. Must be >= ss_guidance_interval_start. Default value: `1`
  - Default: `1`
  - Range: `0` to `1`

- **`ss_sampling_steps`** (`integer`, _optional_):
  Number of denoising steps for the sparse-structure stage. Default value: `12`
  - Default: `12`
  - Range: `1` to `50`

- **`ss_rescale_t`** (`float`, _optional_):
  Noise-schedule sharpness for the sparse-structure stage. Default value: `5`
  - Default: `5`
  - Range: `1` to `6`

- **`shape_slat_guidance_strength`** (`float`, _optional_):
  Classifier-free guidance strength for the shape stage. Default value: `7.5`
  - Default: `7.5`
  - Range: `0` to `10`

- **`shape_slat_guidance_rescale`** (`float`, _optional_):
  Guidance rescale for the shape stage; increase if geometry looks noisy. Default value: `0.5`
  - Default: `0.5`
  - Range: `0` to `1`

- **`shape_slat_guidance_interval_start`** (`float`, _optional_):
  Denoising fraction at which guidance starts for the shape stage. Default value: `0.6`
  - Default: `0.6`
  - Range: `0` to `1`

- **`shape_slat_guidance_interval_end`** (`float`, _optional_):
  Denoising fraction at which guidance ends for the shape stage. Must be >= shape_slat_guidance_interval_start. Default value: `1`
  - Default: `1`
  - Range: `0` to `1`

- **`shape_slat_sampling_steps`** (`integer`, _optional_):
  Number of denoising steps for the shape stage. Default value: `12`
  - Default: `12`
  - Range: `1` to `50`

- **`shape_slat_rescale_t`** (`float`, _optional_):
  Noise-schedule sharpness for the shape stage. Default value: `3`
  - Default: `3`
  - Range: `1` to `6`

- **`tex_slat_guidance_strength`** (`float`, _optional_):
  Classifier-free guidance strength for the texture stage. Default value: `1`
  - Default: `1`
  - Range: `0` to `10`

- **`tex_slat_guidance_rescale`** (`float`, _optional_):
  Guidance rescale for the texture stage; increase if textures look noisy.
  - Default: `0`
  - Range: `0` to `1`

- **`tex_slat_guidance_interval_start`** (`float`, _optional_):
  Denoising fraction at which guidance starts for the texture stage. Default value: `0.6`
  - Default: `0.6`
  - Range: `0` to `1`

- **`tex_slat_guidance_interval_end`** (`float`, _optional_):
  Denoising fraction at which guidance ends for the texture stage. Must be >= tex_slat_guidance_interval_start. Default value: `0.9`
  - Default: `0.9`
  - Range: `0` to `1`

- **`tex_slat_sampling_steps`** (`integer`, _optional_):
  Number of denoising steps for the texture stage. Default value: `12`
  - Default: `12`
  - Range: `1` to `50`

- **`tex_slat_rescale_t`** (`float`, _optional_):
  Noise-schedule sharpness for the texture stage. Default value: `3`
  - Default: `3`
  - Range: `1` to `6`

- **`decimation_target`** (`integer`, _optional_):
  Target vertex count for the exported GLB. Default value: `500000`
  - Default: `500000`
  - Range: `5000` to `2000000`

- **`texture_size`** (`TextureSizeEnum`, _optional_):
  Texture resolution baked into the exported GLB. Default value: `"2048"`
  - Default: `2048`
  - Options: `1024`, `2048`, `4096`



**Required Parameters Example**:

```json
{
  "image_url": ""
}
```

**Full Example**:

```json
{
  "image_url": "",
  "resolution": 512,
  "ss_guidance_strength": 7.5,
  "ss_guidance_rescale": 0.7,
  "ss_guidance_interval_start": 0.6,
  "ss_guidance_interval_end": 1,
  "ss_sampling_steps": 12,
  "ss_rescale_t": 5,
  "shape_slat_guidance_strength": 7.5,
  "shape_slat_guidance_rescale": 0.5,
  "shape_slat_guidance_interval_start": 0.6,
  "shape_slat_guidance_interval_end": 1,
  "shape_slat_sampling_steps": 12,
  "shape_slat_rescale_t": 3,
  "tex_slat_guidance_strength": 1,
  "tex_slat_guidance_interval_start": 0.6,
  "tex_slat_guidance_interval_end": 0.9,
  "tex_slat_sampling_steps": 12,
  "tex_slat_rescale_t": 3,
  "decimation_target": 500000,
  "texture_size": 2048
}
```


### Output Schema

The API returns the following output format:

- **`model_glb`** (`File`, _required_):
  Generated 3D GLB file.

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

- **`resolution`** (`integer`, _required_):
  Generation resolution used.

- **`sparse_structure_lora_url`** (`string`, _optional_):
  Sparse-structure LoRA checkpoint applied for this generation, if any.

- **`geometry_lora_url`** (`string`, _optional_):
  Geometry LoRA checkpoint applied for this generation, if any.

- **`texture_lora_url`** (`string`, _optional_):
  Texture LoRA checkpoint applied for this generation, if any.

- **`decimation_target`** (`integer`, _required_):
  Target vertex count used for the exported GLB.

- **`texture_size`** (`integer`, _required_):
  Texture resolution baked into the exported GLB.



**Example Response**:

```json
{
  "model_glb": {
    "url": "",
    "content_type": "image/png",
    "file_name": "z9RV14K95DvU.png",
    "file_size": 4404019
  }
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/fal-ai/trellis-2-lora \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "image_url": ""
   }'
```

### 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(
    "fal-ai/trellis-2-lora",
    arguments={
        "image_url": ""
    },
    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("fal-ai/trellis-2-lora", {
  input: {
    image_url: ""
  },
  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/fal-ai/trellis-2-lora)
- [API Documentation](https://fal.ai/models/fal-ai/trellis-2-lora/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=fal-ai/trellis-2-lora)

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