创建任务 andreasjansson/stable-diffusion-animation

POST /replicate/v1/predictions

MethodPOST
Path/replicate/v1/predictions
Typehttp
Status1
Module2102810
Folder62419371

说明

概览

MethodPOST
Path/replicate/v1/predictions
Typehttp
Status1
Module2102810
Folder62419371

参数

{
  "query": [],
  "path": [],
  "cookie": [],
  "header": [
    {
      "required": false,
      "description": "",
      "type": "string",
      "id": "GTujCrB2It",
      "enable": true,
      "name": "Authorization",
      "sampleValue": "Bearer {{YOUR_API_KEY}}"
    }
  ]
}

请求体

{
  "type": "application/json",
  "parameters": [],
  "jsonSchema": {
    "type": "object",
    "properties": {
      "version": {
        "type": "string"
      },
      "input": {
        "type": "object",
        "properties": {
          "width": {
            "type": "integer",
            "description": "输出图像的宽度。默认值:512。"
          },
          "height": {
            "type": "integer",
            "description": "输出图像的高度。默认值:512。"
          },
          "prompt_end": {
            "type": "string",
            "description": "动画结束时的提示。您可以使用 |(竖线符号)分隔多个提示,从而包含多个提示。"
          },
          "prompt_start": {
            "type": "string",
            "description": "动画开始的提示。"
          },
          "gif_ping_pong": {
            "type": "boolean",
            "description": "是否反转动画并回到循环前的开头。默认值:false"
          },
          "output_format": {
            "type": "string",
            "description": "输出文件格式。默认值:“gif”。"
          },
          "guidance_scale": {
            "type": "number",
            "description": "引导强度。默认值:7.5。最小值:1,最大值:20。"
          },
          "prompt_strength": {
            "type": "number",
            "description": "较低的提示强度会生成更连贯的 gif,较高的提示强度会生成更多但可能会跳跃。默认值:0.8。"
          },
          "film_interpolation": {
            "type": "boolean",
            "description": "是否使用 FILM 进行帧间插值(film-net.github.io)默认值:true"
          },
          "intermediate_output": {
            "type": "boolean",
            "description": "是否显示生成过程中的中间输出。默认值:false"
          },
          "num_inference_steps": {
            "type": "integer",
            "description": "去噪步骤数。默认值:50。最小值:1,最大值:500。"
          },
          "num_animation_frames": {
            "type": "integer",
            "description": "动画帧数。默认值:10。最小值:2,最大值:50。"
          },
          "gif_frames_per_second": {
            "type": "integer",
            "description": "输出 GIF 的帧/秒。默认值:20。最小值:1,最大值:50。"
          },
          "num_interpolation_steps": {
            "type": "integer",
            "description": "动画帧之间插入的步数。默认值:5。最小值:1,最大值:50。"
          }
        },
        "required": [
          "prompt_end",
          "prompt_start"
        ],
        "x-apifox-orders": [
          "width",
          "height",
          "prompt_end",
          "prompt_start",
          "gif_ping_pong",
          "output_format",
          "guidance_scale",
          "prompt_strength",
          "film_interpolation",
          "intermediate_output",
          "num_inference_steps",
          "num_animation_frames",
          "gif_frames_per_second",
          "num_interpolation_steps"
        ]
      }
    },
    "x-apifox-orders": [
      "version",
      "input"
    ]
  },
  "mediaType": "",
  "examples": [
    {
      "value": "{\n    \"version\": \"andreasjansson/stable-diffusion-animation:ca1f5e306e5721e19c473e0d094e6603f0456fe759c10715fcd6c1b79242d4a5\",\n    \"input\": {\n      \"width\": 512,\n      \"height\": 512,\n      \"prompt_end\": \"tall rectangular black monolith, a white room in the future with a bed, victorian details and a tall black monolith, a detailed matte painting by Wes Anderson, behance, light and space, reimagined by industrial light and magic, matte painting, criterion collection\",\n      \"prompt_start\": \"tall rectangular black monolith, monkeys in the desert looking at a large tall monolith, a detailed matte painting by Wes Anderson, behance, light and space, reimagined by industrial light and magic, matte painting, criterion collection\",\n      \"gif_ping_pong\": true,\n      \"output_format\": \"mp4\",\n      \"guidance_scale\": 7.5,\n      \"prompt_strength\": 0.9,\n      \"film_interpolation\": true,\n      \"intermediate_output\": false,\n      \"num_inference_steps\": 50,\n      \"num_animation_frames\": 25,\n      \"gif_frames_per_second\": 20,\n      \"num_interpolation_steps\": 5\n    }\n  }",
      "mediaType": "application/json",
      "description": ""
    }
  ],
  "oasExtensions": ""
}

