# Hi3D Texture

> Texture an existing geometry mesh using a reference image with Hi3D.


## Overview

- **Endpoint**: `https://fal.run/hitem3d/hi3d/texture`
- **Model ID**: `hitem3d/hi3d/texture`
- **Category**: 3d-to-3d
- **Kind**: inference
**Tags**: 3d-to-3d



## Pricing

Your request is billed at $0.02 per credit.

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 reference image used to texture the model. PNG, JPEG and WebP formats are supported, up to 20MB.
  - Examples: "https://storage.googleapis.com/falserverless/example_inputs/dog.png"

- **`mesh_url`** (`string`, _required_):
  URL of the geometry model to texture. Only GLB format is supported (e.g. the geometry output of the image-to-3d endpoint with enable_texture=false).
  - Examples: "https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/DamagedHelmet/glTF-Binary/DamagedHelmet.glb"

- **`model`** (`ModelEnum`, _optional_):
  Model version used for texturing. Only v1.5 models support the staged texture task. Default value: `"hitem3dv1.5"`
  - Default: `"hitem3dv1.5"`
  - Options: `"hitem3dv1.5"`, `"scene-portraitv1.5"`

- **`resolution`** (`Enum`, _optional_):
  Texture generation resolution. hitem3dv1.5 accepts 512, 1024, 1536 and 1536pro; scene-portraitv1.5 accepts 1536. Defaults to the model's recommended resolution.
  - Options: `"512"`, `"1024"`, `"1536"`, `"1536pro"`

- **`export_format`** (`ExportFormatEnum`, _optional_):
  File format of the generated model. Default value: `"glb"`
  - Default: `"glb"`
  - Options: `"glb"`, `"obj"`, `"stl"`, `"fbx"`, `"usdz"`

- **`enable_safety_checker`** (`boolean`, _optional_):
  If set to true, input images are checked for safety before processing. Default value: `true`
  - Default: `true`



**Required Parameters Example**:

```json
{
  "image_url": "https://storage.googleapis.com/falserverless/example_inputs/dog.png",
  "mesh_url": "https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/DamagedHelmet/glTF-Binary/DamagedHelmet.glb"
}
```

**Full Example**:

```json
{
  "image_url": "https://storage.googleapis.com/falserverless/example_inputs/dog.png",
  "mesh_url": "https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/DamagedHelmet/glTF-Binary/DamagedHelmet.glb",
  "model": "hitem3dv1.5",
  "export_format": "glb",
  "enable_safety_checker": true
}
```


### Output Schema

The API returns the following output format:

- **`model_mesh`** (`File`, _required_):
  Generated 3D model file.

- **`thumbnail`** (`File`, _optional_):
  Preview image of the generated model, when available.



**Example Response**:

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


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/hitem3d/hi3d/texture \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "image_url": "https://storage.googleapis.com/falserverless/example_inputs/dog.png",
     "mesh_url": "https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/DamagedHelmet/glTF-Binary/DamagedHelmet.glb"
   }'
```

### 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(
    "hitem3d/hi3d/texture",
    arguments={
        "image_url": "https://storage.googleapis.com/falserverless/example_inputs/dog.png",
        "mesh_url": "https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/DamagedHelmet/glTF-Binary/DamagedHelmet.glb"
    },
    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("hitem3d/hi3d/texture", {
  input: {
    image_url: "https://storage.googleapis.com/falserverless/example_inputs/dog.png",
    mesh_url: "https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/DamagedHelmet/glTF-Binary/DamagedHelmet.glb"
  },
  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/hitem3d/hi3d/texture)
- [API Documentation](https://fal.ai/models/hitem3d/hi3d/texture/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=hitem3d/hi3d/texture)

### fal.ai Platform

- [Platform Documentation](https://fal.ai/docs/documentation)
- [Python Client](https://fal.ai/docs/api-reference/client-libraries/python)
- [JavaScript Client](https://fal.ai/docs/api-reference/client-libraries/javascript)

### Other agent-readable surfaces

This file covers one model. To find anything else:

- [Platform overview](https://fal.ai/llms.txt): Entry points and representative endpoint IDs
- [Documentation index](https://fal.ai/docs/llms.txt): Every documentation page
- [Full documentation text](https://fal.ai/docs/llms-full.txt): The whole documentation inlined
- Any other model: `https://fal.ai/models/<endpoint-id>/llms.txt`
