typefile
{
"image": "https://replicate.delivery/czjl/rTC1dogpbtbVNZ9eZwV04jpBqVspIfkYZjGQVRLG0nSOhabTA/output.webp",
"text": "red cube next to blue sphere | blue cube next to red sphere"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_6IQ**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run cjwbw/clip-vit-large-patch14 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"cjwbw/clip-vit-large-patch14:566ab1f111e526640c5154e712d4d54961414278f89d36590f1425badc763ecb",
{
input: {
image: "https://replicate.delivery/czjl/rTC1dogpbtbVNZ9eZwV04jpBqVspIfkYZjGQVRLG0nSOhabTA/output.webp",
text: "red cube next to blue sphere | blue cube next to red sphere"
}
}
);
console.log(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_6IQ**********************************
This is your API token. Keep it to yourself.
import replicate
Run cjwbw/clip-vit-large-patch14 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"cjwbw/clip-vit-large-patch14:566ab1f111e526640c5154e712d4d54961414278f89d36590f1425badc763ecb",
input={
"image": "https://replicate.delivery/czjl/rTC1dogpbtbVNZ9eZwV04jpBqVspIfkYZjGQVRLG0nSOhabTA/output.webp",
"text": "red cube next to blue sphere | blue cube next to red sphere"
}
)
print(output)
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_6IQ**********************************
This is your API token. Keep it to yourself.
Run cjwbw/clip-vit-large-patch14 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": "cjwbw/clip-vit-large-patch14:566ab1f111e526640c5154e712d4d54961414278f89d36590f1425badc763ecb",
"input": {
"image": "https://replicate.delivery/czjl/rTC1dogpbtbVNZ9eZwV04jpBqVspIfkYZjGQVRLG0nSOhabTA/output.webp",
"text": "red cube next to blue sphere | blue cube next to red sphere"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "yktb2rmh19rge0chvna8mbdhec",
"model": "cjwbw/clip-vit-large-patch14",
"version": "566ab1f111e526640c5154e712d4d54961414278f89d36590f1425badc763ecb",
"input": {
"image": "https://replicate.delivery/czjl/rTC1dogpbtbVNZ9eZwV04jpBqVspIfkYZjGQVRLG0nSOhabTA/output.webp",
"text": "red cube next to blue sphere | blue cube next to red sphere"
},
"logs": "",
"output": [
0.29530495405197144,
0.7046950459480286
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-09-10T19:06:32.586Z",
"started_at": "2024-09-10T19:06:32.603269Z",
"completed_at": "2024-09-10T19:06:32.824863Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/yktb2rmh19rge0chvna8mbdhec/cancel",
"get": "https://api.replicate.com/v1/predictions/yktb2rmh19rge0chvna8mbdhec",
"web": "https://replicate.com/p/yktb2rmh19rge0chvna8mbdhec"
},
"metrics": {
"predict_time": 0.221594307,
"total_time": 0.238863
}
}