typefile
{
"size": 40,
"video": "https://replicate.delivery/pbxt/JzweHYSSY69C9uUq2wAcqX3suV9zdL3C6Ujk2hrxynOJ0JHm/vidswap600883.mp4",
"watermark": "FULLJOURNEY.AI"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_7Lr**********************************
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 charlesmccarthy/addwatermark using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"charlesmccarthy/addwatermark:f274d1efdd9d249cef68fccd028d70e4134b2d59f2b02b42a4e78350849d0e57",
{
input: {
size: 40,
video: "https://replicate.delivery/pbxt/JzweHYSSY69C9uUq2wAcqX3suV9zdL3C6Ujk2hrxynOJ0JHm/vidswap600883.mp4",
watermark: "FULLJOURNEY.AI"
}
}
);
// 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_7Lr**********************************
This is your API token. Keep it to yourself.
import replicate
Run charlesmccarthy/addwatermark using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"charlesmccarthy/addwatermark:f274d1efdd9d249cef68fccd028d70e4134b2d59f2b02b42a4e78350849d0e57",
input={
"size": 40,
"video": "https://replicate.delivery/pbxt/JzweHYSSY69C9uUq2wAcqX3suV9zdL3C6Ujk2hrxynOJ0JHm/vidswap600883.mp4",
"watermark": "FULLJOURNEY.AI"
}
)
# 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_7Lr**********************************
This is your API token. Keep it to yourself.
Run charlesmccarthy/addwatermark 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": "charlesmccarthy/addwatermark:f274d1efdd9d249cef68fccd028d70e4134b2d59f2b02b42a4e78350849d0e57",
"input": {
"size": 40,
"video": "https://replicate.delivery/pbxt/JzweHYSSY69C9uUq2wAcqX3suV9zdL3C6Ujk2hrxynOJ0JHm/vidswap600883.mp4",
"watermark": "FULLJOURNEY.AI"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "rijpf3rbyr4e55arjlerfuvejy",
"model": "charlesmccarthy/addwatermark",
"version": "f274d1efdd9d249cef68fccd028d70e4134b2d59f2b02b42a4e78350849d0e57",
"input": {
"size": 40,
"video": "https://replicate.delivery/pbxt/JzweHYSSY69C9uUq2wAcqX3suV9zdL3C6Ujk2hrxynOJ0JHm/vidswap600883.mp4",
"watermark": "FULLJOURNEY.AI"
},
"logs": "ffmpeg version 5.1.4-0+deb12u1 Copyright (c) 2000-2023 the FFmpeg developers\nbuilt with gcc 12 (Debian 12.2.0-14)\nconfiguration: --prefix=/usr --extra-version=0+deb12u1 --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-libglslang --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librist --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --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 --disable-sndio --enable-libjxl --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libplacebo --enable-librav1e --enable-shared\nlibavutil 57. 28.100 / 57. 28.100\nlibavcodec 59. 37.100 / 59. 37.100\nlibavformat 59. 27.100 / 59. 27.100\nlibavdevice 59. 7.100 / 59. 7.100\nlibavfilter 8. 44.100 / 8. 44.100\nlibswscale 6. 7.100 / 6. 7.100\nlibswresample 4. 7.100 / 4. 7.100\nlibpostproc 56. 6.100 / 56. 6.100\nInput #0, mov,mp4,m4a,3gp,3g2,mj2, from '/tmp/tmpzf079ddnvidswap600883.mp4':\nMetadata:\nmajor_brand : mp42\nminor_version : 0\ncompatible_brands: isommp42\ncreation_time : 2023-11-30T18:53:16.000000Z\ncom.android.version: 13\nDuration: 00:00:06.83, start: 0.000000, bitrate: 610 kb/s\nStream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt470bg/bt470bg/smpte170m, progressive), 596x480, 479 kb/s, 30 fps, 30 tbr, 90k tbn (default)\nMetadata:\ncreation_time : 2023-11-30T18:53:16.000000Z\nhandler_name : VideoHandle\nvendor_id : [0][0][0][0]\nStream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)\nMetadata:\ncreation_time : 2023-11-30T18:53:16.000000Z\nhandler_name : SoundHandle\nvendor_id : [0][0][0][0]\nStream mapping:\nStream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))\nStream #0:1 -> #0:1 (copy)\nPress [q] to stop, [?] for help\n[libx264 @ 0x5c4a79b24680] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2\n[libx264 @ 0x5c4a79b24680] profile High, level 3.0, 4:2:0, 8-bit\n[libx264 @ 0x5c4a79b24680] 264 - core 164 r3095 baee400 - H.264/MPEG-4 AVC codec - Copyleft 2003-2022 - 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=12 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=25 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 '/tmp/tmpzf079ddnvidswap600883_watermarked.mp4':\nMetadata:\nmajor_brand : mp42\nminor_version : 0\ncompatible_brands: isommp42\ncom.android.version: 13\nencoder : Lavf59.27.100\nStream #0:0(und): Video: h264 (avc1 / 0x31637661), yuv420p(tv, bt470bg/bt470bg/smpte170m, progressive), 596x480, q=2-31, 30 fps, 15360 tbn (default)\nMetadata:\ncreation_time : 2023-11-30T18:53:16.000000Z\nhandler_name : VideoHandle\nvendor_id : [0][0][0][0]\nencoder : Lavc59.37.100 libx264\nSide data:\ncpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A\nStream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)\nMetadata:\ncreation_time : 2023-11-30T18:53:16.000000Z\nhandler_name : SoundHandle\nvendor_id : [0][0][0][0]\nframe= 1 fps=0.0 q=0.0 size= 0kB time=00:00:00.99 bitrate= 0.4kbits/s speed= 151x\nframe= 150 fps=0.0 q=29.0 size= 0kB time=00:00:05.99 bitrate= 0.1kbits/s speed=11.7x\nframe= 205 fps=203 q=-1.0 Lsize= 493kB time=00:00:06.78 bitrate= 595.8kbits/s speed=6.71x\nvideo:379kB audio:106kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.710108%\n[libx264 @ 0x5c4a79b24680] frame I:1 Avg QP:20.26 size: 10425\n[libx264 @ 0x5c4a79b24680] frame P:87 Avg QP:22.68 size: 3243\n[libx264 @ 0x5c4a79b24680] frame B:117 Avg QP:26.57 size: 808\n[libx264 @ 0x5c4a79b24680] consecutive B-frames: 22.4% 2.9% 4.4% 70.2%\n[libx264 @ 0x5c4a79b24680] mb I I16..4: 17.3% 76.4% 6.3%\n[libx264 @ 0x5c4a79b24680] mb P I16..4: 3.6% 5.8% 0.2% P16..4: 44.2% 11.1% 4.1% 0.0% 0.0% skip:31.0%\n[libx264 @ 0x5c4a79b24680] mb B I16..4: 0.2% 0.2% 0.0% B16..8: 35.5% 1.8% 0.1% direct: 0.5% skip:61.7% L0:51.1% L1:47.3% BI: 1.5%\n[libx264 @ 0x5c4a79b24680] 8x8 transform intra:61.5% inter:89.7%\n[libx264 @ 0x5c4a79b24680] coded y,uvDC,uvAC intra: 32.4% 67.7% 4.7% inter: 8.7% 11.3% 0.0%\n[libx264 @ 0x5c4a79b24680] i16 v,h,dc,p: 22% 38% 14% 25%\n[libx264 @ 0x5c4a79b24680] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 28% 24% 3% 4% 5% 6% 4% 4%\n[libx264 @ 0x5c4a79b24680] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 37% 28% 14% 2% 4% 4% 4% 3% 3%\n[libx264 @ 0x5c4a79b24680] i8c dc,h,v,p: 44% 29% 18% 9%\n[libx264 @ 0x5c4a79b24680] Weighted P-Frames: Y:0.0% UV:0.0%\n[libx264 @ 0x5c4a79b24680] ref P L0: 71.3% 12.4% 12.9% 3.4%\n[libx264 @ 0x5c4a79b24680] ref B L0: 91.2% 7.4% 1.4%\n[libx264 @ 0x5c4a79b24680] ref B L1: 96.9% 3.1%\n[libx264 @ 0x5c4a79b24680] kb/s:453.21\nWatermarked video saved to /tmp/tmpzf079ddnvidswap600883_watermarked.mp4",
"output": "https://replicate.delivery/pbxt/nll0sjfsxGwbNy6A5zfIur4nlZM6An58NYas6ufKgdWd3qeHB/tmpzf079ddnvidswap600883_watermarked.mp4",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-12-05T22:32:13.002154Z",
"started_at": "2023-12-05T22:32:13.018242Z",
"completed_at": "2023-12-05T22:32:15.135512Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/rijpf3rbyr4e55arjlerfuvejy/cancel",
"get": "https://api.replicate.com/v1/predictions/rijpf3rbyr4e55arjlerfuvejy"
},
"metrics": {
"predict_time": 2.11727,
"total_time": 2.133358
}
}