响应

[
  {
    "id": 728683411,
    "name": "成功",
    "code": 200,
    "contentType": "json",
    "jsonSchema": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "model": {
          "type": "string"
        },
        "version": {
          "type": "string"
        },
        "input": {
          "type": "object",
          "properties": {
            "aspect_ratio": {
              "type": "string"
            },
            "input_image": {
              "type": "string"
            },
            "output_format": {
              "type": "string"
            },
            "prompt": {
              "type": "string"
            },
            "prompt_upsampling": {
              "type": "boolean"
            },
            "safety_tolerance": {
              "type": "integer"
            }
          },
          "required": [
            "aspect_ratio",
            "input_image",
            "output_format",
            "prompt",
            "prompt_upsampling",
            "safety_tolerance"
          ]
        },
        "logs": {
          "type": "string"
        },
        "output": {
          "type": "null"
        },
        "data_removed": {
          "type": "boolean"
        },
        "error": {
          "type": "null"
        },
        "status": {
          "type": "string"
        },
        "created_at": {
          "type": "string"
        },
        "urls": {
          "type": "object",
          "properties": {
            "cancel": {
              "type": "string"
            },
            "get": {
              "type": "string"
            },
            "stream": {
              "type": "string"
            },
            "web": {
              "type": "string"
            }
          },
          "required": [
            "cancel",
            "get",
            "stream",
            "web"
          ]
        }
      },
      "required": [
        "id",
        "model",
        "version",
        "input",
        "logs",
        "output",
        "data_removed",
        "error",
        "status",
        "created_at",
        "urls"
      ]
    },
    "itemSchema": {},
    "description": "",
    "mediaType": "",
    "headers": [],
    "oasExtensions": ""
  }
]

响应示例

[
  {
    "name": "成功示例",
    "responseId": 728683411,
    "data": "{\n    \"id\": \"8qnr2j4kynrj00crapbtfewwdg\",\n    \"model\": \"andreasjansson/stable-diffusion-animation\",\n    \"version\": \"ca1f5e306e5721e19c473e0d094e6603f0456fe759c10715fcd6c1b79242d4a5\",\n    \"input\": {\n        \"film_interpolation\": true,\n        \"gif_frames_per_second\": 20,\n        \"gif_ping_pong\": true,\n        \"guidance_scale\": 7.5,\n        \"height\": 512,\n        \"intermediate_output\": false,\n        \"num_animation_frames\": 25,\n        \"num_inference_steps\": 50,\n        \"num_interpolation_steps\": 5,\n        \"output_format\": \"mp4\",\n        \"prompt_end\": \"tall rectangular black monolith, a white room in the future with a bed, victorian details and a tall black monolith, a detailed matte painting by Wes Anderson, behance, light and space, reimagined by industrial light and magic, matte painting, criterion collection\",\n        \"prompt_start\": \"tall rectangular black monolith, monkeys in the desert looking at a large tall monolith, a detailed matte painting by Wes Anderson, behance, light and space, reimagined by industrial light and magic, matte painting, criterion collection\",\n        \"prompt_strength\": 0.9,\n        \"width\": 512\n    },\n    \"logs\": \"\",\n    \"output\": null,\n    \"data_removed\": false,\n    \"error\": null,\n    \"status\": \"starting\",\n    \"created_at\": \"2025-07-29T09:50:53.941Z\",\n    \"urls\": {\n        \"cancel\": \"https://api.replicate.com/v1/predictions/8qnr2j4kynrj00crapbtfewwdg/cancel\",\n        \"get\": \"https://api.replicate.com/v1/predictions/8qnr2j4kynrj00crapbtfewwdg\",\n        \"stream\": \"https://stream.replicate.com/v1/files/qoxq-lpghpenswbt2fqhz7xaggbmesoqxvt4h3ralq47fkfdcsgf2jmuq\",\n        \"web\": \"https://replicate.com/p/8qnr2j4kynrj00crapbtfewwdg\"\n    }\n}",
    "description": "",
    "oasKey": "",
    "oasExtensions": "",
    "id": 648888600
  }
]