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/IrAKyJh7d56Kgn0VDusM3BT5ZNOpWjKXwIHl8PB1CGD6gTnd/65b60fbebae5db9ea4b586d9b2d155ac.jpg",
scale: 5.76,
prompt: "underwater room",
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: 20,
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/IrAKyJh7d56Kgn0VDusM3BT5ZNOpWjKXwIHl8PB1CGD6gTnd/65b60fbebae5db9ea4b586d9b2d155ac.jpg",
"scale": 5.76,
"prompt": "underwater room",
"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": 20,
"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/IrAKyJh7d56Kgn0VDusM3BT5ZNOpWjKXwIHl8PB1CGD6gTnd/65b60fbebae5db9ea4b586d9b2d155ac.jpg",
"scale": 5.76,
"prompt": "underwater room",
"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": 20,
"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:02:18.969247Z",
"created_at": "2023-05-20T12:52:28.830209Z",
"data_removed": false,
"error": null,
"id": "whgulqsfu5fojooawaoskdqj44",
"input": {
"image": "https://replicate.delivery/pbxt/IrAKyJh7d56Kgn0VDusM3BT5ZNOpWjKXwIHl8PB1CGD6gTnd/65b60fbebae5db9ea4b586d9b2d155ac.jpg",
"scale": 5.76,
"prompt": "underwater room",
"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": 20,
"num_samples": "1",
"preprocessor": "Lineart",
"image_resolution": "512",
"preprocessor_resolution": 512
},
"logs": "Global seed set to 731025\nData shape for DDIM sampling is (1, 4, 64, 80), eta 0.0\nRunning DDIM Sampling with 20 timesteps\nDDIM Sampler: 0%| | 0/20 [00:00<?, ?it/s]\nDDIM Sampler: 5%|▌ | 1/20 [00:01<00:20, 1.06s/it]\nDDIM Sampler: 10%|█ | 2/20 [00:02<00:18, 1.02s/it]\nDDIM Sampler: 15%|█▌ | 3/20 [00:03<00:17, 1.01s/it]\nDDIM Sampler: 20%|██ | 4/20 [00:04<00:16, 1.01s/it]\nDDIM Sampler: 25%|██▌ | 5/20 [00:05<00:15, 1.01s/it]\nDDIM Sampler: 30%|███ | 6/20 [00:06<00:14, 1.00s/it]\nDDIM Sampler: 35%|███▌ | 7/20 [00:07<00:13, 1.01s/it]\nDDIM Sampler: 40%|████ | 8/20 [00:08<00:12, 1.01s/it]\nDDIM Sampler: 45%|████▌ | 9/20 [00:09<00:11, 1.01s/it]\nDDIM Sampler: 50%|█████ | 10/20 [00:10<00:10, 1.01s/it]\nDDIM Sampler: 55%|█████▌ | 11/20 [00:11<00:09, 1.01s/it]\nDDIM Sampler: 60%|██████ | 12/20 [00:12<00:08, 1.01s/it]\nDDIM Sampler: 65%|██████▌ | 13/20 [00:13<00:07, 1.02s/it]\nDDIM Sampler: 70%|███████ | 14/20 [00:14<00:06, 1.02s/it]\nDDIM Sampler: 75%|███████▌ | 15/20 [00:15<00:05, 1.02s/it]\nDDIM Sampler: 80%|████████ | 16/20 [00:16<00:04, 1.01s/it]\nDDIM Sampler: 85%|████████▌ | 17/20 [00:17<00:03, 1.02s/it]\nDDIM Sampler: 90%|█████████ | 18/20 [00:18<00:02, 1.02s/it]\nDDIM Sampler: 95%|█████████▌| 19/20 [00:19<00:01, 1.02s/it]\nDDIM Sampler: 100%|██████████| 20/20 [00:20<00:00, 1.02s/it]\nDDIM Sampler: 100%|██████████| 20/20 [00:20<00:00, 1.02s/it]",
"metrics": {
"predict_time": 32.90709,
"total_time": 590.139038
},
"output": [
"https://replicate.delivery/pbxt/LeOVrRM0rm24BC7LZocOOYsF70YL8Hc7vW1HCtYKAw0stzeQA/output_0.png",
"https://replicate.delivery/pbxt/LMr0UAn55UI6MRdgdwRqxehpV7f3XQsIe66EwDN6jHS12O7hA/output_1.png"
],
"started_at": "2023-05-20T13:01:46.062157Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/whgulqsfu5fojooawaoskdqj44",
"cancel": "https://api.replicate.com/v1/predictions/whgulqsfu5fojooawaoskdqj44/cancel"
},
"version": "7fbf4c86671738f97896c9cb4922705adfcdcf54a6edab193bb8c176c6b34a69"
}
Global seed set to 731025
Data shape for DDIM sampling is (1, 4, 64, 80), eta 0.0
Running DDIM Sampling with 20 timesteps
DDIM Sampler: 0%| | 0/20 [00:00<?, ?it/s]
DDIM Sampler: 5%|▌ | 1/20 [00:01<00:20, 1.06s/it]
DDIM Sampler: 10%|█ | 2/20 [00:02<00:18, 1.02s/it]
DDIM Sampler: 15%|█▌ | 3/20 [00:03<00:17, 1.01s/it]
DDIM Sampler: 20%|██ | 4/20 [00:04<00:16, 1.01s/it]
DDIM Sampler: 25%|██▌ | 5/20 [00:05<00:15, 1.01s/it]
DDIM Sampler: 30%|███ | 6/20 [00:06<00:14, 1.00s/it]
DDIM Sampler: 35%|███▌ | 7/20 [00:07<00:13, 1.01s/it]
DDIM Sampler: 40%|████ | 8/20 [00:08<00:12, 1.01s/it]
DDIM Sampler: 45%|████▌ | 9/20 [00:09<00:11, 1.01s/it]
DDIM Sampler: 50%|█████ | 10/20 [00:10<00:10, 1.01s/it]
DDIM Sampler: 55%|█████▌ | 11/20 [00:11<00:09, 1.01s/it]
DDIM Sampler: 60%|██████ | 12/20 [00:12<00:08, 1.01s/it]
DDIM Sampler: 65%|██████▌ | 13/20 [00:13<00:07, 1.02s/it]
DDIM Sampler: 70%|███████ | 14/20 [00:14<00:06, 1.02s/it]
DDIM Sampler: 75%|███████▌ | 15/20 [00:15<00:05, 1.02s/it]
DDIM Sampler: 80%|████████ | 16/20 [00:16<00:04, 1.01s/it]
DDIM Sampler: 85%|████████▌ | 17/20 [00:17<00:03, 1.02s/it]
DDIM Sampler: 90%|█████████ | 18/20 [00:18<00:02, 1.02s/it]
DDIM Sampler: 95%|█████████▌| 19/20 [00:19<00:01, 1.02s/it]
DDIM Sampler: 100%|██████████| 20/20 [00:20<00:00, 1.02s/it]
DDIM Sampler: 100%|██████████| 20/20 [00:20<00:00, 1.02s/it]