Qiniu AI icon

Qiniu AI

Interact with Qiniu AI services - Chat, Image, Video, Agent and more

Image → Edit

AI-generated

Summary

Edit a reference image using a Qiniu AI model, submitting an edit task and returning its status, task ID, and optionally generated images.

Inputs

  • model (required) — The model to use for image editing. Options include Kling V2.1, Kling V2, Kling V1.5, Gemini 3.0 Pro Image Preview, Gemini 2.5 Flash Image, Doubao 1.5 Vision Pro, and Qwen2.5 VL 72B Instruct. Default: kling-v2-1.
  • prompt (required) — Description of the image to edit.
  • referenceImageUrl — URL of the image to edit. Used as the source image for the edit operation.
  • binaryPropertyName — Name of the binary property containing the image to edit. Defaults to 'data'.
  • waitForCompletion — Whether to wait for the image to be fully generated before returning. For edit operations, the task is submitted and its status is returned regardless of this setting. Default: true.
  • options — Additional editing options collected into a single configuration object.

Output shape

json: { images: [{ url: string, index: integer }], status: string, taskId: string, isSync: boolean, imageCount: integer, _raw: object }, binary: object | null

json.images contains generated image URLs and their zero-based indices. status reflects the API task status. taskId is the server-assigned task identifier for polling. isSync indicates if the operation completed synchronously. imageCount is the number of returned images. _raw is the full API response object. binary is an object keyed by 'data' (first image) and 'data_N' (subsequent images) containing Buffer objects decoded from base64; it is null when no images with base64 data are present in the result.

Examples

Example 1: Edit a reference image with Kling V2.1 model, 50% strength, 16:9 aspect ratio, returning two images.

model= kling-v2-1, prompt= portrait of a dog, referenceImageUrl= https://example.com/input.jpg, options.aspectRatio= 16:9, options.n= 2, options.strength= 0.5, waitForCompletion= false

Links

Discussion