SparkPix 出品的超快图片模型,两个独立端点。SparkPix Image 文生图不到 1 秒,支持 LoRA 自定义风格。SparkPix Image Edit 支持多图参考编辑。均为同步 API,直接返回结果,无需轮询。
Authorization: Bearer YOUR_API_KEY| 模型 | 端点 | 价格 | 说明 |
|---|---|---|---|
| SparkPix Image | POST /api/v1/images/generations-sync | $0.0100/张 | 文生图,同步,<1 秒,支持 LoRA |
| SparkPix Image Edit | POST /api/v1/images/edit | $0.0130/张 | 多图编辑,同步,<1 秒 |
# SparkPix Image: Text-to-image (sync, sub-1-second)
curl -X POST https://apimodels.app/api/v1/images/generations-sync \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A cute cat wearing a space helmet, digital art",
"aspect_ratio": "16:9",
"seed": 42
}'
# SparkPix Image Edit: Multi-image editing (sync)
curl -X POST https://apimodels.app/api/v1/images/edit \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Make the background a sunset beach",
"images": ["https://example.com/photo.jpg"],
"aspect_ratio": "16:9"
}'| 字段 | 必填 | 类型 | 说明 |
|---|---|---|---|
| prompt | 是 | string | 图片描述 |
| aspect_ratio | 否 | string | "custom"(默认,自动尺寸)、"1:1"、"16:9"、"9:16"、"4:3"、"3:4"、"3:2"、"2:3" |
| width | 否 | integer | 仅 aspect_ratio="custom" 时生效,256-1440,须为 16 的倍数 |
| height | 否 | integer | 仅 aspect_ratio="custom" 时生效,256-1440,须为 16 的倍数 |
| prompt_upsampling | 否 | boolean | 用 LLM 自动扩写优化提示词(默认 false) |
| seed | 否 | integer | 随机种子,用于复现生成结果 |
| lora_weights | 否 | string | HuggingFace LoRA 权重 URL,格式: huggingface.co/<owner>/<model>[/<file.safetensors>] |
| lora_scale | 否 | number | LoRA 强度,-1 到 3,默认 0.5 |
| callBackUrl | 否 | string | 任务完成后的回调 URL |
| 字段 | 必填 | 类型 | 说明 |
|---|---|---|---|
| prompt | 是 | string | 编辑指令,可用 "image 1"、"image 2" 引用输入图片 |
| images | 否 | string[] | 参考图片 URL 数组,第一张为主图 |
| aspect_ratio | 否 | string | "match_input_image"(默认,匹配第一张图)、"1:1"、"16:9"、"9:16"、"4:3"、"3:4"、"3:2"、"2:3" |
| turbo | 否 | boolean | 加速模式(默认 true),复杂任务建议关闭 |
| seed | 否 | integer | 随机种子,用于复现生成结果 |
| callBackUrl | 否 | string | 任务完成后的回调 URL |
试一试:Playground
SparkPix Image 文生图不到 1 秒,两个接口都是同步 API,图片 URL 直接随响应返回,无需轮询。
文生图:POST /api/v1/images/generations-sync;编辑:POST /api/v1/images/edit,用 images[] 传参考图(第一张为主图)。两条是不同端点。