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:00b1c788
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:00b1c7885c5f1d44b51bcb56c378abc8f141eeacf94c1e64998606515fe63a8d",
{
input: {
seed: -1,
prompt: "A walking round mech ball in the surface of mars",
translate: true,
both_stages: true,
image_prompt: "https://replicate.delivery/mgxm/91cdb09e-9e62-4d81-9887-7df402a8b0c6/output_0000_-_2022-07-27T185448.681.png",
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:00b1c7885c5f1d44b51bcb56c378abc8f141eeacf94c1e64998606515fe63a8d",
input={
"seed": -1,
"prompt": "A walking round mech ball in the surface of mars",
"translate": True,
"both_stages": True,
"image_prompt": "https://replicate.delivery/mgxm/91cdb09e-9e62-4d81-9887-7df402a8b0c6/output_0000_-_2022-07-27T185448.681.png",
"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:00b1c7885c5f1d44b51bcb56c378abc8f141eeacf94c1e64998606515fe63a8d",
"input": {
"seed": -1,
"prompt": "A walking round mech ball in the surface of mars",
"translate": true,
"both_stages": true,
"image_prompt": "https://replicate.delivery/mgxm/91cdb09e-9e62-4d81-9887-7df402a8b0c6/output_0000_-_2022-07-27T185448.681.png",
"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-28T03:51:25.210357Z",
"created_at": "2022-07-28T03:24:40.539131Z",
"data_removed": false,
"error": null,
"id": "vj22ul672vcfnlel3zfi4qodem",
"input": {
"seed": "-1",
"prompt": "A walking round mech ball in the surface of mars",
"translate": true,
"both_stages": true,
"image_prompt": "https://replicate.delivery/mgxm/91cdb09e-9e62-4d81-9887-7df402a8b0c6/output_0000_-_2022-07-27T185448.681.png",
"use_guidance": true
},
"logs": "2022-07-28 03:39:20 INFO [Generating First Frame with CogView2]Raw text: 一个在火星表面行走的圆形机械球 高清摄影\n2022-07-28 03:39:20 INFO [Stage1: Generating Subsequent Frames, Frame Rate 1.0]\nraw text: 一个在火星表面行走的圆形机械球 视频\n2022-07-28 03:44:54 INFO CogVideo Stage1 completed. Taken time 333.62\n\n2022-07-28 03:45:09 INFO [Stage2: Generating Frames, Frame Rate 2]\nraw text: 一个在火星表面行走的圆形机械球",
"metrics": {
"predict_time": 730.150126,
"total_time": 1604.671226
},
"output": [
"https://replicate.delivery/mgxm/1f4136e9-56df-4015-ae29-33c97667e4f9/0.gif",
"https://replicate.delivery/mgxm/6981dd3d-848c-41dc-8b0f-0c244643c71b/0.gif"
],
"started_at": "2022-07-28T03:39:15.060231Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/vj22ul672vcfnlel3zfi4qodem",
"cancel": "https://api.replicate.com/v1/predictions/vj22ul672vcfnlel3zfi4qodem/cancel"
},
"version": "00b1c7885c5f1d44b51bcb56c378abc8f141eeacf94c1e64998606515fe63a8d"
}
2022-07-28 03:39:20 INFO [Generating First Frame with CogView2]Raw text: 一个在火星表面行走的圆形机械球 高清摄影
2022-07-28 03:39:20 INFO [Stage1: Generating Subsequent Frames, Frame Rate 1.0]
raw text: 一个在火星表面行走的圆形机械球 视频
2022-07-28 03:44:54 INFO CogVideo Stage1 completed. Taken time 333.62
2022-07-28 03:45:09 INFO [Stage2: Generating Frames, Frame Rate 2]
raw text: 一个在火星表面行走的圆形机械球