typetext
{
"control_image": "https://replicate.delivery/pbxt/M0ivr5QCMktmdUi3t0TFrKtw3DSPenPTU5NAOEKjTfW98HaB/https___replicate.delivery_czjl_z4gE33oPjuLPB91f9eO5Np4zaqwm20UYPOZhjpTfXRJVzYmnA_tmppi3by3z7.jpg",
"guidance": 7,
"output_format": "jpg",
"prompt": "abstract 3D render with the word \"DEPTH\"",
"prompt_upsampling": false,
"safety_tolerance": 2,
"steps": 50
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Vxj**********************************
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 black-forest-labs/flux-depth-pro using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
control_image: "https://replicate.delivery/pbxt/M0ivr5QCMktmdUi3t0TFrKtw3DSPenPTU5NAOEKjTfW98HaB/https___replicate.delivery_czjl_z4gE33oPjuLPB91f9eO5Np4zaqwm20UYPOZhjpTfXRJVzYmnA_tmppi3by3z7.jpg",
guidance: 7,
output_format: "jpg",
prompt: "abstract 3D render with the word \"DEPTH\"",
prompt_upsampling: false,
safety_tolerance: 2,
steps: 50
};
const output = await replicate.run("black-forest-labs/flux-depth-pro", { input });
// 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_Vxj**********************************
This is your API token. Keep it to yourself.
import replicate
Run black-forest-labs/flux-depth-pro using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"black-forest-labs/flux-depth-pro",
input={
"control_image": "https://replicate.delivery/pbxt/M0ivr5QCMktmdUi3t0TFrKtw3DSPenPTU5NAOEKjTfW98HaB/https___replicate.delivery_czjl_z4gE33oPjuLPB91f9eO5Np4zaqwm20UYPOZhjpTfXRJVzYmnA_tmppi3by3z7.jpg",
"guidance": 7,
"output_format": "jpg",
"prompt": "abstract 3D render with the word \"DEPTH\"",
"prompt_upsampling": False,
"safety_tolerance": 2,
"steps": 50
}
)
# 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_Vxj**********************************
This is your API token. Keep it to yourself.
Run black-forest-labs/flux-depth-pro 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 $'{
"input": {
"control_image": "https://replicate.delivery/pbxt/M0ivr5QCMktmdUi3t0TFrKtw3DSPenPTU5NAOEKjTfW98HaB/https___replicate.delivery_czjl_z4gE33oPjuLPB91f9eO5Np4zaqwm20UYPOZhjpTfXRJVzYmnA_tmppi3by3z7.jpg",
"guidance": 7,
"output_format": "jpg",
"prompt": "abstract 3D render with the word \\"DEPTH\\"",
"prompt_upsampling": false,
"safety_tolerance": 2,
"steps": 50
}
}' \
https://api.replicate.com/v1/models/black-forest-labs/flux-depth-pro/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "vvnr81nssdrg80ck9ssbhw7fkc",
"model": "black-forest-labs/flux-depth-pro",
"version": "hidden",
"input": {
"control_image": "https://replicate.delivery/pbxt/M0ivr5QCMktmdUi3t0TFrKtw3DSPenPTU5NAOEKjTfW98HaB/https___replicate.delivery_czjl_z4gE33oPjuLPB91f9eO5Np4zaqwm20UYPOZhjpTfXRJVzYmnA_tmppi3by3z7.jpg",
"guidance": 7,
"output_format": "jpg",
"prompt": "abstract 3D render with the word \"DEPTH\"",
"prompt_upsampling": false,
"safety_tolerance": 2,
"steps": 50
},
"logs": "Using seed: 57786\nRunning prediction... \nGenerating image...\nGenerated image in 23.7sec\nDownloaded image in 1.65sec",
"output": "https://replicate.delivery/czjl/YmnJr3uJFwaLHpyE2YQZEsGD6DsN3h6opElksQJ4UUzUJz8E/tmp_zp5p3b2.jpg",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-11-21T11:19:21.803Z",
"started_at": "2024-11-21T11:19:21.812143Z",
"completed_at": "2024-11-21T11:19:47.37723Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/vvnr81nssdrg80ck9ssbhw7fkc/cancel",
"get": "https://api.replicate.com/v1/predictions/vvnr81nssdrg80ck9ssbhw7fkc",
"stream": "https://stream.replicate.com/v1/files/fddq-lwepnb4bb32saq4cqh2rbpks6gvf2gtblsuqackz5bwyobhg7eiq",
"web": "https://replicate.com/p/vvnr81nssdrg80ck9ssbhw7fkc"
},
"metrics": {
"image_count": 1,
"predict_time": 25.565086614,
"total_time": 25.57423
}
}
