# Hunyuan Part

> Use the capabilities of hunyuan part to generate point clouds from your 3D files.


## Overview

- **Endpoint**: `https://fal.run/fal-ai/hunyuan-part`
- **Model ID**: `fal-ai/hunyuan-part`
- **Category**: 3d-to-3d
- **Kind**: inference
**Tags**: 3D-to-3D, point-cloud



## Pricing

- **Price**: $0.04 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:


- **`model_file_url`** (`string`, _required_):
  URL of the 3D model file (.glb or .obj) to process for segmentation.
  - Examples: "https://storage.googleapis.com/falserverless/model_tests/video_models/base_basic_shaded.glb"

- **`point_prompt_x`** (`float`, _optional_):
  X coordinate of the point prompt for segmentation (normalized space -1 to 1).
  - Default: `0`
  - Range: `-1` to `1`

- **`point_prompt_y`** (`float`, _optional_):
  Y coordinate of the point prompt for segmentation (normalized space -1 to 1).
  - Default: `0`
  - Range: `-1` to `1`

- **`point_prompt_z`** (`float`, _optional_):
  Z coordinate of the point prompt for segmentation (normalized space -1 to 1).
  - Default: `0`
  - Range: `-1` to `1`

- **`point_num`** (`integer`, _optional_):
  Number of points to sample from the mesh. Default value: `100000`
  - Default: `100000`
  - Range: `10000` to `500000`

- **`use_normal`** (`boolean`, _optional_):
  Whether to use normal information for segmentation. Default value: `true`
  - Default: `true`

- **`noise_std`** (`float`, _optional_):
  Standard deviation of noise to add to sampled points.
  - Default: `0`
  - Range: `0` to `0.02`

- **`seed`** (`integer`, _optional_):
  The same seed and input will produce the same segmentation results.



**Required Parameters Example**:

```json
{
  "model_file_url": "https://storage.googleapis.com/falserverless/model_tests/video_models/base_basic_shaded.glb"
}
```

**Full Example**:

```json
{
  "model_file_url": "https://storage.googleapis.com/falserverless/model_tests/video_models/base_basic_shaded.glb",
  "point_num": 100000,
  "use_normal": true
}
```


### Output Schema

The API returns the following output format:

- **`segmented_mesh`** (`File`, _required_):
  Segmented 3D mesh with mask applied.

- **`mask_1_mesh`** (`File`, _required_):
  Mesh showing segmentation mask 1.

- **`mask_2_mesh`** (`File`, _required_):
  Mesh showing segmentation mask 2.

- **`mask_3_mesh`** (`File`, _required_):
  Mesh showing segmentation mask 3.

- **`best_mask_index`** (`integer`, _required_):
  Index of the best mask (1, 2, or 3) based on IoU score.

- **`iou_scores`** (`list<float>`, _required_):
  IoU scores for each of the three masks.
  - Array of float

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



**Example Response**:

```json
{
  "segmented_mesh": {
    "url": "",
    "content_type": "image/png",
    "file_name": "z9RV14K95DvU.png",
    "file_size": 4404019
  },
  "mask_1_mesh": {
    "url": "",
    "content_type": "image/png",
    "file_name": "z9RV14K95DvU.png",
    "file_size": 4404019
  },
  "mask_2_mesh": {
    "url": "",
    "content_type": "image/png",
    "file_name": "z9RV14K95DvU.png",
    "file_size": 4404019
  },
  "mask_3_mesh": {
    "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/hunyuan-part \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "model_file_url": "https://storage.googleapis.com/falserverless/model_tests/video_models/base_basic_shaded.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(
    "fal-ai/hunyuan-part",
    arguments={
        "model_file_url": "https://storage.googleapis.com/falserverless/model_tests/video_models/base_basic_shaded.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("fal-ai/hunyuan-part", {
  input: {
    model_file_url: "https://storage.googleapis.com/falserverless/model_tests/video_models/base_basic_shaded.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/fal-ai/hunyuan-part)
- [API Documentation](https://fal.ai/models/fal-ai/hunyuan-part/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=fal-ai/hunyuan-part)

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