defaultA cat walks on the grass, realistic style.
typetext
{
"embedded_guidance_scale": 6,
"flow_shift": 7,
"height": 480,
"infer_steps": 50,
"prompt": "A cat walks on the grass, realistic style.",
"video_length": 129,
"width": 854
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_I4v**********************************
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 tencent/hunyuan-video using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"tencent/hunyuan-video:349dbe0feb6e8e4a6fab3c6a4dd642413e6c10735353de8b40f12abeee203617",
{
input: {
embedded_guidance_scale: 6,
flow_shift: 7,
height: 480,
infer_steps: 50,
prompt: "A cat walks on the grass, realistic style.",
video_length: 129,
width: 854
}
}
);
// 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_I4v**********************************
This is your API token. Keep it to yourself.
import replicate
Run tencent/hunyuan-video using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"tencent/hunyuan-video:349dbe0feb6e8e4a6fab3c6a4dd642413e6c10735353de8b40f12abeee203617",
input={
"embedded_guidance_scale": 6,
"flow_shift": 7,
"height": 480,
"infer_steps": 50,
"prompt": "A cat walks on the grass, realistic style.",
"video_length": 129,
"width": 854
}
)
# 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_I4v**********************************
This is your API token. Keep it to yourself.
Run tencent/hunyuan-video 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": "tencent/hunyuan-video:349dbe0feb6e8e4a6fab3c6a4dd642413e6c10735353de8b40f12abeee203617",
"input": {
"embedded_guidance_scale": 6,
"flow_shift": 7,
"height": 480,
"infer_steps": 50,
"prompt": "A cat walks on the grass, realistic style.",
"video_length": 129,
"width": 854
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "d2960fhetdrm80ckhr1stabb14",
"model": "tencent/hunyuan-video",
"version": "349dbe0feb6e8e4a6fab3c6a4dd642413e6c10735353de8b40f12abeee203617",
"input": {
"embedded_guidance_scale": 6,
"flow_shift": 7,
"height": 480,
"infer_steps": 50,
"prompt": "A cat walks on the grass, realistic style.",
"video_length": 129,
"width": 854
},
"logs": "Using seed: 8344\n2024-12-03 19:34:24.022 | INFO | hyvideo.inference:predict:457 - Input (height, width, video_length) = (480, 854, 129)\n2024-12-03 19:34:24.034 | DEBUG | hyvideo.inference:predict:517 -\nheight: 480\nwidth: 864\nvideo_length: 129\nprompt: ['A cat walks on the grass, realistic style.']\nneg_prompt: ['Aerial view, aerial view, overexposed, low quality, deformation, a poor composition, bad hands, bad teeth, bad eyes, bad limbs, distortion']\nseed: 8344\ninfer_steps: 50\nnum_videos_per_prompt: 1\nguidance_scale: 1.0\nn_tokens: 53460\nflow_shift: 7.0\nembedded_guidance_scale: 6.0\n 0%| | 0/50 [00:00<?, ?it/s]\n 2%|▏ | 1/50 [00:08<06:53, 8.45s/it]\n 4%|▍ | 2/50 [00:16<06:38, 8.31s/it]\n 6%|▌ | 3/50 [00:25<06:32, 8.35s/it]\n 8%|▊ | 4/50 [00:33<06:24, 8.37s/it]\n 10%|█ | 5/50 [00:41<06:17, 8.38s/it]\n 12%|█▏ | 6/50 [00:50<06:08, 8.39s/it]\n 14%|█▍ | 7/50 [00:58<06:00, 8.39s/it]\n 16%|█▌ | 8/50 [01:07<05:52, 8.39s/it]\n 18%|█▊ | 9/50 [01:15<05:44, 8.40s/it]\n 20%|██ | 10/50 [01:23<05:35, 8.40s/it]\n 22%|██▏ | 11/50 [01:32<05:26, 8.38s/it]\n 24%|██▍ | 12/50 [01:40<05:18, 8.37s/it]\n 26%|██▌ | 13/50 [01:48<05:09, 8.37s/it]\n 28%|██▊ | 14/50 [01:57<05:01, 8.38s/it]\n 30%|███ | 15/50 [02:05<04:53, 8.38s/it]\n 32%|███▏ | 16/50 [02:14<04:44, 8.37s/it]\n 34%|███▍ | 17/50 [02:22<04:35, 8.36s/it]\n 36%|███▌ | 18/50 [02:30<04:27, 8.37s/it]\n 38%|███▊ | 19/50 [02:39<04:19, 8.38s/it]\n 40%|████ | 20/50 [02:47<04:11, 8.39s/it]\n 42%|████▏ | 21/50 [02:55<04:03, 8.39s/it]\n 44%|████▍ | 22/50 [03:04<03:54, 8.38s/it]\n 46%|████▌ | 23/50 [03:12<03:45, 8.37s/it]\n 48%|████▊ | 24/50 [03:21<03:37, 8.37s/it]\n 50%|█████ | 25/50 [03:29<03:29, 8.38s/it]\n 52%|█████▏ | 26/50 [03:37<03:20, 8.37s/it]\n 54%|█████▍ | 27/50 [03:46<03:12, 8.36s/it]\n 56%|█████▌ | 28/50 [03:54<03:03, 8.35s/it]\n 58%|█████▊ | 29/50 [04:02<02:55, 8.34s/it]\n 60%|██████ | 30/50 [04:11<02:47, 8.36s/it]\n 62%|██████▏ | 31/50 [04:19<02:38, 8.37s/it]\n 64%|██████▍ | 32/50 [04:27<02:30, 8.37s/it]\n 66%|██████▌ | 33/50 [04:36<02:22, 8.39s/it]\n 68%|██████▊ | 34/50 [04:44<02:14, 8.39s/it]\n 70%|███████ | 35/50 [04:53<02:05, 8.39s/it]\n 72%|███████▏ | 36/50 [05:01<01:57, 8.39s/it]\n 74%|███████▍ | 37/50 [05:09<01:49, 8.39s/it]\n 76%|███████▌ | 38/50 [05:18<01:40, 8.39s/it]\n 78%|███████▊ | 39/50 [05:26<01:32, 8.38s/it]\n 80%|████████ | 40/50 [05:35<01:23, 8.37s/it]\n 82%|████████▏ | 41/50 [05:43<01:15, 8.38s/it]\n 84%|████████▍ | 42/50 [05:51<01:07, 8.39s/it]\n 86%|████████▌ | 43/50 [06:00<00:58, 8.39s/it]\n 88%|████████▊ | 44/50 [06:08<00:50, 8.39s/it]\n 90%|█████████ | 45/50 [06:17<00:41, 8.40s/it]\n 92%|█████████▏| 46/50 [06:25<00:33, 8.40s/it]\n 94%|█████████▍| 47/50 [06:33<00:25, 8.39s/it]\n 96%|█████████▌| 48/50 [06:42<00:16, 8.39s/it]\n 98%|█████████▊| 49/50 [06:50<00:08, 8.38s/it]\n100%|██████████| 50/50 [06:58<00:00, 8.37s/it]\n100%|██████████| 50/50 [06:58<00:00, 8.38s/it]\n2024-12-03 19:41:43.894 | INFO | hyvideo.inference:predict:546 - Success, time: 439.85961389541626\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 './results/frames_temp/frame_%05d.png':\nDuration: 00:00:05.38, start: 0.000000, bitrate: N/A\nStream #0:0: Video: png, rgb24(pc), 864x480, 24 fps, 24 tbr, 24 tbn, 24 tbc\nStream mapping:\nStream #0:0 -> #0:0 (png (native) -> h264 (libx264))\nPress [q] to stop, [?] for help\n[libx264 @ 0x56c53ea1e6c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 AVX512\n[libx264 @ 0x56c53ea1e6c0] profile High, level 3.0, 4:2:0, 8-bit\n[libx264 @ 0x56c53ea1e6c0] 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=24 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 './results/video.mp4':\nMetadata:\nencoder : Lavf58.76.100\nStream #0:0: Video: h264 (avc1 / 0x31637661), yuv420p(tv, progressive), 864x480, q=2-31, 24 fps, 12288 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= 129 fps=0.0 q=-1.0 Lsize= 1010kB time=00:00:05.25 bitrate=1575.9kbits/s speed= 11x\nvideo:1008kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.233288%\n[libx264 @ 0x56c53ea1e6c0] frame I:1 Avg QP:22.94 size: 63572\n[libx264 @ 0x56c53ea1e6c0] frame P:33 Avg QP:23.08 size: 23649\n[libx264 @ 0x56c53ea1e6c0] frame B:95 Avg QP:28.68 size: 1969\n[libx264 @ 0x56c53ea1e6c0] consecutive B-frames: 0.8% 3.1% 0.0% 96.1%\n[libx264 @ 0x56c53ea1e6c0] mb I I16..4: 2.1% 76.6% 21.3%\n[libx264 @ 0x56c53ea1e6c0] mb P I16..4: 0.0% 2.0% 0.5% P16..4: 39.9% 22.8% 17.3% 0.0% 0.0% skip:17.4%\n[libx264 @ 0x56c53ea1e6c0] mb B I16..4: 0.0% 0.1% 0.0% B16..8: 35.2% 2.4% 0.9% direct: 1.1% skip:60.4% L0:34.2% L1:53.5% BI:12.3%\n[libx264 @ 0x56c53ea1e6c0] 8x8 transform intra:77.3% inter:62.7%\n[libx264 @ 0x56c53ea1e6c0] coded y,uvDC,uvAC intra: 95.4% 94.3% 68.8% inter: 16.5% 13.9% 2.2%\n[libx264 @ 0x56c53ea1e6c0] i16 v,h,dc,p: 2% 45% 11% 43%\n[libx264 @ 0x56c53ea1e6c0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 15% 16% 10% 7% 10% 11% 10% 11% 11%\n[libx264 @ 0x56c53ea1e6c0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 17% 10% 9% 9% 11% 13% 9% 14% 8%\n[libx264 @ 0x56c53ea1e6c0] i8c dc,h,v,p: 38% 22% 19% 21%\n[libx264 @ 0x56c53ea1e6c0] Weighted P-Frames: Y:0.0% UV:0.0%\n[libx264 @ 0x56c53ea1e6c0] ref P L0: 60.4% 22.6% 15.1% 1.9%\n[libx264 @ 0x56c53ea1e6c0] ref B L0: 97.7% 2.2% 0.2%\n[libx264 @ 0x56c53ea1e6c0] ref B L1: 97.2% 2.8%\n[libx264 @ 0x56c53ea1e6c0] kb/s:1534.63",
"output": "https://replicate.delivery/xezq/4QE2pknlSLppBd1dy340UNSwPlrAM3Mgdtc9vdWf0mEDio7JA/video.mp4",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-12-03T19:33:13.555Z",
"started_at": "2024-12-03T19:34:24.023661Z",
"completed_at": "2024-12-03T19:41:58.595115Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/d2960fhetdrm80ckhr1stabb14/cancel",
"get": "https://api.replicate.com/v1/predictions/d2960fhetdrm80ckhr1stabb14",
"stream": "https://stream.replicate.com/v1/files/bcwr-xykvvezanffzmsgstovi36rb5pgplfa2ijktp72bok5l6ro7mqcq",
"web": "https://replicate.com/p/d2960fhetdrm80ckhr1stabb14"
},
"metrics": {
"predict_time": 454.57145378,
"total_time": 525.040115
}
}