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:45d8cfca
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:45d8cfcae754b6af7581083ac8e2011b0f98e137faa9775a221f8f6747f33b61",
{
input: {
seed: -1,
prompt: "a cheeseburger flying in the air",
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:45d8cfcae754b6af7581083ac8e2011b0f98e137faa9775a221f8f6747f33b61",
input={
"seed": -1,
"prompt": "a cheeseburger flying in the air",
"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:45d8cfcae754b6af7581083ac8e2011b0f98e137faa9775a221f8f6747f33b61",
"input": {
"seed": -1,
"prompt": "a cheeseburger flying in the air",
"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-26T09:02:11.190599Z",
"created_at": "2022-07-26T08:33:15.073163Z",
"data_removed": false,
"error": null,
"id": "m4jtbomzoratvi6ctnn5l645ia",
"input": {
"seed": "-1",
"prompt": "a cheeseburger flying in the air",
"translate": true,
"both_stages": true,
"use_guidance": true
},
"logs": "2022-07-26 08:49:47 INFO [Generating First Frame with CogView2]Raw text: 一个在空中飞翔的芝士汉堡 高清摄影\n2022-07-26 08:50:25 INFO [First Frame]Taken time 38.44\n\n2022-07-26 08:50:25 INFO [Stage1: Generating Subsequent Frames, Frame Rate 1.0]\nraw text: 一个在空中飞翔的芝士汉堡 视频\n2022-07-26 08:55:46 INFO CogVideo Stage1 completed. Taken time 359.02\n\n2022-07-26 08:56:01 INFO [Stage2: Generating Frames, Frame Rate 2]\nraw text: 一个在空中飞翔的芝士汉堡\n2022-07-26 08:57:37 INFO Duration 2.00, Taken time 96.14\n\n2022-07-26 08:57:37 INFO [Stage2: Generating Frames, Frame Rate 4]\nraw text: 一个在空中飞翔的芝士汉堡",
"metrics": {
"predict_time": 748.369929,
"total_time": 1736.117436
},
"output": [
"https://replicate.delivery/mgxm/8548097f-050e-47bc-a029-1195f2272bb4/0.gif",
"https://replicate.delivery/mgxm/5b481c5f-f738-4f54-af44-0e65e87437ad/0.gif"
],
"started_at": "2022-07-26T08:49:42.820670Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/m4jtbomzoratvi6ctnn5l645ia",
"cancel": "https://api.replicate.com/v1/predictions/m4jtbomzoratvi6ctnn5l645ia/cancel"
},
"version": "45d8cfcae754b6af7581083ac8e2011b0f98e137faa9775a221f8f6747f33b61"
}
2022-07-26 08:49:47 INFO [Generating First Frame with CogView2]Raw text: 一个在空中飞翔的芝士汉堡 高清摄影
2022-07-26 08:50:25 INFO [First Frame]Taken time 38.44
2022-07-26 08:50:25 INFO [Stage1: Generating Subsequent Frames, Frame Rate 1.0]
raw text: 一个在空中飞翔的芝士汉堡 视频
2022-07-26 08:55:46 INFO CogVideo Stage1 completed. Taken time 359.02
2022-07-26 08:56:01 INFO [Stage2: Generating Frames, Frame Rate 2]
raw text: 一个在空中飞翔的芝士汉堡
2022-07-26 08:57:37 INFO Duration 2.00, Taken time 96.14
2022-07-26 08:57:37 INFO [Stage2: Generating Frames, Frame Rate 4]
raw text: 一个在空中飞翔的芝士汉堡