typetext
{
"film_interpolation": true,
"gif_frames_per_second": "50",
"gif_ping_pong": false,
"guidance_scale": 7.5,
"height": 512,
"intermediate_output": true,
"num_animation_frames": "25",
"num_inference_steps": 50,
"num_interpolation_steps": "5",
"output_format": "gif",
"prompt_end": "A picture of an apple",
"prompt_start": "A picture of a bear",
"prompt_strength": 0.75,
"width": "768"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Yvi**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
import fs from "node:fs";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run andreasjansson/stable-diffusion-animation using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"andreasjansson/stable-diffusion-animation:ca1f5e306e5721e19c473e0d094e6603f0456fe759c10715fcd6c1b79242d4a5",
{
input: {
film_interpolation: true,
gif_frames_per_second: "50",
gif_ping_pong: false,
guidance_scale: 7.5,
height: 512,
intermediate_output: true,
num_animation_frames: "25",
num_inference_steps: 50,
num_interpolation_steps: "5",
output_format: "gif",
prompt_end: "A picture of an apple",
prompt_start: "A picture of a bear",
prompt_strength: 0.75,
width: "768"
}
}
);
// To access the file URL:
console.log(output[0].url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", output[0]);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Yvi**********************************
This is your API token. Keep it to yourself.
import replicate
Run andreasjansson/stable-diffusion-animation using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"andreasjansson/stable-diffusion-animation:ca1f5e306e5721e19c473e0d094e6603f0456fe759c10715fcd6c1b79242d4a5",
input={
"film_interpolation": True,
"gif_frames_per_second": "50",
"gif_ping_pong": False,
"guidance_scale": 7.5,
"height": 512,
"intermediate_output": True,
"num_animation_frames": "25",
"num_inference_steps": 50,
"num_interpolation_steps": "5",
"output_format": "gif",
"prompt_end": "A picture of an apple",
"prompt_start": "A picture of a bear",
"prompt_strength": 0.75,
"width": "768"
}
)
# The andreasjansson/stable-diffusion-animation model can stream output as it's running.
# The predict method returns an iterator, and you can iterate over that output.
for item in output:
# https://replicate.com/andreasjansson/stable-diffusion-animation/api#output-schema
print(item)
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Yvi**********************************
This is your API token. Keep it to yourself.
Run andreasjansson/stable-diffusion-animation using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Prefer: wait" \
-d $'{
"version": "andreasjansson/stable-diffusion-animation:ca1f5e306e5721e19c473e0d094e6603f0456fe759c10715fcd6c1b79242d4a5",
"input": {
"film_interpolation": true,
"gif_frames_per_second": "50",
"gif_ping_pong": false,
"guidance_scale": 7.5,
"height": 512,
"intermediate_output": true,
"num_animation_frames": "25",
"num_inference_steps": 50,
"num_interpolation_steps": "5",
"output_format": "gif",
"prompt_end": "A picture of an apple",
"prompt_start": "A picture of a bear",
"prompt_strength": 0.75,
"width": "768"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "uzj2czjjzradtjcrzet6yfqdkq",
"model": "andreasjansson/stable-diffusion-animation",
"version": "ca1f5e306e5721e19c473e0d094e6603f0456fe759c10715fcd6c1b79242d4a5",
"input": {
"film_interpolation": true,
"gif_frames_per_second": "50",
"gif_ping_pong": false,
"guidance_scale": 7.5,
"height": 512,
"intermediate_output": true,
"num_animation_frames": "25",
"num_inference_steps": 50,
"num_interpolation_steps": "5",
"output_format": "gif",
"prompt_end": "A picture of an apple",
"prompt_start": "A picture of a bear",
"prompt_strength": 0.75,
"width": "768"
},
"logs": "Using seed: 21594\nGenerating initial latents for 12 steps\nGenerating first and last keyframes\nGenerating frame 0 of keyframe 0\nGenerating frame 1 of keyframe 0\nGenerating frame 2 of keyframe 0\nGenerating frame 3 of keyframe 0\nGenerating frame 4 of keyframe 0\nGenerating frame 5 of keyframe 0\nGenerating frame 6 of keyframe 0\nGenerating frame 7 of keyframe 0\nGenerating frame 8 of keyframe 0\nGenerating frame 9 of keyframe 0\nGenerating frame 10 of keyframe 0\nGenerating frame 11 of keyframe 0\nGenerating frame 12 of keyframe 0\nGenerating frame 13 of keyframe 0\nGenerating frame 14 of keyframe 0\nGenerating frame 15 of keyframe 0\nGenerating frame 16 of keyframe 0\nGenerating frame 17 of keyframe 0\nGenerating frame 18 of keyframe 0\nGenerating frame 19 of keyframe 0\nGenerating frame 20 of keyframe 0\nGenerating frame 21 of keyframe 0\nGenerating frame 22 of keyframe 0\nGenerating frame 23 of keyframe 0\nGenerating frame 24 of keyframe 0\nInterpolating images with FILM\nSaving GIF",
"output": [
"https://replicate.delivery/pbxt/J7P4yIWhF6LRBVd0Eofj2raMIUKhH8QQH6V33CmhCWahAmJIA/output-0.png",
"https://replicate.delivery/pbxt/A2iyNCTkED4dCxwWQmHG2D7EfHf7RJYirQ09vqe2RD5XCYmgA/output-1.png",
"https://replicate.delivery/pbxt/e2whGe6qfAVz1phwps4wf5jfS5fzah00TyfwfLa4HilJQBMTQA/output-2.png",
"https://replicate.delivery/pbxt/ZiFZ8i23Dez1F6Pr73eMxeKzaE5lXzy4ZIU3vkV7K7rqCYmgA/output-3.png",
"https://replicate.delivery/pbxt/aJ3UNELCxOIYJlgh3ZCe4X2bZhFxpMQBsSleNdemFhIyCYmgA/output-4.png",
"https://replicate.delivery/pbxt/wflidu1jTMTdWyeE8jC9CvnmwQELnpI1TSuVKWnfwbo8CYmgA/output-5.png",
"https://replicate.delivery/pbxt/oauW54207vJkBhbPPOmSngLmTA6Kl5fIR4KWpbvauRKxAmJIA/output-6.png",
"https://replicate.delivery/pbxt/yTGwaRptvZYaJRDbRZBuO598pl5UabV7R3xFWcTNNP5ZAzEE/output-7.png",
"https://replicate.delivery/pbxt/tSLscok3yVqBK1UC2fqnnTmlzFKwwpZFY6iDqi9ndmC2AmJIA/output-8.png",
"https://replicate.delivery/pbxt/we4lnpTPnF24PyhwUncb1pTQJ4MrMUvB0I4PrJi0NVx4AmJIA/output-9.png",
"https://replicate.delivery/pbxt/xooyuv5AV6aoM5iqynnayhQVZeDMVx5xVnXdMDVZ1sh6AmJIA/output-10.png",
"https://replicate.delivery/pbxt/mtnpgv3MCgZRPtIYrQAQ0fM2AvWVpvMA5qGec78yif00DYmgA/output-11.png",
"https://replicate.delivery/pbxt/fN1HfcxdotkW00ydPmlKATGdhzf16aFkCR796Qv6SMteHwMBB/output-12.png",
"https://replicate.delivery/pbxt/qcTzStGiJioFBtCQ8fxoif7y1CyE88neJy2ZIUeOrvrRIwMBB/output-13.png",
"https://replicate.delivery/pbxt/0hmV2qIZpn6DBhW4kujpuIsZr3zyS0lEHuC02sTa0vNiAzEE/output-14.png",
"https://replicate.delivery/pbxt/gB87DTnuWKqIIt7if2oH0JHK8IjPbScSIPfoLNfG5zHbEYmgA/output-15.png",
"https://replicate.delivery/pbxt/tiLPbepdfeG7Qp110ecWsEQSLewKwOmcaOEfLivwbCVukAzEE/output-16.png",
"https://replicate.delivery/pbxt/ZF27tmuP8NLJFBAkbPHgZDs1iExTGo5ELkz66JDaIh8lAzEE/output-17.png",
"https://replicate.delivery/pbxt/qckmpmB45QrKMN54QevVhvTa1NeZsyhXeND94mj1LA63EYmgA/output-18.png",
"https://replicate.delivery/pbxt/so8bPUneOfr8E0YAIPagGBAL4SmBwU21RKW71kzCTNAgCMTQA/output-19.png",
"https://replicate.delivery/pbxt/WJQE9spf8ZXUAytoMfZRmajn4eXHu73KT1GMxKMBf2rWKwMBB/output-20.png",
"https://replicate.delivery/pbxt/RKQQuudaapZvL1SwmdDDuYoDIPHFe5EgOcYqH9amSK8UBmJIA/output-21.png",
"https://replicate.delivery/pbxt/O46rfqb4qyRNVqutB4SeiM4TIJQD73Zc6F9DZWJ6oWFuCMTQA/output-22.png",
"https://replicate.delivery/pbxt/o2W4Z1apYwYmDNSkJQFcJMyT62iAbPIFhetdjoAelW5zCMTQA/output-23.png",
"https://replicate.delivery/pbxt/K0N9HQY8WjL6E1nW1nbwqyWQYs1LIVHVfcuXtZ4QYeQ4CMTQA/output-24.png",
"https://replicate.delivery/pbxt/fglMUBeFQmuhN00kQVJdTcwrqvNoBSXse2rXVXmD2qOhHYmgA/video.gif"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-01-11T19:30:00.337234Z",
"started_at": "2023-01-11T19:30:00.375962Z",
"completed_at": "2023-01-11T19:33:05.448823Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/uzj2czjjzradtjcrzet6yfqdkq/cancel",
"get": "https://api.replicate.com/v1/predictions/uzj2czjjzradtjcrzet6yfqdkq"
},
"metrics": {
"predict_time": 185.072861,
"total_time": 185.111589
}
}