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.
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 usamaehsan/controlnet-1.1-x-realistic-vision-v2.0 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"usamaehsan/controlnet-1.1-x-realistic-vision-v2.0:7fbf4c86671738f97896c9cb4922705adfcdcf54a6edab193bb8c176c6b34a69",
{
input: {
eta: 0,
image: "https://replicate.delivery/pbxt/IrAj0VHPeL5auOq1U2mFWtqe8Ot1JSv00QDnFSOGvlUg9hr5/20230520_110328.jpg",
scale: 5.76,
prompt: "Alien in ancient egypt",
a_prompt: "Best quality, extremely detailed",
n_prompt: "Longbody, lowres, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality",
strength: 0.5,
guessmode: false,
structure: "lineart",
ddim_steps: 10,
num_samples: "1",
preprocessor: "Lineart",
image_resolution: "512",
preprocessor_resolution: 512
}
}
);
// 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=<paste-your-token-here>
Find your API token in your account settings.
import replicate
Run usamaehsan/controlnet-1.1-x-realistic-vision-v2.0 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"usamaehsan/controlnet-1.1-x-realistic-vision-v2.0:7fbf4c86671738f97896c9cb4922705adfcdcf54a6edab193bb8c176c6b34a69",
input={
"eta": 0,
"image": "https://replicate.delivery/pbxt/IrAj0VHPeL5auOq1U2mFWtqe8Ot1JSv00QDnFSOGvlUg9hr5/20230520_110328.jpg",
"scale": 5.76,
"prompt": "Alien in ancient egypt",
"a_prompt": "Best quality, extremely detailed",
"n_prompt": "Longbody, lowres, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality",
"strength": 0.5,
"guessmode": False,
"structure": "lineart",
"ddim_steps": 10,
"num_samples": "1",
"preprocessor": "Lineart",
"image_resolution": "512",
"preprocessor_resolution": 512
}
)
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 usamaehsan/controlnet-1.1-x-realistic-vision-v2.0 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": "usamaehsan/controlnet-1.1-x-realistic-vision-v2.0:7fbf4c86671738f97896c9cb4922705adfcdcf54a6edab193bb8c176c6b34a69",
"input": {
"eta": 0,
"image": "https://replicate.delivery/pbxt/IrAj0VHPeL5auOq1U2mFWtqe8Ot1JSv00QDnFSOGvlUg9hr5/20230520_110328.jpg",
"scale": 5.76,
"prompt": "Alien in ancient egypt",
"a_prompt": "Best quality, extremely detailed",
"n_prompt": "Longbody, lowres, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality",
"strength": 0.5,
"guessmode": false,
"structure": "lineart",
"ddim_steps": 10,
"num_samples": "1",
"preprocessor": "Lineart",
"image_resolution": "512",
"preprocessor_resolution": 512
}
}' \
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": "2023-05-20T13:20:46.960113Z",
"created_at": "2023-05-20T13:17:50.771490Z",
"data_removed": false,
"error": null,
"id": "csdputeejzhjlewkn66avojfn4",
"input": {
"image": "https://replicate.delivery/pbxt/IrAj0VHPeL5auOq1U2mFWtqe8Ot1JSv00QDnFSOGvlUg9hr5/20230520_110328.jpg",
"scale": 5.76,
"prompt": "Alien in ancient egypt",
"a_prompt": "Best quality, extremely detailed",
"n_prompt": "Longbody, lowres, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality",
"strength": 0.5,
"structure": "lineart",
"ddim_steps": 10,
"num_samples": "1",
"preprocessor": "Lineart",
"image_resolution": "512",
"preprocessor_resolution": 512
},
"logs": "Global seed set to 294930\nData shape for DDIM sampling is (1, 4, 64, 96), eta 0.0\nRunning DDIM Sampling with 10 timesteps\nDDIM Sampler: 0%| | 0/10 [00:00<?, ?it/s]\nDDIM Sampler: 10%|█ | 1/10 [00:00<00:02, 3.38it/s]\nDDIM Sampler: 20%|██ | 2/10 [00:00<00:02, 3.59it/s]\nDDIM Sampler: 30%|███ | 3/10 [00:00<00:01, 3.66it/s]\nDDIM Sampler: 40%|████ | 4/10 [00:01<00:01, 3.69it/s]\nDDIM Sampler: 50%|█████ | 5/10 [00:01<00:01, 3.71it/s]\nDDIM Sampler: 60%|██████ | 6/10 [00:01<00:01, 3.72it/s]\nDDIM Sampler: 70%|███████ | 7/10 [00:01<00:00, 3.73it/s]\nDDIM Sampler: 80%|████████ | 8/10 [00:02<00:00, 3.74it/s]\nDDIM Sampler: 90%|█████████ | 9/10 [00:02<00:00, 3.74it/s]\nDDIM Sampler: 100%|██████████| 10/10 [00:02<00:00, 3.74it/s]\nDDIM Sampler: 100%|██████████| 10/10 [00:02<00:00, 3.71it/s]",
"metrics": {
"predict_time": 6.316495,
"total_time": 176.188623
},
"output": [
"https://replicate.delivery/pbxt/Muq1MyFIQe1eaUwBLPUYlOT5qdua4cN7Bav2j02tKmatsn9QA/output_0.png",
"https://replicate.delivery/pbxt/sbkup0xqGOIvMhiXeG2gyYmO6lDkFzfMuQKL6uYQK2yusn9QA/output_1.png"
],
"started_at": "2023-05-20T13:20:40.643618Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/csdputeejzhjlewkn66avojfn4",
"cancel": "https://api.replicate.com/v1/predictions/csdputeejzhjlewkn66avojfn4/cancel"
},
"version": "7fbf4c86671738f97896c9cb4922705adfcdcf54a6edab193bb8c176c6b34a69"
}
Global seed set to 294930
Data shape for DDIM sampling is (1, 4, 64, 96), eta 0.0
Running DDIM Sampling with 10 timesteps
DDIM Sampler: 0%| | 0/10 [00:00<?, ?it/s]
DDIM Sampler: 10%|█ | 1/10 [00:00<00:02, 3.38it/s]
DDIM Sampler: 20%|██ | 2/10 [00:00<00:02, 3.59it/s]
DDIM Sampler: 30%|███ | 3/10 [00:00<00:01, 3.66it/s]
DDIM Sampler: 40%|████ | 4/10 [00:01<00:01, 3.69it/s]
DDIM Sampler: 50%|█████ | 5/10 [00:01<00:01, 3.71it/s]
DDIM Sampler: 60%|██████ | 6/10 [00:01<00:01, 3.72it/s]
DDIM Sampler: 70%|███████ | 7/10 [00:01<00:00, 3.73it/s]
DDIM Sampler: 80%|████████ | 8/10 [00:02<00:00, 3.74it/s]
DDIM Sampler: 90%|█████████ | 9/10 [00:02<00:00, 3.74it/s]
DDIM Sampler: 100%|██████████| 10/10 [00:02<00:00, 3.74it/s]
DDIM Sampler: 100%|██████████| 10/10 [00:02<00:00, 3.71it/s]