typefile
{
"disparity": true,
"image": "https://replicate.delivery/pbxt/MI7Y55NgzZF7SddYf5V945wD38HkxrXaj9HEJsLzenwYW4Dp/5w3lt2f6zlr61.png",
"output_type": "color",
"processing_resolution": 0,
"resample_method": "bicubic"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_MJ9**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
import fs from "node:fs";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run kjjk10/lotus-diffusion-dense-prediction using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"kjjk10/lotus-diffusion-dense-prediction:9f9fa3ac2f263ba1551e6ae84a0fbd724c7bc166e5e416d132809c75f5ebb391",
{
input: {
disparity: true,
image: "https://replicate.delivery/pbxt/MI7Y55NgzZF7SddYf5V945wD38HkxrXaj9HEJsLzenwYW4Dp/5w3lt2f6zlr61.png",
output_type: "color",
processing_resolution: 0,
resample_method: "bicubic"
}
}
);
// 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=r8_MJ9**********************************
This is your API token. Keep it to yourself.
import replicate
Run kjjk10/lotus-diffusion-dense-prediction using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"kjjk10/lotus-diffusion-dense-prediction:9f9fa3ac2f263ba1551e6ae84a0fbd724c7bc166e5e416d132809c75f5ebb391",
input={
"disparity": True,
"image": "https://replicate.delivery/pbxt/MI7Y55NgzZF7SddYf5V945wD38HkxrXaj9HEJsLzenwYW4Dp/5w3lt2f6zlr61.png",
"output_type": "color",
"processing_resolution": 0,
"resample_method": "bicubic"
}
)
# 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=r8_MJ9**********************************
This is your API token. Keep it to yourself.
Run kjjk10/lotus-diffusion-dense-prediction 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": "kjjk10/lotus-diffusion-dense-prediction:9f9fa3ac2f263ba1551e6ae84a0fbd724c7bc166e5e416d132809c75f5ebb391",
"input": {
"disparity": true,
"image": "https://replicate.delivery/pbxt/MI7Y55NgzZF7SddYf5V945wD38HkxrXaj9HEJsLzenwYW4Dp/5w3lt2f6zlr61.png",
"output_type": "color",
"processing_resolution": 0,
"resample_method": "bicubic"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "fgk9zbprxxrmc0cm9bcvg2cjcw",
"model": "kjjk10/lotus-diffusion-dense-prediction",
"version": "9f9fa3ac2f263ba1551e6ae84a0fbd724c7bc166e5e416d132809c75f5ebb391",
"input": {
"disparity": true,
"image": "https://replicate.delivery/pbxt/MI7Y55NgzZF7SddYf5V945wD38HkxrXaj9HEJsLzenwYW4Dp/5w3lt2f6zlr61.png",
"output_type": "color",
"processing_resolution": 0,
"resample_method": "bicubic"
},
"logs": "",
"output": "https://replicate.delivery/xezq/r4sOlpQXUfSaSSO3eWIRjdfEmEgUcpFnE9wxzyo5r8Im1sGoA/output.png",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-01-09T11:36:18.415Z",
"started_at": "2025-01-09T11:36:18.423022Z",
"completed_at": "2025-01-09T11:36:19.35959Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/fgk9zbprxxrmc0cm9bcvg2cjcw/cancel",
"get": "https://api.replicate.com/v1/predictions/fgk9zbprxxrmc0cm9bcvg2cjcw",
"stream": "https://stream.replicate.com/v1/files/bcwr-64fapaynv2khge334wpy4ovk7hfffchw4g7lbaehflpbz3kl4skq",
"web": "https://replicate.com/p/fgk9zbprxxrmc0cm9bcvg2cjcw"
},
"metrics": {
"predict_time": 0.936567926,
"total_time": 0.94459
}
}
