Jimeng Image Editing
Use `POST /v1/images/edits` to generate a new image by editing based on a reference image.
https://zx1.deepwl.net/v1/images/editscurl -X POST https://zx1.deepwl.net/v1/images/edits \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "model=jimeng-4.0" \
-F "prompt=Generate a photorealistic image based on the reference image" \
-F "image=@/path/to/image.png" \
-F "n=1" \
-F "ratio=16:9"{
"created": 1735689600,
"data": [
{
"url": "https://example.com/edited-image.png",
"revised_prompt": "Generate a photorealistic image based on the reference image"
}
]
}An OpenAI-compatible image editing API, submitted using multipart/form-data. A reference image file is required, and it supports generating new images by editing based on the reference image with Jimeng models.
Supported Models
jimeng-4.0: Jimeng 4.0 modeljimeng-4.5: Jimeng 4.5 model
Request Headers
Authorizationstring必填Authentication header. Uses a Bearer token, e.g. Bearer YOUR_API_KEY.
Request Body
modelstringModel name. For example, jimeng-4.0, jimeng-4.5.
promptstring必填Prompt. Text describing the editing content, supports Chinese and English.
imagefile必填The image to edit. Upload a single image file for editing. It must be a supported image file, supporting png, webp, and jpg formats, with each image no larger than 25MB.
nintegerNumber of images. The number of images to generate, defaults to 1.
ratiostringAspect ratio of the generated image. For example, 16:9, 1:1, 9:16, etc.
qualitystringQuality of the generated image. auto (default) will automatically select the best quality for the given model. gpt-image-l supports high, medium, and low; dall-e-3 supports hd and standard; dall-e-2 supports only standard.
response_formatstringFormat of the returned generated image. Must be one of url or b64_json.
resolutionstringResolution. Optional values: 1k, 2k, 4k.
Request Examples
Response Examples
Response Fields
createdintegerGeneration timestamp (Unix timestamp).
dataarrayArray of generation results.
urlstringURL of the generated image.
revised_promptstringRewritten prompt (returned by some upstream services).