# Meshy N1 Retexture

> Meshy N1 retexture applies new textures to an existing 3D model using native 3D texturing, producing 2K base color textures from reference images.


## Overview

- **Endpoint**: `https://fal.run/meshy/n1/retexture`
- **Model ID**: `meshy/n1/retexture`
- **Category**: 3d-to-3d
- **Kind**: inference
**Tags**: 3d, 3d-to-3d, textures, pbr



## Pricing

Your request will cost **$0.30** per retextured model.

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:


- **`model_url`** (`string`, _required_):
  URL or base64 data URI of a 3D model to texture. Supports .glb, .gltf, .obj, .fbx, .stl formats. Can be a publicly accessible URL or data URI with MIME type application/octet-stream.
  - Examples: "https://v3b.fal.media/files/b/penguin/DId89qXLu6BXu09RFAwAV_model.glb"

- **`image_style_url`** (`string`, _optional_):
  Single reference image, treated as the front view. Required if multiview_image_urls is not provided. Supports .jpg, .jpeg, .png, and .webp formats.

- **`multiview_image_urls`** (`list<string>`, _optional_):
  1 to 4 reference views of the target texture (first is the front view, order of the rest is irrelevant). Cannot be combined with image_style_url.
  - Array of string

- **`enable_original_uv`** (`boolean`, _optional_):
  Use the original UV mapping of the model instead of generating new UVs. If the model has no original UV, output quality may be reduced. Default value: `true`
  - Default: `true`

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



**Required Parameters Example**:

```json
{
  "model_url": "https://v3b.fal.media/files/b/penguin/DId89qXLu6BXu09RFAwAV_model.glb"
}
```

**Full Example**:

```json
{
  "model_url": "https://v3b.fal.media/files/b/penguin/DId89qXLu6BXu09RFAwAV_model.glb",
  "enable_original_uv": true,
  "enable_safety_checker": true
}
```


### Output Schema

The API returns the following output format:

- **`model_glb`** (`File`, _required_):
  Retextured 3D object in GLB format.
  - Examples: {"file_name":"model.glb","content_type":"model/gltf-binary","url":"https://v3b.fal.media/files/b/tiger/pU0TtsRTxXM6VnKEYTHSV_model.glb","file_size":4097640}

- **`thumbnail`** (`File`, _optional_):
  Preview thumbnail of the retextured model
  - Examples: {"file_name":"preview.png","content_type":"image/png","url":"https://v3b.fal.media/files/b/lion/jFrzgIJMbaPQi_4HCEa8u_preview.png","file_size":124859}

- **`model_urls`** (`ModelUrls`, _required_):
  URLs for different 3D model formats
  - Examples: {"fbx":{"file_name":"model.fbx","content_type":"application/octet-stream","url":"https://v3b.fal.media/files/b/rabbit/agzKf8N8zeVnteg72NiF4_model.fbx","file_size":4713692},"obj":{"file_name":"model.obj","content_type":"model/obj","url":"https://v3b.fal.media/files/b/zebra/M5aK_b6vKH7KeGCZoSLq7_model.obj","file_size":2964508},"usdz":{"file_name":"model.usdz","content_type":"model/vnd.usdz+zip","url":"https://v3b.fal.media/files/b/panda/4ItUhLHiH4foEw30qcWZv_model.usdz","file_size":3886518},"glb":{"file_name":"model.glb","content_type":"model/gltf-binary","url":"https://v3b.fal.media/files/b/tiger/pU0TtsRTxXM6VnKEYTHSV_model.glb","file_size":4097640}}

- **`texture_urls`** (`list<TextureFiles>`, _optional_):
  Array of texture file objects
  - Array of TextureFiles
  - Examples: [{"base_color":{"file_name":"texture_0.png","content_type":"image/png","url":"https://v3b.fal.media/files/b/zebra/opBcVy7AK-GOlCTUz-_GZ_texture_0.png","file_size":3455709}}]

- **`text_style_prompt`** (`string`, _optional_):
  The text prompt used for texturing (if provided)
  - Examples: "red and black chest"

- **`image_style_url`** (`string`, _optional_):
  The image URL used for texturing (if provided)



**Example Response**:

```json
{
  "model_glb": {
    "file_name": "model.glb",
    "content_type": "model/gltf-binary",
    "url": "https://v3b.fal.media/files/b/tiger/pU0TtsRTxXM6VnKEYTHSV_model.glb",
    "file_size": 4097640
  },
  "thumbnail": {
    "file_name": "preview.png",
    "content_type": "image/png",
    "url": "https://v3b.fal.media/files/b/lion/jFrzgIJMbaPQi_4HCEa8u_preview.png",
    "file_size": 124859
  },
  "model_urls": {
    "fbx": {
      "file_name": "model.fbx",
      "content_type": "application/octet-stream",
      "url": "https://v3b.fal.media/files/b/rabbit/agzKf8N8zeVnteg72NiF4_model.fbx",
      "file_size": 4713692
    },
    "obj": {
      "file_name": "model.obj",
      "content_type": "model/obj",
      "url": "https://v3b.fal.media/files/b/zebra/M5aK_b6vKH7KeGCZoSLq7_model.obj",
      "file_size": 2964508
    },
    "usdz": {
      "file_name": "model.usdz",
      "content_type": "model/vnd.usdz+zip",
      "url": "https://v3b.fal.media/files/b/panda/4ItUhLHiH4foEw30qcWZv_model.usdz",
      "file_size": 3886518
    },
    "glb": {
      "file_name": "model.glb",
      "content_type": "model/gltf-binary",
      "url": "https://v3b.fal.media/files/b/tiger/pU0TtsRTxXM6VnKEYTHSV_model.glb",
      "file_size": 4097640
    }
  },
  "texture_urls": [
    {
      "base_color": {
        "file_name": "texture_0.png",
        "content_type": "image/png",
        "url": "https://v3b.fal.media/files/b/zebra/opBcVy7AK-GOlCTUz-_GZ_texture_0.png",
        "file_size": 3455709
      }
    }
  ],
  "text_style_prompt": "red and black chest"
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/meshy/n1/retexture \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "model_url": "https://v3b.fal.media/files/b/penguin/DId89qXLu6BXu09RFAwAV_model.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(
    "meshy/n1/retexture",
    arguments={
        "model_url": "https://v3b.fal.media/files/b/penguin/DId89qXLu6BXu09RFAwAV_model.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("meshy/n1/retexture", {
  input: {
    model_url: "https://v3b.fal.media/files/b/penguin/DId89qXLu6BXu09RFAwAV_model.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);
```


## Deploy your own model

To run your own weights, a fine-tune or a custom pipeline on the GPUs that serve this API, deploy it on fal Serverless. GPUs from H100 (80GB) to B300 (288GB), billed per second; an H100 is $4.50/h list, as low as $2.49/h. Prices, GPU specs and deploy steps: [fal Serverless](https://fal.ai/serverless.md).

## Additional Resources

### Documentation

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

### 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
- [Pricing](https://fal.ai/pricing.md): Model API and Serverless GPU prices
- [fal Serverless](https://fal.ai/serverless.md): Deploy your own models: GPU prices, specs and steps
- Any other model: `https://fal.ai/models/<endpoint-id>/llms.txt`
