defaultWanderer above the sea of fog, digital art
typetext
{
"guidance_scale": 7.5,
"input_image": "https://replicate.delivery/pbxt/ICo443xcFQGIK4lawWN3ytMNDZsmZS6fZfjGYwFP6Dc5Vfnq/wanderer.jpeg",
"num_inference_steps": 50,
"num_outputs": 1,
"prompt": "wanderer above a cyberpunk city, 4k digital art rendering by caspar david friedrich",
"prompt_strength": 0.8,
"scheduler": "DPMSolverMultistep",
"seed": -1
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_0qw**********************************
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 jagilley/stable-diffusion-depth2img using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"jagilley/stable-diffusion-depth2img:d488378e301ffa295b360e6a34e0a504b772449c75f570a9f4e5089d05f660df",
{
input: {
guidance_scale: 7.5,
input_image: "https://replicate.delivery/pbxt/ICo443xcFQGIK4lawWN3ytMNDZsmZS6fZfjGYwFP6Dc5Vfnq/wanderer.jpeg",
num_inference_steps: 50,
num_outputs: 1,
prompt: "wanderer above a cyberpunk city, 4k digital art rendering by caspar david friedrich",
prompt_strength: 0.8,
scheduler: "DPMSolverMultistep",
seed: -1
}
}
);
// To access the file URL:
console.log(output[0].url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", output[0]);
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_0qw**********************************
This is your API token. Keep it to yourself.
import replicate
Run jagilley/stable-diffusion-depth2img using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"jagilley/stable-diffusion-depth2img:d488378e301ffa295b360e6a34e0a504b772449c75f570a9f4e5089d05f660df",
input={
"guidance_scale": 7.5,
"input_image": "https://replicate.delivery/pbxt/ICo443xcFQGIK4lawWN3ytMNDZsmZS6fZfjGYwFP6Dc5Vfnq/wanderer.jpeg",
"num_inference_steps": 50,
"num_outputs": 1,
"prompt": "wanderer above a cyberpunk city, 4k digital art rendering by caspar david friedrich",
"prompt_strength": 0.8,
"scheduler": "DPMSolverMultistep",
"seed": -1
}
)
# To access the file URL:
print(output[0].url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output[0].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_0qw**********************************
This is your API token. Keep it to yourself.
Run jagilley/stable-diffusion-depth2img 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": "jagilley/stable-diffusion-depth2img:d488378e301ffa295b360e6a34e0a504b772449c75f570a9f4e5089d05f660df",
"input": {
"guidance_scale": 7.5,
"input_image": "https://replicate.delivery/pbxt/ICo443xcFQGIK4lawWN3ytMNDZsmZS6fZfjGYwFP6Dc5Vfnq/wanderer.jpeg",
"num_inference_steps": 50,
"num_outputs": 1,
"prompt": "wanderer above a cyberpunk city, 4k digital art rendering by caspar david friedrich",
"prompt_strength": 0.8,
"scheduler": "DPMSolverMultistep",
"seed": -1
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "xadvta5lnreybcutg6njr6lulq",
"model": "jagilley/stable-diffusion-depth2img",
"version": "d488378e301ffa295b360e6a34e0a504b772449c75f570a9f4e5089d05f660df",
"input": {
"guidance_scale": 7.5,
"input_image": "https://replicate.delivery/pbxt/ICo443xcFQGIK4lawWN3ytMNDZsmZS6fZfjGYwFP6Dc5Vfnq/wanderer.jpeg",
"num_inference_steps": 50,
"num_outputs": 1,
"prompt": "wanderer above a cyberpunk city, 4k digital art rendering by caspar david friedrich",
"prompt_strength": 0.8,
"scheduler": "DPMSolverMultistep",
"seed": -1
},
"logs": "Using seed: -1\n 0%| | 0/40 [00:00<?, ?it/s]\n 2%|▎ | 1/40 [00:04<03:14, 4.99s/it]\n 8%|▊ | 3/40 [00:05<00:49, 1.35s/it]\n 12%|█▎ | 5/40 [00:05<00:24, 1.46it/s]\n 18%|█▊ | 7/40 [00:05<00:13, 2.37it/s]\n 22%|██▎ | 9/40 [00:05<00:08, 3.48it/s]\n 28%|██▊ | 11/40 [00:05<00:06, 4.78it/s]\n 32%|███▎ | 13/40 [00:05<00:04, 6.23it/s]\n 38%|███▊ | 15/40 [00:05<00:03, 7.75it/s]\n 42%|████▎ | 17/40 [00:06<00:02, 9.23it/s]\n 48%|████▊ | 19/40 [00:06<00:01, 10.56it/s]\n 52%|█████▎ | 21/40 [00:06<00:01, 11.78it/s]\n 57%|█████▊ | 23/40 [00:06<00:01, 12.76it/s]\n 62%|██████▎ | 25/40 [00:06<00:01, 13.49it/s]\n 68%|██████▊ | 27/40 [00:06<00:00, 14.10it/s]\n 72%|███████▎ | 29/40 [00:06<00:00, 14.60it/s]\n 78%|███████▊ | 31/40 [00:06<00:00, 14.96it/s]\n 82%|████████▎ | 33/40 [00:07<00:00, 15.19it/s]\n 88%|████████▊ | 35/40 [00:07<00:00, 15.31it/s]\n 92%|█████████▎| 37/40 [00:07<00:00, 15.46it/s]\n 98%|█████████▊| 39/40 [00:07<00:00, 15.50it/s]\n100%|██████████| 40/40 [00:07<00:00, 5.35it/s]",
"output": [
"https://replicate.delivery/pbxt/7MKZB7KJhVbxL1DKSiDYQ7eInHCKYgBi9zPeKkJbjri14IYQA/out-0.png"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-01-26T20:01:36.420191Z",
"started_at": "2023-01-26T20:01:46.197676Z",
"completed_at": "2023-01-26T20:01:57.999236Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/xadvta5lnreybcutg6njr6lulq/cancel",
"get": "https://api.replicate.com/v1/predictions/xadvta5lnreybcutg6njr6lulq"
},
"metrics": {
"predict_time": 11.80156,
"total_time": 21.579045
}
}
