- 无界AI企业服务
- 无界AI企业智能客服
- 更新日志
- 公告
- API接入指南
- 作画指南
- AI专业版作画
- AI普通版作画
- AI视频生视频
- AI咒语解析
- 付费开通API
- AI化身&个性相机
- 提升作画效率
- 自定义镜像
- 用户账户
- LLM对话聊天
- OpenAI Image
发起4K图作画
POST
https://gate.wujieai.net/wj-open/v1/ai/create/cutDiffusion
AI普通版作画作画流程
请求参数
Body 参数application/json
cutdiffusion
object (CutDiffusionParam_request)
必需
目前约束:
1.只能用于文生图,对尺寸有相关约束查看width、height描述。
2.只有部分模型支持,查看模型列表支持的 supportCutdiffusion 字段返回true。(object)
cutdiff_proportion
number <float>
可选
示例值:
0.5
cfg_scale1
number <float>
可选
示例值:
7.0
cfg_scale2
number <float>
可选
示例值:
7.0
model
integer <int32>
必需
可通过
获取作画模型列表(/ai/model_base_infos)
接口查询,获取对应列表接口返回的model_code
字段,仅supportCutdiffusion
字段返回true的模型支持。示例值:
127
prompt
string <string>
可选
可选平台资源接口预设的prompt来查看效果。
Validate[max: 1500; ]
示例值:
夜幕下的赛博朋克城市
uc_prompt
string <string>
可选
注:
1.
2.
Validate[max: 1000; ]
示例值:
低分辨率,不良解剖结构,文本,低质量,(突变,绘制不良:1.2),肥胖,不良比例
fully_custom_uc_prompt
boolean
可选
true:仅客户上定义的负面描述词会生效。
false:使用官方模型定义的负向描述。
示例值:
true
num
integer <int32>
必需
示例值:
1
width
integer <int32>
可选
注:
支持自定义尺寸,尺寸 要求为64的倍数,最小尺寸为64,尺寸不为64的倍数的,会向64对齐, 例96对齐64, 97对齐到128。
使用cutdiffion单边范围为【1088,3072】,分辨率乘积不超过5017600。
示例值:
1088
height
integer <int32>
可选
示例值:
1088
image_type
array[string]
可选
可通过
获取作画模型的预设资源(ai/default_resource)
接口查询,获取返回列表中的画面类型(image_type
-name
)字段。示例值:
[超现实照片]
style
array[string]
可选
可通过
获取作画模型的预设资源(ai/default_resource)
接口查询,获取返回列表中的风格(style
-name
)字段。示例值:
[赛博朋克]
artists
array[string]
可选
可通过
获取作画模型的预设资源(ai/default_resource)
接口查询,获取返回列表中的艺术家(artist
-name
)字段。示例值:
[鸟山明]
element_magic
array[string]
可选
可通过
获取作画模型的预设资源(ai/default_resource)
接口查询,获取返回列表中的元素魔法(element_magic
-key
)字段。示例值:
[星空法]
style_decoration
array[string]
可选
可通过
获取作画模型的预设资源(ai/default_resource)
接口查询,获取返回列表中的元素魔法(style_decoration
-key
)字段。imageType,style,artist,elementMagic本质上也都属于styleDecoration。
示例值:
[星空法]
accelerate_times
integer <int32>
可选
默认0,每加1就是往队列前面多插1位,一次对应2积分(批量作画的积分消耗则还要算上对应作画数量)。
示例值:
2
character
array[string]
可选
可通过
获取作画模型的预设资源(ai/default_resource)
接口查询,获取返回列表中的角色(character
-key
)字段。示例值:
[]
model_fusion
array[object (AiArtworkModelFusionVO_request) {2}]
可选
可通过
获取作画模型的预设资源(ai/default_resource)
接口查询,获取返回列表中的的融合模型(model_fusion
-key
)字段。key
string <string>
融合模型key
示例值:
mf-可爱的线条平涂风
weight
number <float>
权重
示例值:
0.6
style_model
string <string>
可选
获取作画风格模型的预设资源(/ai/default_resource_style_model)
接口查询,获取对应列表返回的key
字段。注:需使用底模(即model_code)支持4k的风格模型。
示例值:
stm-8649ZV9C
steps
integer <int32>
可选
注:
1.
2.
示例值:
20
cfg
number <float>
可选
表示AI对描述参数的倾向程度,数值越大会越专注于提示词的内容,生成更加符合描述的图像。
示例值:
7
sampler_index
integer <int32>
可选
不同model支持的采样模式不同,可通过
获取作画模型的预设资源(/ai/default_resource)
接口查询,获取返回信息列表中的采样模型(sampler_models
-sampler_index
)字段。示例值:
16
seed
string <string>
可选
通过随机种子确定扩散的初始状态,进而控制生成的样本的多样性。
相同的种子值可以保持图像的一致性,若设置相同的种子编号、模型,可以重新生成类似的图像。
注:目前不支持字母,传字母会导致作画超时或失败。
示例值:
-1
clip_skip
integer <int32>
可选
描述画面的准确程度与数值大小成反比,数值越小表示对图像的控制度越高,最佳使用区间为1-2。
示例值:
5
notify_url
string <string>
可选
回调重试规则:
1.
2.
回调报文:
{
"artwork_url": "https://cdn.wujiebantu.com/ai/530FFE6722D2A2B4A9504166221AAB40-01.jpg",
"audit_info": {
"check_fail": false,
"hit": false,
"data_id": "245959",
"total_suggestion": "PASS",
"scan_scene_d_t_o_s": [{
"rate": 0.9944,
"suggestion": "pass",
"label": "politics",
"label_desc": "涉政",
"scene": "TERRORISM"
},
{
"rate": 1,
"suggestion": "pass",
"label": "terrorism",
"label_desc": "暴恐",
"scene": "TERRORISM"
},
{
"rate": 0.9993,
"suggestion": "pass",
"label": "porn",
"label_desc": "色情",
"scene": "PORN"
},
{
"rate": 1,
"suggestion": "pass",
"label": "prohibition",
"label_desc": "违禁",
"scene": "TERRORISM"
},
{
"rate": 0.9986,
"suggestion": "pass",
"label": "sexy",
"label_desc": "性感",
"scene": "PORN"
}
],
"url": "https://cdn.wujiebantu.com/ai/810F1750EFF2EC416ED6682DFFCFBF2C-01.jpg-v800"
},
"batch_task_key": "14DBBD0743C8715D92183756E3FB398C",
"code": 0,
"complete_time": 1681109462,
"integral_cost": 2,
"integral_cost_message": "积分已扣除",
"involve_yellow": 0,
"key": "EF8DF2DCF18D0D69F7F836A100C857AF",
"success": true
}
success - 作画是否成功
code - 作画是否成功code,0=成功 1=失败
key - 对应作画任务的key
artwork_url - 作画生成结果图url
complete_time - 作画完成时间
integral_cost - 积分花费
integral_cost_message - 积分花费说明
示例值:
www.tobias-wiegand.biz
示例
{
"cutdiffusion": {
"cutdiff_proportion": 0.5,
"cfg_scale1": 7,
"cfg_scale2": 7
},
"model": 127,
"prompt": "夜幕下的赛博朋克城市",
"uc_prompt": "低分辨率,不良解剖结构,文本,低质量,(突变,绘制不良:1.2),肥胖,不良比例",
"fully_custom_uc_prompt": true,
"num": 1,
"width": 1088,
"height": 1088,
"image_type": [
"超现实照片"
],
"style": [
"赛博朋克"
],
"artists": [
"鸟山明"
],
"element_magic": [
"星空法"
],
"style_decoration": [
"星空法"
],
"accelerate_times": 2,
"character": [
""
],
"model_fusion": [
{
"key": "mf-可爱的线条平涂风",
"weight": 0.6
}
],
"style_model": "stm-8649ZV9C",
"steps": 20,
"cfg": 7,
"sampler_index": 16,
"seed": "-1",
"clip_skip": 5,
"notify_url": "www.tobias-wiegand.biz"
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://gate.wujieai.net/wj-open/v1/ai/create/cutDiffusion' \
--header 'Content-Type: application/json' \
--data-raw '{
"cutdiffusion": {
"cutdiff_proportion": 0.5,
"cfg_scale1": 7.0,
"cfg_scale2": 7.0
},
"model": 127,
"prompt": "夜幕下的赛博朋克城市",
"uc_prompt": "低分辨率,不良解剖结构,文本,低质量,(突变,绘制不良:1.2),肥胖,不良比例",
"fully_custom_uc_prompt": true,
"num": 1,
"width": 1088,
"height": 1088,
"image_type": [
"超现实照片"
],
"style": [
"赛博朋克"
],
"artists": [
"鸟山明"
],
"element_magic": [
"星空法"
],
"style_decoration": [
"星空法"
],
"accelerate_times": 2,
"character": [
""
],
"model_fusion": [
{
"key": "mf-可爱的线条平涂风",
"weight": 0.6
}
],
"style_model": "stm-8649ZV9C",
"steps": 20,
"cfg": 7,
"sampler_index": 16,
"seed": "-1",
"clip_skip": 5,
"notify_url": "www.tobias-wiegand.biz"
}'
返回响应
🟢200成功
*/*
Body
code
string <string>
响应code
示例值:
200
message
string <string>
失败信息
示例值:
success
data
object (AiArtworkKeysVo_response)
可选
keys
array[string]
作画结果Key列表
示例值:
C5B5FE8DBF3679D9049342C130341BD9
results
array[object (CrAiArtworkCreateResult_response) {3}]
可选
expected_integral_cost
integer <int32>
预计总消耗积分数
示例值:
2
示例
{
"code": "200",
"message": "success",
"data": {
"keys": "C5B5FE8DBF3679D9049342C130341BD9",
"results": [
{
"key": "C5B5FE8DBF3679D9049342C130341BD9",
"expected_second": 12,
"batch_task_key": "14DBBD0743C8715D92183756E3FB398C"
}
],
"expected_integral_cost": 2
}
}