---
name: "enhanceClarityCancel"
mode: "kit"
versionRequirements:
  - { name: "AIKit", version: "1.4.1" }
  - { name: "@ray-js/ray", version: "1.7.37" }
platform:
  - "iOS"
  - "Android"
async: true
title: "enhanceClarityCancel - 取消图像清晰度增强优化"
---

## enhanceClarityCancel

> [VERSION] AIKit >= 1.4.1 | @ray-js/ray >= 1.7.37

> [PLATFORM] iOS, Android

> ⚡ **支持 Promise 调用** — 不传 success / fail / complete 回调时，该方法返回 Promise。

### 描述

取消图像清晰度增强处理

### 参数

| 属性 | 类型 | 必填 | 默认值 | 最低版本 | 描述 |
| --- | --- | --- | --- | --- | --- |
| `trace_id` | `string` | 是 | - | `2.1.0` | 链路id |
| `device_id` | `string` | 是 | - | `2.1.0` | 设备id |
| `scene_type` | `string` | 是 | - | `2.1.0` | 业务类型 |
| `enhance_type` | `1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8` | 否 | `1` | `2.1.0` | 增强类型 |
| `complete` | `() => void` | 否 | - | - | 接口调用结束的回调函数（调用成功、失败都会执行） |
| `success` | `() => void` | 否 | - | - | 接口调用成功的回调函数 |
| `fail` | `(params: Object) => void` ↓见下方 | 否 | - | - | 接口调用失败的回调函数 |

#### fail 回调参数

| 属性 | 类型 | 描述 |
| --- | --- | --- |
| `errorMsg` | `string` | 错误信息 |
| `errorCode` | `string \| number` | 错误码 |
| `innerError` | `Object` | 错误扩展 |

##### fail(params).innerError 的属性

| 属性 | 类型 | 描述 |
| --- | --- | --- |
| `errorCode` | `string \| number` | 错误扩展码 |
| `errorMsg` | `string` | 错误扩展信息 |


### 合法值

##### `enhance_type` 合法值

| 值 | 说明 |
| --- | --- |
| `1` | 没有操作,默认 |
| `2` | 降噪 |
| `3` | 暗光增强 |
| `4` | 超分 |
| `5` | 降噪+暗光增强 |
| `6` | 降噪+超分 |
| `7` | 暗光增强+超分 |
| `8` | 降噪+暗光增强+超分 |


### 示例代码

#### 基础调用

```tsx
import { ai } from '@ray-js/ray'

const { enhanceClarityCancel } = ai;

enhanceClarityCancel({
  trace_id: 'example',
  device_id: 'device_001',
  scene_type: 'example',
  success: () => {
    console.log('enhanceClarityCancel success');
  },
  fail: (error) => {
    console.log('enhanceClarityCancel fail', error.errorMsg);
  },
});
```
