typefile
{
"image": "https://replicate.delivery/pbxt/JurYNQcIfISvpS6WtaOcwZXw1ifEudlLyQqiLj5N1Zq977Q3/falcon.jpg"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Rk5**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run falcons-ai/nsfw_image_detection using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"falcons-ai/nsfw_image_detection:97116600cabd3037e5f22ca08ffcc33b92cfacebf7ccd3609e9c1d29e43d3a8d",
{
input: {
image: "https://replicate.delivery/pbxt/JurYNQcIfISvpS6WtaOcwZXw1ifEudlLyQqiLj5N1Zq977Q3/falcon.jpg"
}
}
);
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_Rk5**********************************
This is your API token. Keep it to yourself.
import replicate
Run falcons-ai/nsfw_image_detection using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"falcons-ai/nsfw_image_detection:97116600cabd3037e5f22ca08ffcc33b92cfacebf7ccd3609e9c1d29e43d3a8d",
input={
"image": "https://replicate.delivery/pbxt/JurYNQcIfISvpS6WtaOcwZXw1ifEudlLyQqiLj5N1Zq977Q3/falcon.jpg"
}
)
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_Rk5**********************************
This is your API token. Keep it to yourself.
Run falcons-ai/nsfw_image_detection 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": "falcons-ai/nsfw_image_detection:97116600cabd3037e5f22ca08ffcc33b92cfacebf7ccd3609e9c1d29e43d3a8d",
"input": {
"image": "https://replicate.delivery/pbxt/JurYNQcIfISvpS6WtaOcwZXw1ifEudlLyQqiLj5N1Zq977Q3/falcon.jpg"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
normal
{
"id": "uptsg6zb2n7ze57iamsshtclqu",
"model": "falcons-ai/nsfw_image_detection",
"version": "97116600cabd3037e5f22ca08ffcc33b92cfacebf7ccd3609e9c1d29e43d3a8d",
"input": {
"image": "https://replicate.delivery/pbxt/JurYNQcIfISvpS6WtaOcwZXw1ifEudlLyQqiLj5N1Zq977Q3/falcon.jpg"
},
"logs": "",
"output": "normal",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-11-21T14:54:38.09049Z",
"started_at": "2023-11-21T14:56:46.814432Z",
"completed_at": "2023-11-21T14:56:47.38011Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/uptsg6zb2n7ze57iamsshtclqu/cancel",
"get": "https://api.replicate.com/v1/predictions/uptsg6zb2n7ze57iamsshtclqu"
},
"metrics": {
"predict_time": 0.565678,
"total_time": 129.28962
}
}