typetext
{
"film_interpolation": true,
"gif_frames_per_second": 20,
"gif_ping_pong": true,
"guidance_scale": 7.5,
"height": 512,
"num_animation_frames": "25",
"num_inference_steps": 50,
"num_interpolation_steps": 5,
"output_format": "mp4",
"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",
"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",
"prompt_strength": 0.9,
"width": 512
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Hb0**********************************
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:a0cd8005509b772461dd2a4dc58d304bac1d150d93fa35fdc80dc5835f766d4d",
{
input: {
film_interpolation: true,
gif_frames_per_second: 20,
gif_ping_pong: true,
guidance_scale: 7.5,
height: 512,
num_animation_frames: "25",
num_inference_steps: 50,
num_interpolation_steps: 5,
output_format: "mp4",
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",
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",
prompt_strength: 0.9,
width: 512
}
}
);
// To access the file URL:
console.log(output.url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", output);
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_Hb0**********************************
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:a0cd8005509b772461dd2a4dc58d304bac1d150d93fa35fdc80dc5835f766d4d",
input={
"film_interpolation": True,
"gif_frames_per_second": 20,
"gif_ping_pong": True,
"guidance_scale": 7.5,
"height": 512,
"num_animation_frames": "25",
"num_inference_steps": 50,
"num_interpolation_steps": 5,
"output_format": "mp4",
"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",
"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",
"prompt_strength": 0.9,
"width": 512
}
)
# To access the file URL:
print(output.url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output.read())
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Hb0**********************************
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:a0cd8005509b772461dd2a4dc58d304bac1d150d93fa35fdc80dc5835f766d4d",
"input": {
"film_interpolation": true,
"gif_frames_per_second": 20,
"gif_ping_pong": true,
"guidance_scale": 7.5,
"height": 512,
"num_animation_frames": "25",
"num_inference_steps": 50,
"num_interpolation_steps": 5,
"output_format": "mp4",
"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",
"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",
"prompt_strength": 0.9,
"width": 512
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "wsdaibdifnhlnptfyeyq6dgm4q",
"model": "andreasjansson/stable-diffusion-animation",
"version": "a0cd8005509b772461dd2a4dc58d304bac1d150d93fa35fdc80dc5835f766d4d",
"input": {
"film_interpolation": true,
"gif_frames_per_second": 20,
"gif_ping_pong": true,
"guidance_scale": 7.5,
"height": 512,
"num_animation_frames": "25",
"num_inference_steps": 50,
"num_interpolation_steps": 5,
"output_format": "mp4",
"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",
"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",
"prompt_strength": 0.9,
"width": 512
},
"logs": "Using seed: 52273\r\nGenerating initial latents for 4 steps\r\nGenerating frame 0\r\nGenerating frame 1\r\nGenerating frame 2\r\nGenerating frame 3\r\nGenerating frame 4\r\nGenerating frame 5\r\nGenerating frame 6\r\nGenerating frame 7\r\nGenerating frame 8\r\nGenerating frame 9\r\nGenerating frame 10\r\nGenerating frame 11\r\nGenerating frame 12\r\nGenerating frame 13\r\nGenerating frame 14\r\nGenerating frame 15\r\nGenerating frame 16\r\nGenerating frame 17\r\nGenerating frame 18\r\nGenerating frame 19\r\nGenerating frame 20\r\nGenerating frame 21\r\nGenerating frame 22\r\nGenerating frame 23\r\nGenerating frame 24\r\nInterpolating images with FILM\r\nSaving MP4",
"output": "https://replicate.delivery/mgxm/56df19d7-3776-4119-a0f9-d278b26a4a8a/output.mp4",
"data_removed": false,
"error": "",
"source": "web",
"status": "succeeded",
"created_at": "2022-08-28T20:56:18.476932Z",
"started_at": "2022-08-28T20:59:30Z",
"completed_at": "2022-08-28T21:01:43Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/wsdaibdifnhlnptfyeyq6dgm4q/cancel",
"get": "https://api.replicate.com/v1/predictions/wsdaibdifnhlnptfyeyq6dgm4q"
},
"metrics": {
"predict_time": 133,
"total_time": 324.523068
}
}