图像 API
文生图
POST https://ai.jhdataops.com/v1/images/generations| 参数 | 必填 | 说明 |
|---|---|---|
model | 是 | 如 gpt-image-2 |
prompt | 是 | 提示词 |
size | 否 | 如 1024x1024 |
n | 否 | 数量 |
response_format | 否 | url 或 b64_json |
bash
curl https://ai.jhdataops.com/v1/images/generations \
-H "Authorization: Bearer sk-xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-image-2","prompt":"星空下的灯塔","size":"1024x1024"}'图像编辑
POST https://ai.jhdataops.com/v1/images/edits (multipart/form-data)bash
curl https://ai.jhdataops.com/v1/images/edits \
-H "Authorization: Bearer sk-xxxxxxxx" \
-F model="gpt-image-2" \
-F image="@input.png" \
-F prompt="把天空换成晚霞"Midjourney 代理(异步)
| 步骤 | 路径 |
|---|---|
| 提交绘画 | POST /mj/submit/imagine |
| 变体/放大 | POST /mj/submit/change、/mj/submit/simple-change |
| 混图 | POST /mj/submit/blend |
| 描述 | POST /mj/submit/describe |
| 查询任务 | GET /mj/task/{id}/fetch |
bash
# 1. 提交
curl https://ai.jhdataops.com/mj/submit/imagine \
-H "Authorization: Bearer sk-xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"prompt":"a fox in the snow --ar 16:9 --v 6"}'
# 2. 轮询(用返回的 task_id)
curl https://ai.jhdataops.com/mj/task/{task_id}/fetch \
-H "Authorization: Bearer sk-xxxxxxxx"详见 图像模型。
