Prediction
cjwbw/clip-vit-large-patch14:566ab1f1Input
{
"text": "red cube next to blue sphere | blue cube next to red sphere",
"image": "https://replicate.delivery/czjl/rTC1dogpbtbVNZ9eZwV04jpBqVspIfkYZjGQVRLG0nSOhabTA/output.webp"
}
npm install replicate
REPLICATE_API_TOKEN
environment variableexport 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 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: {
text: "red cube next to blue sphere | blue cube next to red sphere",
image: "https://replicate.delivery/czjl/rTC1dogpbtbVNZ9eZwV04jpBqVspIfkYZjGQVRLG0nSOhabTA/output.webp"
}
}
);
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 variableexport REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
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={
"text": "red cube next to blue sphere | blue cube next to red sphere",
"image": "https://replicate.delivery/czjl/rTC1dogpbtbVNZ9eZwV04jpBqVspIfkYZjGQVRLG0nSOhabTA/output.webp"
}
)
print(output)
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN
environment variableexport REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
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": "566ab1f111e526640c5154e712d4d54961414278f89d36590f1425badc763ecb",
"input": {
"text": "red cube next to blue sphere | blue cube next to red sphere",
"image": "https://replicate.delivery/czjl/rTC1dogpbtbVNZ9eZwV04jpBqVspIfkYZjGQVRLG0nSOhabTA/output.webp"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
brew install cog
If you don’t have Homebrew, there are other installation options available.
Pull and run cjwbw/clip-vit-large-patch14 using Cog (this will download the full model and run it in your local environment):
cog predict r8.im/cjwbw/clip-vit-large-patch14@sha256:566ab1f111e526640c5154e712d4d54961414278f89d36590f1425badc763ecb \
-i 'text="red cube next to blue sphere | blue cube next to red sphere"' \
-i 'image="https://replicate.delivery/czjl/rTC1dogpbtbVNZ9eZwV04jpBqVspIfkYZjGQVRLG0nSOhabTA/output.webp"'
To learn more, take a look at the Cog documentation.
Pull and run cjwbw/clip-vit-large-patch14 using Docker (this will download the full model and run it in your local environment):
docker run -d -p 5000:5000 --gpus=all r8.im/cjwbw/clip-vit-large-patch14@sha256:566ab1f111e526640c5154e712d4d54961414278f89d36590f1425badc763ecb
curl -s -X POST \ -H "Content-Type: application/json" \ -d $'{ "input": { "text": "red cube next to blue sphere | blue cube next to red sphere", "image": "https://replicate.delivery/czjl/rTC1dogpbtbVNZ9eZwV04jpBqVspIfkYZjGQVRLG0nSOhabTA/output.webp" } }' \ http://localhost:5000/predictions
Output
{
"completed_at": "2024-09-10T19:06:32.824863Z",
"created_at": "2024-09-10T19:06:32.586000Z",
"data_removed": false,
"error": null,
"id": "yktb2rmh19rge0chvna8mbdhec",
"input": {
"text": "red cube next to blue sphere | blue cube next to red sphere",
"image": "https://replicate.delivery/czjl/rTC1dogpbtbVNZ9eZwV04jpBqVspIfkYZjGQVRLG0nSOhabTA/output.webp"
},
"logs": null,
"metrics": {
"predict_time": 0.221594307,
"total_time": 0.238863
},
"output": [
0.29530495405197144,
0.7046950459480286
],
"started_at": "2024-09-10T19:06:32.603269Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/yktb2rmh19rge0chvna8mbdhec",
"cancel": "https://api.replicate.com/v1/predictions/yktb2rmh19rge0chvna8mbdhec/cancel"
},
"version": "566ab1f111e526640c5154e712d4d54961414278f89d36590f1425badc763ecb"
}