Replicate SD Animation 功能
▼
Authorization
在 Header 添加参数 Authorization,其值为 Bearer 之后拼接 Token
示例:
Authorization: Bearer ********************
请求参数
Header 参数
Authorization
string
可选
示例: Bearer {{YOUR_API_KEY}}
Content-Type
string
可选
示例: application/json
Body 参数 application/json
version
string
必需
模型版本ID
input
object
必需
模型输入参数
width
integer
可选
输出图像的宽度。默认值:512。
height
integer
可选
输出图像的高度。默认值:512。
prompt_end
string
可选
动画结束时的提示。
prompt_start
string
可选
动画开始的提示。
gif_ping_pong
boolean
可选
是否反转动画并回到循环前的开头。默认值:false
output_format
string
可选
输出文件格式。默认值:"gif"。
guidance_scale
number
可选
引导强度。默认值:7.5。
prompt_strength
number
可选
提示强度。默认值:0.8。
film_interpolation
boolean
可选
是否使用 FILM 进行帧间插值。默认值:true
intermediate_output
boolean
可选
是否显示生成过程中的中间输出。默认值:false
num_inference_steps
integer
可选
去噪步骤数。默认值:50。
num_animation_frames
integer
可选
动画帧数。默认值:10。
gif_frames_per_second
integer
可选
输出 GIF 的帧/秒。默认值:20。
num_interpolation_steps
integer
可选
动画帧之间插入的步数。默认值:5。
示例
{
"version": "andreasjansson/stable-diffusion-animation:ca1f5e306e5721e19c473e0d094e6603f0456fe759c15fcd6c1b79242d4a5",
"input": {
"prompt_start": "a beautiful landscape",
"prompt_end": "the same landscape at night"
}
}
请求示例代码
curl --location --request POST 'https://api.quickrouter.ai/replicate/v1/predictions' --header 'Authorization: Bearer YOUR_API_KEY' --header 'Content-Type: application/json' --data-raw '{
"version": "andreasjansson/stable-diffusion-animation:ca1f5e306e5721e19c473e0d094e6603f0456fe759c15fcd6c1b79242d4a5",
"input": {
"prompt_start": "a beautiful landscape",
"prompt_end": "the same landscape at night"
}
}'
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer YOUR_API_KEY");
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
"version": "andreasjansson/stable-diffusion-animation:ca1f5e306e5721e19c473e0d094e6603f0456fe759c15fcd6c1b79242d4a5",
"input": {
"prompt_start": "a beautiful landscape",
"prompt_end": "the same landscape at night"
}
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.quickrouter.ai/replicate/v1/predictions", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
import http.client
import json
conn = http.client.HTTPSConnection("api.quickrouter.ai")
payload = json.dumps({
"version": "andreasjansson/stable-diffusion-animation:ca1f5e306e5721e19c473e0d094e6603f0456fe759c15fcd6c1b79242d4a5",
"input": {
"prompt_start": "a beautiful landscape",
"prompt_end": "the same landscape at night"
}
})
headers = {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
conn.request("POST", "/replicate/v1/predictions", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
返回响应
响应参数 application/json
id
string
可选
任务ID
status
string
可选
任务状态
output
string
可选
任务输出
示例
{
"id": "qpt5jq1fssrmc0cmd5hvy31mdg",
"status": "starting"
}