Prediction
lucataco/rgb2grayscale-cuda:be024f18c73e4c5dbfada1343c157a0ec3c2b919ba26fdcc59e03abfae8f1c4eInput
{
"image": "https://replicate.delivery/pbxt/MeZV6UbpJMOQKGUSCnUsAnE34JMqLyh8eZR6FcFxzRkpP3Hp/replicate-prediction-z27p3r7f81rg80ck0bxtp16kxc.jpg"
}
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";
import fs from "node:fs";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run lucataco/rgb2grayscale-cuda using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"lucataco/rgb2grayscale-cuda:be024f18c73e4c5dbfada1343c157a0ec3c2b919ba26fdcc59e03abfae8f1c4e",
{
input: {
image: "https://replicate.delivery/pbxt/MeZV6UbpJMOQKGUSCnUsAnE34JMqLyh8eZR6FcFxzRkpP3Hp/replicate-prediction-z27p3r7f81rg80ck0bxtp16kxc.jpg"
}
}
);
// To access the file URL:
console.log(output.url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", 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=<paste-your-token-here>
Find your API token in your account settings.
import replicate
Run lucataco/rgb2grayscale-cuda using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"lucataco/rgb2grayscale-cuda:be024f18c73e4c5dbfada1343c157a0ec3c2b919ba26fdcc59e03abfae8f1c4e",
input={
"image": "https://replicate.delivery/pbxt/MeZV6UbpJMOQKGUSCnUsAnE34JMqLyh8eZR6FcFxzRkpP3Hp/replicate-prediction-z27p3r7f81rg80ck0bxtp16kxc.jpg"
}
)
# To access the file URL:
print(output.url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output.read())
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 lucataco/rgb2grayscale-cuda 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": "lucataco/rgb2grayscale-cuda:be024f18c73e4c5dbfada1343c157a0ec3c2b919ba26fdcc59e03abfae8f1c4e",
"input": {
"image": "https://replicate.delivery/pbxt/MeZV6UbpJMOQKGUSCnUsAnE34JMqLyh8eZR6FcFxzRkpP3Hp/replicate-prediction-z27p3r7f81rg80ck0bxtp16kxc.jpg"
}
}' \
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.
Run this to download the model and run it in your local environment:
cog predict r8.im/lucataco/rgb2grayscale-cuda@sha256:be024f18c73e4c5dbfada1343c157a0ec3c2b919ba26fdcc59e03abfae8f1c4e \
-i 'image="https://replicate.delivery/pbxt/MeZV6UbpJMOQKGUSCnUsAnE34JMqLyh8eZR6FcFxzRkpP3Hp/replicate-prediction-z27p3r7f81rg80ck0bxtp16kxc.jpg"'
To learn more, take a look at the Cog documentation.
Run this to download the model and run it in your local environment:
docker run -d -p 5000:5000 --gpus=all r8.im/lucataco/rgb2grayscale-cuda@sha256:be024f18c73e4c5dbfada1343c157a0ec3c2b919ba26fdcc59e03abfae8f1c4e
curl -s -X POST \ -H "Content-Type: application/json" \ -d $'{ "input": { "image": "https://replicate.delivery/pbxt/MeZV6UbpJMOQKGUSCnUsAnE34JMqLyh8eZR6FcFxzRkpP3Hp/replicate-prediction-z27p3r7f81rg80ck0bxtp16kxc.jpg" } }' \ http://localhost:5000/predictions
To learn more, take a look at the Cog documentation.
Output
{
"completed_at": "2025-03-13T17:35:42.156847Z",
"created_at": "2025-03-13T17:35:41.694000Z",
"data_removed": false,
"error": null,
"id": "20wer144fsrge0cnj29v8hzc2c",
"input": {
"image": "https://replicate.delivery/pbxt/MeZV6UbpJMOQKGUSCnUsAnE34JMqLyh8eZR6FcFxzRkpP3Hp/replicate-prediction-z27p3r7f81rg80ck0bxtp16kxc.jpg"
},
"logs": "h*w: 1664*2496",
"metrics": {
"predict_time": 0.446738735,
"total_time": 0.462847
},
"output": "https://replicate.delivery/czjl/NQjGiHjnJDpLNtlXY19sqVmfLiixfBo1zoxPvgf6pLJcLZwoA/output.jpg",
"started_at": "2025-03-13T17:35:41.710108Z",
"status": "succeeded",
"urls": {
"stream": "https://stream.replicate.com/v1/files/fddq-gqifle4am2suezuob5isw65xk2fo4u3bhrj2hgwbhqngiqonhvza",
"get": "https://api.replicate.com/v1/predictions/20wer144fsrge0cnj29v8hzc2c",
"cancel": "https://api.replicate.com/v1/predictions/20wer144fsrge0cnj29v8hzc2c/cancel"
},
"version": "be024f18c73e4c5dbfada1343c157a0ec3c2b919ba26fdcc59e03abfae8f1c4e"
}