Img Open
  1. 绘图工具
Img Open
  • CV任务状态码信息附录
  • 绘图信息
    • sd 文生图-v2
      POST
    • sd 文生图-v3
      POST
    • sd 图生图-v2
      POST
    • sd 图生图-v3
      POST
    • sd 局部重绘-v1
      POST
    • sd controlnet 生图
      POST
    • 查询模型列表
      POST
    • 查询lora列表
      POST
    • 查询vae列表
      POST
    • 查询Embedding列表
      POST
  • 绘图任务
    • 查询归档任务详情
    • 查询任务实时状态 (百分比/进度条/中间图)
    • 绘图工具任务查询
  • 模型训练
    • 提交训练任务
    • 训练结果回调
  • 绘图工具
    • Flux文生图
      POST
    • 个性化写真
      POST
    • 高级换脸
      POST
    • 超级换脸 faceFusion
      POST
    • 面部检测(脸部提取) faceDetection
      POST
    • 换发型
      POST
    • 提示词扩写
      POST
    • sd prompts优化
      POST
    • 提示词扩写优化
      POST
    • 图转文
      POST
    • 超分辨
      POST
    • 换脸 roop
      POST
    • 面部修复
      POST
    • 智能擦除
      POST
    • 风格识别
      POST
    • 图片外扩
      POST
    • CNT预览
      POST
    • 背景去除
      POST
    • 图片扩大
      POST
    • 给图片加水印
      POST
    • 图片去水印
      POST
    • 图生视频
      POST
  • 图片检测
    • 异步图片检测
  • 视频工具
    • 视频加水印
    • 移除视频背景
    • 视频比例调整
    • 扩大视频图像
    • 视频补帧
    • 视频格式转换
  • 音频工具
    • 人声分离
    • 文生音乐
    • 文字配音
    • 生成歌词
  • 翻译
    • 翻译
  1. 绘图工具

sd prompts优化

POST
/AIGCImgOpenServ/saas/tool/sdPrompts

请求参数

Body 参数application/json
task_id
string 
任务ID
必需
raw_prompt
string 
原始待扩写的提示词
必需
top_k
integer 
可选
取值范围:[0, 250],精度为1;生成下一个token时,只能考虑前k个概率最高的tokens;越大,生成文本的多样性越强;越小,生成文本的多样性越小;当K=0时,禁用此采样模式
top_p
number 
可选
取值范围:[0.01, 1.00],精度为0.01;生成下一个token时,只截断选取从高到低累积概率达到top_p的tokens进行预测;越大,多样性越高
temperature
number 
可选
取值范围:[0.1, 3.0],精度为0.1;用于调节预测下一个token概率;越大,随机性、多样性越高;temperature=1时表示无作用
repetition_penalty
number 
可选
取值范围:[0.1, 5.0],精度为0.1;重复惩罚系数,repetition_penalty=1时表示不进行惩罚
max_new_tokens
integer 
可选
取值范围:[32, 512],精度为16;允许生成的最大tokens的数量,不考虑输入prompt中的tokens数;设置越大,可能生成prompt越长,耗时越长
min_new_tokens
integer 
可选
取值范围:[16, max_new_tokens],精度为16;生成的最小tokens的数量,不考虑输入prompt中的tokens数
num_return_sequences
integer 
可选
取值范围:[1, 10],精度为1;一次生成prompts条数,越大耗时越长;使用gpt2模型时最好设置小于3,太多后易出现生成的多条prompts重复
示例
{
  "task_id": "0001",
  "raw_prompt": "girl",
  "top_k": 50,
  "top_p": 0.95,
  "temperature": 1,
  "repetition_penalty": 1.1,
  "max_new_tokens": 128,
  "min_new_tokens": 16,
  "num_return_sequences": 1
}

示例代码

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://api.zhiqite.com/AIGCImgOpenServ/saas/tool/sdPrompts' \
--header 'Content-Type: application/json' \
--data-raw '{
    "task_id": "0001",
    "raw_prompt": "girl",
    "top_k": 50,
    "top_p": 0.95,
    "temperature": 1,
    "repetition_penalty": 1.1,
    "max_new_tokens": 128,
    "min_new_tokens": 16,
    "num_return_sequences": 1
}'

返回响应

🟢200成功
application/json
Body
task_id
string 
任务ID
必需
tool_task
string 
当前接口任务类型
必需
status
integer 
0是成功,1是失败
必需
prompts
array[string]
必需
返回的提示词列表,个数与请求参数中num_return_sequences相同
示例
{
  "task_id": "0001",
  "tool_task": "sd_prompts",
  "status": 0,
  "prompts": [
    "highres, masterpiece, perfect ligthing, (shy smile:1.1), cinematic light, best quality, depth of field, 1 girl, freckles, blush",
    "a full body portrait of a beautiful 20 yo woman, amazing body, Amazing fine detail photo, ultra detailed, (highly detailed skin), ((8k resolution)), (Ultra-HD graphic), (ultra high res), (depth of field:1.4), ((night scene)), (detailed pupils:1.2), (cinematic lighting):1.3, ((perfect face)), ((looking at viewer)), (detailed eyes), (((solo))), (natural lighting:1.4), volumetric lights, (textured skin), shiny skin, (dark background:1.2), (beautiful detailed hair), hair ornament, (handsome pose), (dynamic angle), dynamic action, dynamic proportions, (sharp focus:1.2), photography, natural textures, real life, everyday life, photorealistic, realistic, best quality, 8k, skin pores, intricate details, elegant, absurdres, highres, (photorealistic:1.5), (RAW photo:1.4), Fujifilm XT3",
    "1 girl, (depth of field:1), (noir theme:1), pov, sweater"
  ]
}
修改于 2024-01-09 03:54:50
上一页
提示词扩写
下一页
提示词扩写优化
Built with