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:542a2f6729906f610b5a0656b4061b6f792f3044f1b86eca7ce7dee3258f025b",
{
input: {
eta: 0,
image: "https://replicate.delivery/pbxt/IrAdCMSMtw7yHM5RJNl2SQWPfpQIZx5Yog2fV29wB7xpEbyO/ceb71f061de43744a245456771d6f95d.jpg",
scale: 5.76,
prompt: "underwater kingdom",
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:542a2f6729906f610b5a0656b4061b6f792f3044f1b86eca7ce7dee3258f025b",
input={
"eta": 0,
"image": "https://replicate.delivery/pbxt/IrAdCMSMtw7yHM5RJNl2SQWPfpQIZx5Yog2fV29wB7xpEbyO/ceb71f061de43744a245456771d6f95d.jpg",
"scale": 5.76,
"prompt": "underwater kingdom",
"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:542a2f6729906f610b5a0656b4061b6f792f3044f1b86eca7ce7dee3258f025b",
"input": {
"eta": 0,
"image": "https://replicate.delivery/pbxt/IrAdCMSMtw7yHM5RJNl2SQWPfpQIZx5Yog2fV29wB7xpEbyO/ceb71f061de43744a245456771d6f95d.jpg",
"scale": 5.76,
"prompt": "underwater kingdom",
"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-31T12:52:23.964781Z",
"created_at": "2023-05-31T12:50:12.491286Z",
"data_removed": false,
"error": null,
"id": "rp4lvtjervesfhepem3jinav7y",
"input": {
"image": "https://replicate.delivery/pbxt/IrAdCMSMtw7yHM5RJNl2SQWPfpQIZx5Yog2fV29wB7xpEbyO/ceb71f061de43744a245456771d6f95d.jpg",
"scale": 5.76,
"prompt": "underwater kingdom",
"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 422866\nData shape for DDIM sampling is (1, 4, 64, 56), 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:01, 5.66it/s]\nDDIM Sampler: 20%|██ | 2/10 [00:00<00:01, 6.12it/s]\nDDIM Sampler: 30%|███ | 3/10 [00:00<00:01, 6.28it/s]\nDDIM Sampler: 40%|████ | 4/10 [00:00<00:00, 6.47it/s]\nDDIM Sampler: 50%|█████ | 5/10 [00:00<00:00, 6.57it/s]\nDDIM Sampler: 60%|██████ | 6/10 [00:00<00:00, 6.62it/s]\nDDIM Sampler: 70%|███████ | 7/10 [00:01<00:00, 6.63it/s]\nDDIM Sampler: 80%|████████ | 8/10 [00:01<00:00, 6.51it/s]\nDDIM Sampler: 90%|█████████ | 9/10 [00:01<00:00, 6.56it/s]\nDDIM Sampler: 100%|██████████| 10/10 [00:01<00:00, 6.72it/s]\nDDIM Sampler: 100%|██████████| 10/10 [00:01<00:00, 6.54it/s]",
"metrics": {
"predict_time": 4.951756,
"total_time": 131.473495
},
"output": [
"https://replicate.delivery/pbxt/lCumeg6SHftNvkNhoPi5YnTKfuziMUHWi3YZawPpE6IPoeEEB/output_0.png",
"https://replicate.delivery/pbxt/TksbCGtukwZ7BF4rAEe88PSTz3YGxHStKuN8fouoHU6HUPBRA/output_1.png"
],
"started_at": "2023-05-31T12:52:19.013025Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/rp4lvtjervesfhepem3jinav7y",
"cancel": "https://api.replicate.com/v1/predictions/rp4lvtjervesfhepem3jinav7y/cancel"
},
"version": "542a2f6729906f610b5a0656b4061b6f792f3044f1b86eca7ce7dee3258f025b"
}
Global seed set to 422866
Data shape for DDIM sampling is (1, 4, 64, 56), 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:01, 5.66it/s]
DDIM Sampler: 20%|██ | 2/10 [00:00<00:01, 6.12it/s]
DDIM Sampler: 30%|███ | 3/10 [00:00<00:01, 6.28it/s]
DDIM Sampler: 40%|████ | 4/10 [00:00<00:00, 6.47it/s]
DDIM Sampler: 50%|█████ | 5/10 [00:00<00:00, 6.57it/s]
DDIM Sampler: 60%|██████ | 6/10 [00:00<00:00, 6.62it/s]
DDIM Sampler: 70%|███████ | 7/10 [00:01<00:00, 6.63it/s]
DDIM Sampler: 80%|████████ | 8/10 [00:01<00:00, 6.51it/s]
DDIM Sampler: 90%|█████████ | 9/10 [00:01<00:00, 6.56it/s]
DDIM Sampler: 100%|██████████| 10/10 [00:01<00:00, 6.72it/s]
DDIM Sampler: 100%|██████████| 10/10 [00:01<00:00, 6.54it/s]