Image Editing (Image-to-Image)
Novel AI async image-to-image / image editing endpoint
Novel AI image-to-image is called through the async image task entry: POST /v1/images/async/generations, carrying one reference image in the image field (an http/https image URL or a base64 data URI) to enter image-to-image / editing mode — for sketch-to-final, style transfer, redraw and other anime image workflows.
The interface is async: on success it returns an image.task object (with task_id); poll the Query Result endpoint with the returned task ID until status becomes completed to fetch the final image.
Supported models
nai-diffusion-4-5-full, nai-diffusion-4-5-curated.
Single reference image
Novel AI image-to-image accepts exactly one reference image per request, passed in the image field as a publicly reachable http/https image URL or a base64 data URI (data:image/...;base64,...). Local files can be converted to base64 and passed directly — no upload needed. The generation count n supports 1-4.
Authorization
BearerAuth
使用 Bearer Token 认证。
格式: Authorization: Bearer sk-xxxxxx
令牌需开通对应模型的调用权限。
In: header
Request Body
application/json
模型名称,可选:nai-diffusion-4-5-full、nai-diffusion-4-5-curated
编辑指令,描述对参考图的保留 / 修改要求
参考图:http/https 图片 URL 或 base64 data URI(data:image/...;base64,...)。每个请求仅支持 1 张
生成数量(1-4),默认 1
1 <= value <= 4输出尺寸(像素,OpenAI 风格 宽x高),例如 1024x1024、竖版 832x1216、横版 1216x832。不传默认 1024x1024
Response Body
application/json
application/json
application/json
curl -X POST "https://www.omwai.xyz/v1/images/async/generations" \ -H "Content-Type: application/json" \ -d '{ "model": "nai-diffusion-4-5-curated", "prompt": "保留人物主体,将背景改为樱花飘落的校园,动漫风格", "image": "https://example.com/source.png", "size": "1024x1024", "n": 1 }'{
"id": "task_01J8ABCDEFGHIJKLMNOPQRST",
"task_id": "task_01J8ABCDEFGHIJKLMNOPQRST",
"object": "image.task",
"model": "nai-diffusion-4-5-curated",
"status": "queued",
"progress": "0%",
"created_at": 1788256630,
"completed_at": 1788256720
}{
"code": "invalid_request",
"message": "string"
}{
"code": "string",
"message": "string"
}Async flow
POST /v1/images/async/generationssubmits the task and returnstask_id(prefixed withtask_) andstatus=queued;- Poll
GET /v1/images/async/generations/{task_id}with thattask_id; - When
status=completed, thedataarray contains the final image URL (urlfield); whenfailed,errorexplains why.
Images are kept for about 2 hours
The returned image URL is temporary (metadata.assetsExpireAt holds the expiry time in Unix seconds); images are kept for about 2 hours and then deleted automatically. Download them before they expire if you need long-term storage. Querying a task that does not exist or is not accessible returns 400.
How is this guide?
Last updated on