typefile
{
"cond_aug": 0.02,
"decoding_t": 14,
"frames_per_second": 6,
"input_image": "https://replicate.delivery/pbxt/KcAKZ1wW2WJmjM0Xov9I0VCvjNwCmau64PkNnJUVVWk67Q6d/2261702010499_.pic.jpg",
"motion_bucket_id": 127,
"sizing_strategy": "maintain_aspect_ratio",
"video_length": "14_frames_with_svd"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_ENX**********************************
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 sunfjun/stable-video-diffusion using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"sunfjun/stable-video-diffusion:d68b6e09eedbac7a49e3d8644999d93579c386a083768235cabca88796d70d82",
{
input: {
cond_aug: 0.02,
decoding_t: 14,
frames_per_second: 6,
input_image: "https://replicate.delivery/pbxt/KcAKZ1wW2WJmjM0Xov9I0VCvjNwCmau64PkNnJUVVWk67Q6d/2261702010499_.pic.jpg",
motion_bucket_id: 127,
sizing_strategy: "maintain_aspect_ratio",
video_length: "14_frames_with_svd"
}
}
);
// 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_ENX**********************************
This is your API token. Keep it to yourself.
import replicate
Run sunfjun/stable-video-diffusion using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"sunfjun/stable-video-diffusion:d68b6e09eedbac7a49e3d8644999d93579c386a083768235cabca88796d70d82",
input={
"cond_aug": 0.02,
"decoding_t": 14,
"frames_per_second": 6,
"input_image": "https://replicate.delivery/pbxt/KcAKZ1wW2WJmjM0Xov9I0VCvjNwCmau64PkNnJUVVWk67Q6d/2261702010499_.pic.jpg",
"motion_bucket_id": 127,
"sizing_strategy": "maintain_aspect_ratio",
"video_length": "14_frames_with_svd"
}
)
# 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_ENX**********************************
This is your API token. Keep it to yourself.
Run sunfjun/stable-video-diffusion 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": "sunfjun/stable-video-diffusion:d68b6e09eedbac7a49e3d8644999d93579c386a083768235cabca88796d70d82",
"input": {
"cond_aug": 0.02,
"decoding_t": 14,
"frames_per_second": 6,
"input_image": "https://replicate.delivery/pbxt/KcAKZ1wW2WJmjM0Xov9I0VCvjNwCmau64PkNnJUVVWk67Q6d/2261702010499_.pic.jpg",
"motion_bucket_id": 127,
"sizing_strategy": "maintain_aspect_ratio",
"video_length": "14_frames_with_svd"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "fgyw6ttbmnqw24z3um2ugpsqgy",
"model": "sunfjun/stable-video-diffusion",
"version": "d68b6e09eedbac7a49e3d8644999d93579c386a083768235cabca88796d70d82",
"input": {
"cond_aug": 0.02,
"decoding_t": 14,
"frames_per_second": 6,
"input_image": "https://replicate.delivery/pbxt/KcAKZ1wW2WJmjM0Xov9I0VCvjNwCmau64PkNnJUVVWk67Q6d/2261702010499_.pic.jpg",
"motion_bucket_id": 127,
"sizing_strategy": "maintain_aspect_ratio",
"video_length": "14_frames_with_svd"
},
"logs": "Using seed: 31401\nResizing but keeping aspect ratio\nUsing dimensions 576x576\nSet consts\nLoaded model\nWARNING: The conditioning frame you provided is not 576x1024. This leads to suboptimal performance as model was only trained on 576x1024. Consider increasing `cond_aug`.\n############################## Sampling setting ##############################\nSampler: EulerEDMSampler\nDiscretization: EDMDiscretization\nGuider: LinearPredictionGuider\nSampling with EulerEDMSampler for 26 steps: 0%| | 0/26 [00:00<?, ?it/s]/root/.pyenv/versions/3.10.14/lib/python3.10/site-packages/torch/utils/checkpoint.py:31: UserWarning: None of the inputs have requires_grad=True. Gradients will be None\nwarnings.warn(\"None of the inputs have requires_grad=True. Gradients will be None\")\nSampling with EulerEDMSampler for 26 steps: 4%|▍ | 1/26 [00:01<00:25, 1.03s/it]\nSampling with EulerEDMSampler for 26 steps: 8%|▊ | 2/26 [00:01<00:23, 1.02it/s]\nSampling with EulerEDMSampler for 26 steps: 12%|█▏ | 3/26 [00:02<00:22, 1.01it/s]\nSampling with EulerEDMSampler for 26 steps: 15%|█▌ | 4/26 [00:03<00:21, 1.00it/s]\nSampling with EulerEDMSampler for 26 steps: 19%|█▉ | 5/26 [00:04<00:20, 1.00it/s]\nSampling with EulerEDMSampler for 26 steps: 23%|██▎ | 6/26 [00:05<00:20, 1.00s/it]\nSampling with EulerEDMSampler for 26 steps: 27%|██▋ | 7/26 [00:06<00:19, 1.00s/it]\nSampling with EulerEDMSampler for 26 steps: 31%|███ | 8/26 [00:08<00:18, 1.00s/it]\nSampling with EulerEDMSampler for 26 steps: 35%|███▍ | 9/26 [00:09<00:17, 1.00s/it]\nSampling with EulerEDMSampler for 26 steps: 38%|███▊ | 10/26 [00:10<00:16, 1.00s/it]\nSampling with EulerEDMSampler for 26 steps: 42%|████▏ | 11/26 [00:11<00:15, 1.00s/it]\nSampling with EulerEDMSampler for 26 steps: 46%|████▌ | 12/26 [00:12<00:14, 1.01s/it]\nSampling with EulerEDMSampler for 26 steps: 50%|█████ | 13/26 [00:13<00:13, 1.00s/it]\nSampling with EulerEDMSampler for 26 steps: 54%|█████▍ | 14/26 [00:14<00:12, 1.00s/it]\nSampling with EulerEDMSampler for 26 steps: 58%|█████▊ | 15/26 [00:15<00:11, 1.00s/it]\nSampling with EulerEDMSampler for 26 steps: 62%|██████▏ | 16/26 [00:16<00:10, 1.00s/it]\nSampling with EulerEDMSampler for 26 steps: 65%|██████▌ | 17/26 [00:17<00:09, 1.00s/it]\nSampling with EulerEDMSampler for 26 steps: 69%|██████▉ | 18/26 [00:18<00:08, 1.00s/it]\nSampling with EulerEDMSampler for 26 steps: 73%|███████▎ | 19/26 [00:19<00:07, 1.00s/it]\nSampling with EulerEDMSampler for 26 steps: 77%|███████▋ | 20/26 [00:20<00:06, 1.00s/it]\nSampling with EulerEDMSampler for 26 steps: 81%|████████ | 21/26 [00:21<00:05, 1.01s/it]\nSampling with EulerEDMSampler for 26 steps: 85%|████████▍ | 22/26 [00:22<00:04, 1.00s/it]\nSampling with EulerEDMSampler for 26 steps: 88%|████████▊ | 23/26 [00:23<00:03, 1.01s/it]\nSampling with EulerEDMSampler for 26 steps: 92%|█████████▏| 24/26 [00:24<00:02, 1.01s/it]\nSampling with EulerEDMSampler for 26 steps: 96%|█████████▌| 25/26 [00:25<00:01, 1.01s/it]\nSampling with EulerEDMSampler for 26 steps: 96%|█████████▌| 25/26 [00:25<00:01, 1.00s/it]\nffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers\nbuilt with gcc 11 (Ubuntu 11.2.0-19ubuntu1)\nconfiguration: --prefix=/usr --extra-version=0ubuntu0.22.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared\nlibavutil 56. 70.100 / 56. 70.100\nlibavcodec 58.134.100 / 58.134.100\nlibavformat 58. 76.100 / 58. 76.100\nlibavdevice 58. 13.100 / 58. 13.100\nlibavfilter 7.110.100 / 7.110.100\nlibswscale 5. 9.100 / 5. 9.100\nlibswresample 3. 9.100 / 3. 9.100\nlibpostproc 55. 9.100 / 55. 9.100\nInput #0, image2, from 'output//frame_%06d.png':\nDuration: 00:00:00.56, start: 0.000000, bitrate: N/A\nStream #0:0: Video: png, rgb24(pc), 576x576, 25 fps, 25 tbr, 25 tbn, 25 tbc\nStream mapping:\nStream #0:0 -> #0:0 (png (native) -> h264 (libx264))\nPress [q] to stop, [?] for help\n[libx264 @ 0x55b8f5378a80] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2\n[libx264 @ 0x55b8f5378a80] profile High, level 2.2, 4:2:0, 8-bit\n[libx264 @ 0x55b8f5378a80] 264 - core 163 r3060 5db6aa6 - H.264/MPEG-4 AVC codec - Copyleft 2003-2021 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=15 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=7 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00\nOutput #0, mp4, to 'output/000000.mp4':\nMetadata:\nencoder : Lavf58.76.100\nStream #0:0: Video: h264 (avc1 / 0x31637661), yuv420p(tv, progressive), 576x576, q=2-31, 7 fps, 14336 tbn\nMetadata:\nencoder : Lavc58.134.100 libx264\nSide data:\ncpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A\nframe= 1 fps=0.0 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A speed= 0x\nframe= 14 fps=0.0 q=-1.0 Lsize= 241kB time=00:00:01.57 bitrate=1255.4kbits/s speed=15.1x\nvideo:240kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.418609%\n[libx264 @ 0x55b8f5378a80] frame I:1 Avg QP:19.60 size: 18557\n[libx264 @ 0x55b8f5378a80] frame P:4 Avg QP:20.37 size: 19512\n[libx264 @ 0x55b8f5378a80] frame B:9 Avg QP:22.02 size: 16476\n[libx264 @ 0x55b8f5378a80] consecutive B-frames: 14.3% 0.0% 0.0% 85.7%\n[libx264 @ 0x55b8f5378a80] mb I I16..4: 25.2% 41.3% 33.6%\n[libx264 @ 0x55b8f5378a80] mb P I16..4: 11.2% 11.6% 24.8% P16..4: 17.1% 9.1% 6.9% 0.0% 0.0% skip:19.2%\n[libx264 @ 0x55b8f5378a80] mb B I16..4: 5.3% 4.3% 13.7% B16..8: 23.2% 13.8% 5.5% direct: 6.9% skip:27.3% L0:46.2% L1:42.5% BI:11.4%\n[libx264 @ 0x55b8f5378a80] 8x8 transform intra:25.3% inter:46.8%\n[libx264 @ 0x55b8f5378a80] coded y,uvDC,uvAC intra: 60.4% 64.0% 49.1% inter: 26.9% 27.9% 14.8%\n[libx264 @ 0x55b8f5378a80] i16 v,h,dc,p: 57% 23% 13% 7%\n[libx264 @ 0x55b8f5378a80] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 40% 12% 22% 4% 5% 5% 3% 4% 4%\n[libx264 @ 0x55b8f5378a80] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 31% 14% 21% 6% 4% 7% 5% 7% 5%\n[libx264 @ 0x55b8f5378a80] i8c dc,h,v,p: 58% 14% 21% 7%\n[libx264 @ 0x55b8f5378a80] Weighted P-Frames: Y:0.0% UV:0.0%\n[libx264 @ 0x55b8f5378a80] ref P L0: 62.0% 7.1% 21.6% 9.3%\n[libx264 @ 0x55b8f5378a80] ref B L0: 83.6% 14.4% 2.0%\n[libx264 @ 0x55b8f5378a80] ref B L1: 94.1% 5.9%\n[libx264 @ 0x55b8f5378a80] kb/s:979.54",
"output": "https://replicate.delivery/pbxt/avMWRw9yk5ImFNeCnTKsXBNY6ltYRYYAgh5924XvkiIXZaRJA/000000.mp4",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-03-22T14:47:19.101996Z",
"started_at": "2024-03-22T14:49:51.55569Z",
"completed_at": "2024-03-22T14:50:23.333106Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/fgyw6ttbmnqw24z3um2ugpsqgy/cancel",
"get": "https://api.replicate.com/v1/predictions/fgyw6ttbmnqw24z3um2ugpsqgy"
},
"metrics": {
"predict_time": 31.777416,
"total_time": 184.23111
}
}