Skip to main content
POST
编辑图像
Edit an existing image with a text prompt. Submit the request as multipart/form-data with the source file in the image field.
The snippets below are complete requests. Set HILINKUP_API_KEY to your real key first, and replace model with an image model ID returned by GET /v1/models that supports editing.

Request parameters

string
required
An image model ID that supports editing. Not every generation model supports edits.
string
required
A text description of the requested change. The more specific the prompt, the more reliably the source image is preserved.
file
required
The source image file. Supported formats and size limits depend on the model.
integer
default:"1"
Number of images to generate. Some models only support 1.
string
Output image size. Valid values depend on the model.

Request examples

Response

integer
Unix timestamp of the generation result.
array
List of image results. Each item contains url or b64_json.
The response may return a temporary URL or Base64 data, usually in a b64_json field. Download and store the result before the URL expires.

Saving the result

The model IDs, response fields, and URLs in these examples illustrate the request format only. Confirm in the model catalog or console that your account can access the editing model, and check its input image limits and output sizes.
Stating what must stay unchanged (background, composition, subject features) usually reduces unintended edits, but how closely a model follows this varies.

Next steps

To create a new image from text only, use Generate images.

Authorizations

Authorization
string
header
required

在控制台创建的 API Key,格式为 Authorization: Bearer HILINKUP_API_KEY。

Body

multipart/form-data
model
string
required

支持图像编辑的模型 ID。并非所有图像生成模型都支持编辑。

prompt
string
required

描述修改目标的文本提示。

image
file
required

要编辑的原图文件。支持的格式和大小由模型决定。

n
integer
default:1

要生成的图像数量。部分模型只支持 1。

size
string

输出图像尺寸。可用值由模型决定。

Response

200 - application/json

图像编辑结果

created
integer

生成结果的 Unix 时间戳。

data
object[]
Last modified on October 8, 2026