Failed to load versions. Head to the versions page to see all versions for this model.
You're looking at a specific version of this model. Jump to the model overview.
lucataco /rgb2grayscale-cuda:be024f18
Input
Run this model in Node.js with one line of code:
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"
}
)
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=<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.
Add a payment method to run this model.
By signing in, you agree to our
terms of service and privacy policy
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"
}