> ## Documentation Index
> Fetch the complete documentation index at: https://phaseo.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# 图像编辑

> 使用 TypeScript SDK 调用 /images/edits。

**方法**：`client.generateImageEdit()`。

### 示例

```typescript theme={null}
const edited = await client.generateImageEdit({
  model: "openai/gpt-image-1",
  prompt: "Make it sunset",
  image: "data:image/png;base64,...",
  mask: "data:image/png;base64,...",
});
```

### 关键参数

* `model`（必填）：支持图像编辑的模型 ID。
* `image`（必填）：源图像的 Base64 数据 URL 或 URL。
* `prompt`：可选的新编辑指令。
* `mask`：可选蒙版（透明区域会被编辑）。
* `n`（1–10）：编辑后生成的变体数量。
* `size`：例如 `1024x1024`、`1024x1792`、`1792x1024`。
* `response_format`：`url` 或 `b64_json`。
* `user`：可选的终端用户标记。

### 返回值

`ImageGenerationResponse`

```json theme={null}
{
  "data": [
    {
      "url": "https://example.com/edited_image.png"
    }
  ]
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.