typefile
{
"image_file": "https://replicate.delivery/pbxt/KS21lfRQjpj6XrpCh8vMlysV7TztPiq4ZoPBLjndaYQ9unQ9/4.png"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_4WQ**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run vessl-ai/floyd-cpu-custom-cog-test using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"vessl-ai/floyd-cpu-custom-cog-test:d3606878279308f6c0dd8cb92637574a2ac943a5fc245f3b3e6c616c88dea6c9",
{
input: {
image_file: "https://replicate.delivery/pbxt/KS21lfRQjpj6XrpCh8vMlysV7TztPiq4ZoPBLjndaYQ9unQ9/4.png"
}
}
);
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_4WQ**********************************
This is your API token. Keep it to yourself.
import replicate
Run vessl-ai/floyd-cpu-custom-cog-test using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"vessl-ai/floyd-cpu-custom-cog-test:d3606878279308f6c0dd8cb92637574a2ac943a5fc245f3b3e6c616c88dea6c9",
input={
"image_file": "https://replicate.delivery/pbxt/KS21lfRQjpj6XrpCh8vMlysV7TztPiq4ZoPBLjndaYQ9unQ9/4.png"
}
)
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_4WQ**********************************
This is your API token. Keep it to yourself.
Run vessl-ai/floyd-cpu-custom-cog-test 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": "vessl-ai/floyd-cpu-custom-cog-test:d3606878279308f6c0dd8cb92637574a2ac943a5fc245f3b3e6c616c88dea6c9",
"input": {
"image_file": "https://replicate.delivery/pbxt/KS21lfRQjpj6XrpCh8vMlysV7TztPiq4ZoPBLjndaYQ9unQ9/4.png"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
4
{
"id": "5aqwycrbh7yqjtdlm72jyvxjom",
"model": "vessl-ai/floyd-cpu-custom-cog-test",
"version": "d3606878279308f6c0dd8cb92637574a2ac943a5fc245f3b3e6c616c88dea6c9",
"input": {
"image_file": "https://replicate.delivery/pbxt/KS21lfRQjpj6XrpCh8vMlysV7TztPiq4ZoPBLjndaYQ9unQ9/4.png"
},
"logs": "/usr/local/lib/python3.8/site-packages/torch/nn/functional.py:1331: UserWarning: dropout2d: Received a 2-D input to dropout2d, which is deprecated and will result in an error in a future release. To retain the behavior and silence this warning, please use dropout instead. Note that dropout2d exists to provide channel-wise dropout on inputs with 2 spatial dimensions, a channel dimension, and an optional batch dimension (i.e. 3D or 4D inputs).\nwarnings.warn(warn_msg)",
"output": 4,
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-02-23T01:35:36.06486Z",
"started_at": "2024-02-23T01:37:01.54356Z",
"completed_at": "2024-02-23T01:37:01.680292Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/5aqwycrbh7yqjtdlm72jyvxjom/cancel",
"get": "https://api.replicate.com/v1/predictions/5aqwycrbh7yqjtdlm72jyvxjom"
},
"metrics": {
"predict_time": 0.136732,
"total_time": 85.615432
}
}