Authorization: Bearer ********************
{
"model": "recraftv3", // recraftv3、flux系列、sd系列、cogview系列、hunyuan系列、step系列、kling系列
"prompt": "鸟瞰图,海岸线,海水清澈见底,细节和自然之美。特写,超高清,最好的质量,超高细节的画质,8K分辨率", // 必需参数,描述所需图像的文本,最大长度为500个字符
"n": 1, // 整数或null,默认为1,目前仅支持n=1和n=2
"style_id": null, // UUID或null,使用之前上传的风格作为参考
"style": "realistic_image", // 字符串或null,默认为realistic_image,生成图像的风格
"substyle": null, // 字符串或null,子风格,具体内容在上面有涉及
"response_format": "url", // 字符串或null,默认为url,返回生成图像的格式,必须是url或b64_json之一
"size": "1024x1024", // 字符串或null,默认为1024x1024,生成图像的大小,以WxH格式表示
"controls": null // 对象或null,一组自定义参数,用于调整生成过程
}
curl --location --request POST '/v1/images/generations' \
--header 'Authorization: Bearer {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "recraftv3", // recraftv3、flux系列、sd系列、cogview系列、hunyuan系列、step系列、kling系列
"prompt": "鸟瞰图,海岸线,海水清澈见底,细节和自然之美。特写,超高清,最好的质量,超高细节的画质,8K分辨率", // 必需参数,描述所需图像的文本,最大长度为500个字符
"n": 1, // 整数或null,默认为1,目前仅支持n=1和n=2
"style_id": null, // UUID或null,使用之前上传的风格作为参考
"style": "realistic_image", // 字符串或null,默认为realistic_image,生成图像的风格
"substyle": null, // 字符串或null,子风格,具体内容在上面有涉及
"response_format": "url", // 字符串或null,默认为url,返回生成图像的格式,必须是url或b64_json之一
"size": "1024x1024", // 字符串或null,默认为1024x1024,生成图像的大小,以WxH格式表示
"controls": null // 对象或null,一组自定义参数,用于调整生成过程
}'
{
"created": 1730454746,
"data": [
{
"url": "https://sfile.chatglm.cn/chatglm4/2f7c6495-6f25-4f06-a879-4060fb6deb94.png"
}
],
"image": [
"https://sfile.chatglm.cn/chatglm4/2f7c6495-6f25-4f06-a879-4060fb6deb94.png"
],
"metadata": {
"credits": 1,
"height": 1024,
"images": [
{
"image_id": "6373079f-9bf2-45e4-99be-6d040902b9d0",
"image_invariants": {
"preset": "realistic_image"
},
"transparent": false,
"vector_image": false
}
],
"random_seed": 3740463984,
"request_id": "f97fb170-2f7a-4493-8693-1717506365b5",
"transform_model": "recraftv3",
"width": 1024
}
}