# Text to Texture

The Text to Texture API is a feature that allows you to integrate DRESSX's Text to Texture capabilities into your own application. In this section, you'll find all the information you need to get started with this API.

***

<img src="https://1799512836-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fv2HSpUlF4Thrgx47YYeI%2Fuploads%2FKZKEZ4AcpAOghId1s7KK%2FButtons-4.png?alt=media&#x26;token=ceb3355d-99c4-47fc-ac8a-510548dc30f9" alt="" data-size="line">  /v2/pipeline/text-to-texture/

***

### Create a Text to Texture Task <a href="#create-a-text-to-texture-task" id="create-a-text-to-texture-task"></a>

This endpoint allows you to create a new task for texture generation using the Text to Texture feature. Once the task is created, you will need to wait for the response via the provided webhook. Refer to the Text to Texture Task Object to see which properties are included with the task object.

### Parameters

**Required**&#x20;

```
order : Int
```

The unique identifier for the order. This ID helps track the specific task being processed within the system. It is crucial for associating the result with the correct order.

***

```
prompt : String
```

A descriptive text input provided by the user to guide the texture generation process. This description helps the AI understand the type and style of texture to create based on the user's request.

***

```
result_url : String
```

A URL endpoint where the system will send the results of the texture generation task once it is completed. This is typically a webhook that your application listens to for updates.

***

### Optional

```
key : String
```

A unique authentication key used to authorize the request. It ensures that only valid, authenticated users can submit texture generation tasks and receive results.

***

```
num_inference_steps : Int
```

Specifies the number of inference steps the AI model should take to generate the texture. More steps typically result in higher quality but may require more processing time. A lower number can speed up the process with potentially lower quality.

***

```
seed : Int
```

A seed value used to initialize the random number generator. It helps ensure that the generated textures are reproducible, meaning the same seed will produce the same texture each time it is used.

***

```
refine : Bool
```

A flag that indicates whether the generated texture should undergo a refinement process to improve its quality. If set to "True", the result will be further adjusted; if "False", the texture will be returned as initially generated.

***

```
mesh_url : String
```

The URL of an .obj file containing the 3D mesh with UV coordinates. This file will be used in combination with the texture generation process to ensure accurate application of the texture to the mesh.

***

### Request Json Example

```json
{
    "order": 12345,  
    "prompt": "A futuristic metallic texture for a 3D robot suit",  
    "result_url": "https://your-domain.com/orders/update/", 
    "key": "your-coordinator-key", 
    "num_inference_steps": 20, 
    "seed": 987654321, 
    "refine": false, 
    "mesh_url": "https://yourserver.com/path/to/mesh.obj"  
}
```

### Webhook Response Json Example

```json
{
    "order_id": 12345,  
    "status": "success",  // Status of the task (success or failure)
    "render_url": "https://api.dressx.com/v1/files/files/08/example-render.jpg", 
    "mesh_url": "https://api.dressx.com/v1/files/files/mesh/08/example-mesh.obj", 
    "pbr_components": {
        "albedo": "https://api.dressx.com/v1/files/files/texture/08/albedo.jpg", 
        "normal": "https://api.dressx.com/v1/files/files/texture/08/normal.jpg",
        "roughness": "https://api.dressx.com/v1/files/files/texture/08/roughness.jpg", 
        "metallic": "https://api.dressx.com/v1/files/files/texture/08/metallic.jpg", 
    },
    "balance": 10  
}
```

`status`

Status of the task. Possible values are one of `PROCESSIN`, `SUCCEEDED`, `FAILED`, `CANCELED`.
