Failed to load versions. Head to the versions page to see all versions for this model.
You're looking at a specific version of this model. Jump to the model overview.
nightmareai /cogvideo:feea196e
Input
Run this model in Node.js with one line of code:
npm install replicate
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run nightmareai/cogvideo using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"nightmareai/cogvideo:feea196e16cfe3131adb624ad1189dc12a48b874d923669c89f08afa580a234c",
{
input: {
seed: -1,
prompt: "a canadian goose",
translate: true,
both_stages: true,
use_guidance: true
}
}
);
// 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=<paste-your-token-here>
Find your API token in your account settings.
import replicate
Run nightmareai/cogvideo using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"nightmareai/cogvideo:feea196e16cfe3131adb624ad1189dc12a48b874d923669c89f08afa580a234c",
input={
"seed": -1,
"prompt": "a canadian goose",
"translate": True,
"both_stages": True,
"use_guidance": True
}
)
# The nightmareai/cogvideo 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/nightmareai/cogvideo/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=<paste-your-token-here>
Find your API token in your account settings.
Run nightmareai/cogvideo 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": "nightmareai/cogvideo:feea196e16cfe3131adb624ad1189dc12a48b874d923669c89f08afa580a234c",
"input": {
"seed": -1,
"prompt": "a canadian goose",
"translate": true,
"both_stages": true,
"use_guidance": true
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Add a payment method to run this model.
By signing in, you agree to our
terms of service and privacy policy
Output
{
"completed_at": "2022-07-25T17:21:05.470088Z",
"created_at": "2022-07-25T16:55:43.938017Z",
"data_removed": false,
"error": null,
"id": "36qpar6jsjft3mcxft4nb5aswu",
"input": {
"seed": "-1",
"prompt": "a canadian goose",
"translate": true,
"both_stages": true,
"use_guidance": true
},
"logs": "2022-07-25 17:09:34 DEBUG Starting new HTTPS connection (1): translate.google.com:443\n2022-07-25 17:09:34 DEBUG https://translate.google.com:443 \"GET /m?tl=zh-CN&sl=en&q=a+canadian+goose HTTP/1.1\" 200 None\n2022-07-25 17:09:34 DEBUG moving stage 2 model to cpu\n2022-07-25 17:09:34 DEBUG moving stage 1 model to cuda\n2022-07-25 17:09:38 DEBUG moving in model1 takes time: 3.85\n2022-07-25 17:09:38 INFO [Generating First Frame with CogView2]Raw text: 一只加拿大鹅 高清摄影\n2022-07-25 17:10:17 INFO [First Frame]Taken time 38.77\n\n2022-07-25 17:10:17 INFO [Stage1: Generating Subsequent Frames, Frame Rate 1.0]\nraw text: 一只加拿大鹅 视频\n2022-07-25 17:10:17 DEBUG Using Guidance In Inference\n2022-07-25 17:10:17 DEBUG Limit spatial-channel's mem to current frame\n2022-07-25 17:15:27 DEBUG Attempting to acquire lock 140170285471824 on /root/.icetk_models/ice_image.pt.lock\n2022-07-25 17:15:27 DEBUG Lock 140170285471824 acquired on /root/.icetk_models/ice_image.pt.lock\n2022-07-25 17:15:27 DEBUG Attempting to release lock 140170285471824 on /root/.icetk_models/ice_image.pt.lock\n2022-07-25 17:15:27 DEBUG Lock 140170285471824 released on /root/.icetk_models/ice_image.pt.lock\n\n 0%| | 0/5 [00:00<?, ?it/s]\n 40%|████ | 2/5 [00:00<00:00, 19.93it/s]\n100%|██████████| 5/5 [00:00<00:00, 41.29it/s]\nVersion: 1.5\nInput files:\n['/tmp/tmplrmhhscb/output/stage1/frames/0/0000.jpg', '/tmp/tmplrmhhscb/output/stage1/frames/0/0001.jpg', '/tmp/tmplrmhhscb/output/stage1/frames/0/0002.jpg', '/tmp/tmplrmhhscb/output/stage1/frames/0/0003.jpg', '/tmp/tmplrmhhscb/output/stage1/frames/0/0004.jpg']\nFile created: /tmp/tmplrmhhscb/output/stage1/0.gif\n2022-07-25 17:15:33 INFO CogVideo Stage1 completed. Taken time 355.14\n\n2022-07-25 17:15:33 DEBUG moving stage 1 model to cpu\n2022-07-25 17:15:44 DEBUG moving stage 2 model to cuda\n2022-07-25 17:15:48 DEBUG moving in model2 takes time: 4.13\n2022-07-25 17:15:48 DEBUG moving stage-2 model to cuda\n2022-07-25 17:15:48 DEBUG moving in stage-2 model takes time: 0.01\n2022-07-25 17:15:48 INFO [Stage2: Generating Frames, Frame Rate 2]\nraw text: 一只加拿大鹅\n2022-07-25 17:15:48 DEBUG Limit spatial-channel's mem to current frame\n2022-07-25 17:17:23 INFO Duration 2.00, Taken time 94.41\n\n2022-07-25 17:17:23 INFO [Stage2: Generating Frames, Frame Rate 4]\nraw text: 一只加拿大鹅\n2022-07-25 17:17:23 DEBUG Limit spatial-channel's mem to current frame\n2022-07-25 17:19:00 INFO Duration 1.00, Taken time 97.66\n\n2022-07-25 17:19:00 INFO [Stage2: Generating Frames, Frame Rate 8]\nraw text: 一只加拿大鹅\n2022-07-25 17:19:00 DEBUG Limit spatial-channel's mem to current frame\n2022-07-25 17:20:47 INFO Duration 0.50, Taken time 106.76\n\n2022-07-25 17:20:47 INFO CogVideo Stage2 completed. Taken time 298.84\n\n2022-07-25 17:20:47 DEBUG moving stage 2 model to cpu\n\n 0%| | 0/33 [00:00<?, ?it/s]\n 36%|███▋ | 12/33 [00:00<00:00, 114.31it/s]\n 76%|███████▌ | 25/33 [00:00<00:00, 118.06it/s]\n100%|██████████| 33/33 [00:00<00:00, 118.37it/s]\nVersion: 1.5\nInput files:\n['/tmp/tmplrmhhscb/output/stage2/frames/0/0000.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0001.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0002.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0003.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0004.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0005.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0006.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0007.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0008.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0009.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0010.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0011.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0012.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0013.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0014.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0015.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0016.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0017.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0018.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0019.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0020.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0021.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0022.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0023.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0024.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0025.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0026.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0027.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0028.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0029.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0030.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0031.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0032.jpg']\nFile created: /tmp/tmplrmhhscb/output/stage2/0.gif\n2022-07-25 17:21:04 DEBUG complete, exiting",
"metrics": {
"predict_time": 691.76149,
"total_time": 1521.532071
},
"output": [
"https://replicate.delivery/mgxm/51ed3529-4e0b-4cc1-9c9a-b0ab1e8b0995/0.gif",
"https://replicate.delivery/mgxm/7ef4f241-3160-4251-8a57-be8e5d221cc6/0.gif"
],
"started_at": "2022-07-25T17:09:33.708598Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/36qpar6jsjft3mcxft4nb5aswu",
"cancel": "https://api.replicate.com/v1/predictions/36qpar6jsjft3mcxft4nb5aswu/cancel"
},
"version": "feea196e16cfe3131adb624ad1189dc12a48b874d923669c89f08afa580a234c"
}
2022-07-25 17:09:34 DEBUG Starting new HTTPS connection (1): translate.google.com:443
2022-07-25 17:09:34 DEBUG https://translate.google.com:443 "GET /m?tl=zh-CN&sl=en&q=a+canadian+goose HTTP/1.1" 200 None
2022-07-25 17:09:34 DEBUG moving stage 2 model to cpu
2022-07-25 17:09:34 DEBUG moving stage 1 model to cuda
2022-07-25 17:09:38 DEBUG moving in model1 takes time: 3.85
2022-07-25 17:09:38 INFO [Generating First Frame with CogView2]Raw text: 一只加拿大鹅 高清摄影
2022-07-25 17:10:17 INFO [First Frame]Taken time 38.77
2022-07-25 17:10:17 INFO [Stage1: Generating Subsequent Frames, Frame Rate 1.0]
raw text: 一只加拿大鹅 视频
2022-07-25 17:10:17 DEBUG Using Guidance In Inference
2022-07-25 17:10:17 DEBUG Limit spatial-channel's mem to current frame
2022-07-25 17:15:27 DEBUG Attempting to acquire lock 140170285471824 on /root/.icetk_models/ice_image.pt.lock
2022-07-25 17:15:27 DEBUG Lock 140170285471824 acquired on /root/.icetk_models/ice_image.pt.lock
2022-07-25 17:15:27 DEBUG Attempting to release lock 140170285471824 on /root/.icetk_models/ice_image.pt.lock
2022-07-25 17:15:27 DEBUG Lock 140170285471824 released on /root/.icetk_models/ice_image.pt.lock
0%| | 0/5 [00:00<?, ?it/s]
40%|████ | 2/5 [00:00<00:00, 19.93it/s]
100%|██████████| 5/5 [00:00<00:00, 41.29it/s]
Version: 1.5
Input files:
['/tmp/tmplrmhhscb/output/stage1/frames/0/0000.jpg', '/tmp/tmplrmhhscb/output/stage1/frames/0/0001.jpg', '/tmp/tmplrmhhscb/output/stage1/frames/0/0002.jpg', '/tmp/tmplrmhhscb/output/stage1/frames/0/0003.jpg', '/tmp/tmplrmhhscb/output/stage1/frames/0/0004.jpg']
File created: /tmp/tmplrmhhscb/output/stage1/0.gif
2022-07-25 17:15:33 INFO CogVideo Stage1 completed. Taken time 355.14
2022-07-25 17:15:33 DEBUG moving stage 1 model to cpu
2022-07-25 17:15:44 DEBUG moving stage 2 model to cuda
2022-07-25 17:15:48 DEBUG moving in model2 takes time: 4.13
2022-07-25 17:15:48 DEBUG moving stage-2 model to cuda
2022-07-25 17:15:48 DEBUG moving in stage-2 model takes time: 0.01
2022-07-25 17:15:48 INFO [Stage2: Generating Frames, Frame Rate 2]
raw text: 一只加拿大鹅
2022-07-25 17:15:48 DEBUG Limit spatial-channel's mem to current frame
2022-07-25 17:17:23 INFO Duration 2.00, Taken time 94.41
2022-07-25 17:17:23 INFO [Stage2: Generating Frames, Frame Rate 4]
raw text: 一只加拿大鹅
2022-07-25 17:17:23 DEBUG Limit spatial-channel's mem to current frame
2022-07-25 17:19:00 INFO Duration 1.00, Taken time 97.66
2022-07-25 17:19:00 INFO [Stage2: Generating Frames, Frame Rate 8]
raw text: 一只加拿大鹅
2022-07-25 17:19:00 DEBUG Limit spatial-channel's mem to current frame
2022-07-25 17:20:47 INFO Duration 0.50, Taken time 106.76
2022-07-25 17:20:47 INFO CogVideo Stage2 completed. Taken time 298.84
2022-07-25 17:20:47 DEBUG moving stage 2 model to cpu
0%| | 0/33 [00:00<?, ?it/s]
36%|███▋ | 12/33 [00:00<00:00, 114.31it/s]
76%|███████▌ | 25/33 [00:00<00:00, 118.06it/s]
100%|██████████| 33/33 [00:00<00:00, 118.37it/s]
Version: 1.5
Input files:
['/tmp/tmplrmhhscb/output/stage2/frames/0/0000.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0001.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0002.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0003.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0004.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0005.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0006.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0007.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0008.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0009.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0010.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0011.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0012.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0013.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0014.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0015.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0016.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0017.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0018.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0019.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0020.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0021.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0022.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0023.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0024.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0025.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0026.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0027.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0028.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0029.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0030.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0031.jpg', '/tmp/tmplrmhhscb/output/stage2/frames/0/0032.jpg']
File created: /tmp/tmplrmhhscb/output/stage2/0.gif
2022-07-25 17:21:04 DEBUG complete, exiting