文字转图像
开发环境
开发环境
POST
/v2/txt2img
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://dev-cn.your-api-server.com/v2/txt2img' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data-raw '{
"extra": {
"enable_nsfw_detection": false
},
"prompt": "nsfw, 1girl, (solo:1.1), small breasts, topless, nipples, thongs, thigh, slicked back short hair, half body in pool, outdoor, pool side, very sexy, wet body, modern villa, southern france, soft light, realistic, intricate details, (light freckles:0.5), lightly tanned, professional photography, depth of field, amazing eyes, (smooth hands:1.1), photoshoot, detailed background, professional model, ultra 4k, photorealist, lace panties",
"negative_prompt": "(badhandv4:1.2),(worst quality:2),(low quality:2),(normal quality:2),lowres,bad anatomy,bad hands,((monochrome)),((grayscale)) watermark,moles, easynegative ng_deepnegative_v1_75t, (oversized head:2), (big head:2), (deformed face:1.5),( blurry face:2), bad eyes, irregular eyes, asymmetric eyes, ugly, teeth, (navel:0.9), artefact, jpg artefact, blurry face, blurry, blurred, pixelated, bad eyes, crossed eyes, blurry eyes, nipple",
"sampler_name": "DPM++ 2M Karras",
"batch_size": 1,
"n_iter": 1,
"steps": 25,
"cfg_scale": 7,
"seed": -1,
"height": 512,
"width": 512,
"model_name": "anyhentai_20_31826.safetensors",
"restore_faces": false,
"restore_faces_model": "",
"sd_vae": "",
"clip_skip": 1,
"enable_hr": false,
"hr_upscaler": "Latent",
"hr_scale": 1,
"hr_resize_x": null,
"hr_resize_y": null,
"img_expire_ttl": null,
"sd_refiner": {
"checkpoint": "sd_xl_refiner_1.0.safetensors",
"switch_at": null
},
"controlnet_units": [
{
"model": "",
"weight": null,
"input_image": "",
"module": "none",
"control_mode": 0,
"mask": "",
"resize_mode": 0,
"processor_res": null,
"threshold_a": null,
"threshold_b": null,
"guidance_start": null,
"guidance_end": null,
"pixel_perfect": false
}
]
}'
响应示例响应示例
{
"code": 0,
"msg": "",
"data": {
"task_id": "d4cf3973-8414-4a5e-aa6f-ef54caf73662",
"warn": ""
}
}
请求参数
Header 参数
Authorization
string
必需
Content-Type
string
必需
示例值:
application/json
Body 参数application/json
返回响应
修改于 2024-02-05 08:22:42