本页内容
SD API V1 端点
基础路径:/sdapi/v1
/sdapi/v1 下的端点提供 Stable Diffusion API 的兼容子集,并与对应的 /v1 端点共享相同参数。目录端点(sd-models、upscalers)返回 ArliAI 精选目录,并包含与 A1111 兼容的标识字段,而非完整的 A1111 原生元数据。
POST /sdapi/v1/img2img
参数请参见 /v1/img2img。
1curl -X POST https://api.arliai.com/sdapi/v1/img2img \
2-H "Content-Type: application/json" \
3-H "Authorization: Bearer your_api_key" \
4-d '{
5 "sd_model_checkpoint": "MODEL_NAME",
6 "init_images": ["base64_encoded_image"],
7 "prompt": "A futuristic city",
8 "width": 1024,
9 "height": 1024
10}'POST /sdapi/v1/txt2img
参数请参见 /v1/txt2img。
1curl -X POST https://api.arliai.com/sdapi/v1/txt2img \
2-H "Content-Type: application/json" \
3-H "Authorization: Bearer your_api_key" \
4-d '{
5 "sd_model_checkpoint": "MODEL_NAME",
6 "prompt": "A majestic lion in the savanna",
7 "width": 1024,
8 "height": 1024
9}'POST /sdapi/v1/control
ControlNet-guided generation in the SD-API style: the control array carries preprocessor/model/image pairs per unit, and the response includes processed (preprocessed control maps) alongside images. Equivalent to POST /v1/control; SD.Next-only, so vLLM-Omni models return 503.
1curl -X POST https://api.arliai.com/sdapi/v1/control \
2-H "Content-Type: application/json" \
3-H "Authorization: Bearer your_api_key" \
4-d '{
5 "prompt": "a person standing in front of an ancient castle",
6 "unit_type": "controlnet",
7 "control": [
8 {
9 "unit_type": "controlnet",
10 "process": "OpenPose",
11 "model": "OpenPose XL",
12 "image": "base64_encoded_control_image",
13 "strength": 0.9
14 }
15 ]
16}'POST /sdapi/v1/preprocess
Run a single control preprocessor on an image and return the processed control map. Equivalent to POST /v1/preprocess; SD.Next-only, so vLLM-Omni models return 503.
1curl -X POST https://api.arliai.com/sdapi/v1/preprocess \
2-H "Content-Type: application/json" \
3-H "Authorization: Bearer your_api_key" \
4-d '{
5 "model": "Canny",
6 "image": "base64_encoded_image",
7 "params": { "low_threshold": 100, "high_threshold": 200 }
8}'POST /sdapi/v1/extra-single-image
参数请参见 /v1/upscale-img。
1curl -X POST https://api.arliai.com/sdapi/v1/extra-single-image \
2-H "Content-Type: application/json" \
3-H "Authorization: Bearer your_api_key" \
4-d '{
5 "image": "base64_encoded_image",
6 "upscaler_1": "R-ESRGAN 4x+"
7}'GET /sdapi/v1/sd-models
以 ArliAI 精选目录格式检索可用的图像模型。包含与 A1111 兼容的 title 和 model_name 字段,以及 ArliAI 的限制和能力标志。
1curl -X GET https://api.arliai.com/sdapi/v1/sd-models \
2-H "Authorization: Bearer your_api_key"GET /sdapi/v1/upscalers
检索可用的放大器,包含与 A1111 兼容的 name 和 model_name 字段。vLLM-Omni 不提供放大功能。
1curl -X GET https://api.arliai.com/sdapi/v1/upscalers \
2-H "Authorization: Bearer your_api_key"GET /sdapi/v1/options
检索图像生成检查点标识符。仅返回 sd_model_checkpoint,不会暴露其他 SD.Next 选项。
1curl -X GET https://api.arliai.com/sdapi/v1/options \
2-H "Authorization: Bearer your_api_key"GET /sdapi/v1/samplers
检索可用的图像采样器。
1curl -X GET https://api.arliai.com/sdapi/v1/samplers \
2-H "Authorization: Bearer your_api_key"GET /sdapi/v1/ip-adapters
Lists IP-Adapter models, optionally scoped to the selected checkpoint via ?model=. Equivalent to GET /v1/ip-adapters.
1curl -X GET "https://api.arliai.com/sdapi/v1/ip-adapters?model=MODEL_NAME" \
2-H "Authorization: Bearer your_api_key"GET /sdapi/v1/control-models
Lists control models for a control unit type, optionally scoped to the selected checkpoint (?model= and ?unit_type=). Equivalent to GET /v1/control-models.
1curl -X GET "https://api.arliai.com/sdapi/v1/control-models?model=MODEL_NAME&unit_type=controlnet" \
2-H "Authorization: Bearer your_api_key"GET /sdapi/v1/preprocessors
Lists available control preprocessors with their parameters, optionally scoped via ?model=. Equivalent to GET /v1/preprocessors.
1curl -X GET "https://api.arliai.com/sdapi/v1/preprocessors?model=MODEL_NAME" \
2-H "Authorization: Bearer your_api_key"GET /sdapi/v1/control-modes
Lists control modes (Union/ProMax predefines) for the selected checkpoint via ?model=. Equivalent to GET /v1/control-modes.
1curl -X GET "https://api.arliai.com/sdapi/v1/control-modes?model=MODEL_NAME" \
2-H "Authorization: Bearer your_api_key"