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
  • 绘图任务
    • 查询归档任务详情
      POST
    • 查询任务实时状态 (百分比/进度条/中间图)
      POST
    • 绘图工具任务查询
      POST
  • 模型训练
    • 提交训练任务
      POST
    • 训练结果回调
      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 文生图-v2

POST
/AIGCImgOpenServ/saas/sd/v2/text2image
文生图,根据prompt提示词生成图

请求参数

Header 参数

Body 参数application/json

示例
{
    "prompt": "{best quality}, {{masterpiece}}, {highres}, original, extremely detailed,incredibly_absurdres,intricate detail,(detailed face),(face:1.2),1girl , kneeling down, from below , crying, sitting, ghost",
    "n_iter": 1,
    "steps": 25,
    "seed":"1221212",
    "restore_faces": false,
    "enable_hr": false,
    "hr_scale": 2,
    "width": 768,
    "height": 768,
    "negative_prompt": "(nsfw:1.5),(nude:1.3), (child Pornography:1.2),molestation,incest,rape,about to be raped,(sex:1.3),uncensored,EasyNegative,(worst quality, low quality:1.4), (((distorted hands))),((disfigured)), ((bad art)), ((deformed)),((extra limbs)),((b&w)), (((duplicate))), ((morbid)), ((mutilated)),poorly drawn face, out of frame, mutation, mutated, (text), signature, monster,watermark,extra fingers,fewer fingers, Wrong hands,wrong fingers,fingers crossed,styled fingers,fingers missed,missed fingers,cheese fingers, chocolate fingers,fingers on fingers,closed fist, fighting fist,fist ,hands with fist,many fists,only hands with wrong fists,fingers crossed,\r\n,",
    "cfg_scale": 27,
    "sampler_index":"DPM++ 2M Karras",
    "hr_second_pass_steps":20,
    "hr_resize_x":1024,
    "hr_resize_y":1024,
    "denoising_strength": 0.55,
    "callbackUrl":"http://127.0.0.1:8087/image/api/callback/sdweb",
    "alwayson_scripts": {
        "sd_model_checkpoint": "revAnimated_v122_7371.safetensors",
        "id_task": "pro1686666",
        "sd_vae": "vae-ft-mse-840000-ema-pruned.ckpt",
        "override_settings": {
            "CLIP_stop_at_last_layers": 2
        },
        "ADetailer": {
            "args": [
                {
                    "ad_model": "None",
                    "ad_prompt": "",
                    "ad_negative_prompt": "",
                    "ad_confidence": 0.3,
                    "ad_mask_min_ratio": 0.0,
                    "ad_mask_max_ratio": 1.0,
                    "ad_dilate_erode": 32,
                    "ad_x_offset": 0,
                    "ad_y_offset": 0,
                    "ad_mask_merge_invert": "None",
                    "ad_mask_blur": 4,
                    "ad_denoising_strength": 0.4,
                    "ad_inpaint_only_masked": true,
                    "ad_inpaint_only_masked_padding": 0,
                    "ad_use_inpaint_width_height": false,
                    "ad_inpaint_width": 512,
                    "ad_inpaint_height": 512,
                    "ad_use_steps": true,
                    "ad_steps": 28,
                    "ad_use_cfg_scale": false,
                    "ad_cfg_scale": 7.0,
                    "ad_use_sampler": false,
                    "ad_sampler": "DPM++ 2M Karras",
                    "ad_use_noise_multiplier": false,
                    "ad_noise_multiplier": 1.0,
                    "ad_restore_face": false,
                    "ad_controlnet_model": "None",
                    "ad_controlnet_module": "None",
                    "ad_controlnet_weight": 1.0,
                    "ad_controlnet_guidance_start": 0.0,
                    "ad_controlnet_guidance_end": 1.0
                }
            ]
        }
    }
}

请求示例代码

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/sd/v2/text2image' \
--header 'X-Request-req-accessKeyId: accessKeyId' \
--header 'X-Request-req-accessKeySecret: accessKeySecret' \
--header 'Content-Type: application/json' \
--data-raw '{
    "prompt": "{best quality}, {{masterpiece}}, {highres}, original, extremely detailed,incredibly_absurdres,intricate detail,(detailed face),(face:1.2),1girl , kneeling down, from below , crying, sitting, ghost",
    "n_iter": 1,
    "steps": 25,
    "seed":"1221212",
    "restore_faces": false,
    "enable_hr": false,
    "hr_scale": 2,
    "width": 768,
    "height": 768,
    "negative_prompt": "(nsfw:1.5),(nude:1.3), (child Pornography:1.2),molestation,incest,rape,about to be raped,(sex:1.3),uncensored,EasyNegative,(worst quality, low quality:1.4), (((distorted hands))),((disfigured)), ((bad art)), ((deformed)),((extra limbs)),((b&w)), (((duplicate))), ((morbid)), ((mutilated)),poorly drawn face, out of frame, mutation, mutated, (text), signature, monster,watermark,extra fingers,fewer fingers, Wrong hands,wrong fingers,fingers crossed,styled fingers,fingers missed,missed fingers,cheese fingers, chocolate fingers,fingers on fingers,closed fist, fighting fist,fist ,hands with fist,many fists,only hands with wrong fists,fingers crossed,\r\n,",
    "cfg_scale": 27,
    "sampler_index":"DPM++ 2M Karras",
    "hr_second_pass_steps":20,
    "hr_resize_x":1024,
    "hr_resize_y":1024,
    "denoising_strength": 0.55,
    "callbackUrl":"http://127.0.0.1:8087/image/api/callback/sdweb",
    "alwayson_scripts": {
        "sd_model_checkpoint": "revAnimated_v122_7371.safetensors",
        "id_task": "pro1686666",
        "sd_vae": "vae-ft-mse-840000-ema-pruned.ckpt",
        "override_settings": {
            "CLIP_stop_at_last_layers": 2
        },
        "ADetailer": {
            "args": [
                {
                    "ad_model": "None",
                    "ad_prompt": "",
                    "ad_negative_prompt": "",
                    "ad_confidence": 0.3,
                    "ad_mask_min_ratio": 0.0,
                    "ad_mask_max_ratio": 1.0,
                    "ad_dilate_erode": 32,
                    "ad_x_offset": 0,
                    "ad_y_offset": 0,
                    "ad_mask_merge_invert": "None",
                    "ad_mask_blur": 4,
                    "ad_denoising_strength": 0.4,
                    "ad_inpaint_only_masked": true,
                    "ad_inpaint_only_masked_padding": 0,
                    "ad_use_inpaint_width_height": false,
                    "ad_inpaint_width": 512,
                    "ad_inpaint_height": 512,
                    "ad_use_steps": true,
                    "ad_steps": 28,
                    "ad_use_cfg_scale": false,
                    "ad_cfg_scale": 7.0,
                    "ad_use_sampler": false,
                    "ad_sampler": "DPM++ 2M Karras",
                    "ad_use_noise_multiplier": false,
                    "ad_noise_multiplier": 1.0,
                    "ad_restore_face": false,
                    "ad_controlnet_model": "None",
                    "ad_controlnet_module": "None",
                    "ad_controlnet_weight": 1.0,
                    "ad_controlnet_guidance_start": 0.0,
                    "ad_controlnet_guidance_end": 1.0
                }
            ]
        }
    }
}'

返回响应

🟢200成功
application/json
Body

示例
{
    "code": "200",
    "msg": "success",
    "data": {
        "task_id": "pro1686666"
    }
}
修改于 2024-10-18 01:40:57
上一页
CV任务状态码信息附录
下一页
sd 文生图-v3
Built with