You're looking at a specific version of this model. Jump to the model overview.
yuni-eng /controlnet-sdxl:2498ccab
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";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run yuni-eng/controlnet-sdxl using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"yuni-eng/controlnet-sdxl:2498ccabddb11f5731d3335c8437e8d460f7c5042c6a5801cec5c41636c96565",
{
input: {
seed: 0,
width: 768,
height: 768,
prompt: "Choose art medium to generate in that style. For example: a photo of, a acrylic paint of, an anime drawing of, a caricature of, a cartoon of, a drawing of, a graphitti of, an illustration of, a line art of, an oil painting of, a pencil sketch of",
num_outputs: 1,
guidance_scale: 7.5,
negative_prompt: "poorly drawn hands, poorly drawn feet, poorly drawn face, out of frame, extra limbs, disfigured, deformed, body out of frame, bad anatomy, signature, cut off, low contrast, underexposed, overexposed, bad art, beginner, amateur, distorted face, blurry, draft, grainy",
num_inference_steps: 100
}
}
);
// 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 yuni-eng/controlnet-sdxl using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"yuni-eng/controlnet-sdxl:2498ccabddb11f5731d3335c8437e8d460f7c5042c6a5801cec5c41636c96565",
input={
"seed": 0,
"width": 768,
"height": 768,
"prompt": "Choose art medium to generate in that style. For example: a photo of, a acrylic paint of, an anime drawing of, a caricature of, a cartoon of, a drawing of, a graphitti of, an illustration of, a line art of, an oil painting of, a pencil sketch of",
"num_outputs": 1,
"guidance_scale": 7.5,
"negative_prompt": "poorly drawn hands, poorly drawn feet, poorly drawn face, out of frame, extra limbs, disfigured, deformed, body out of frame, bad anatomy, signature, cut off, low contrast, underexposed, overexposed, bad art, beginner, amateur, distorted face, blurry, draft, grainy",
"num_inference_steps": 100
}
)
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 yuni-eng/controlnet-sdxl 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": "yuni-eng/controlnet-sdxl:2498ccabddb11f5731d3335c8437e8d460f7c5042c6a5801cec5c41636c96565",
"input": {
"seed": 0,
"width": 768,
"height": 768,
"prompt": "Choose art medium to generate in that style. For example: a photo of, a acrylic paint of, an anime drawing of, a caricature of, a cartoon of, a drawing of, a graphitti of, an illustration of, a line art of, an oil painting of, a pencil sketch of",
"num_outputs": 1,
"guidance_scale": 7.5,
"negative_prompt": "poorly drawn hands, poorly drawn feet, poorly drawn face, out of frame, extra limbs, disfigured, deformed, body out of frame, bad anatomy, signature, cut off, low contrast, underexposed, overexposed, bad art, beginner, amateur, distorted face, blurry, draft, grainy",
"num_inference_steps": 100
}
}' \
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
No output yet! Press "Submit" to start a prediction.