Jimeng Image

Jimeng Image Editing

Use `POST /v1/images/edits` to generate a new image by editing based on a reference image.

POSThttps://zx1.deepwl.net/v1/images/edits
Request
curl -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"
Response
{
  "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 model
  • jimeng-4.5: Jimeng 4.5 model

Request Headers

Authorizationstring必填

Authentication header. Uses a Bearer token, e.g. Bearer YOUR_API_KEY.

Request Body

modelstring

Model 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.

ninteger

Number of images. The number of images to generate, defaults to 1.

ratiostring

Aspect ratio of the generated image. For example, 16:9, 1:1, 9:16, etc.

qualitystring

Quality 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_formatstring

Format of the returned generated image. Must be one of url or b64_json.

resolutionstring

Resolution. Optional values: 1k, 2k, 4k.

Request Examples

Response Examples

Response Fields

createdinteger

Generation timestamp (Unix timestamp).

dataarray

Array of generation results.

urlstring

URL of the generated image.

revised_promptstring

Rewritten prompt (returned by some upstream services).