defaultAn astronaut riding a rainbow unicorn
typetext
{
"auto_generate_caption": true,
"condition_scale": 0.5,
"generated_caption_weight": 0.1,
"guidance_scale": 7.5,
"image": "https://replicate.delivery/pbxt/JiOTMCHj4oGrTTf8Pg2r7vyI8YdXc5jL2IDyC2SfhuggjYe6/out-0%20%281%29.png",
"img2img": true,
"ip_adapter_scale": 0.1,
"lora_scale": 0.95,
"negative_prompt": "worst quality, photorealistic ",
"num_inference_steps": 15,
"num_outputs": 1,
"prompt": "An astronaut riding a rainbow unicorn, In the style of oil painting",
"scheduler": "KarrasDPM",
"strength": 1
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_78D**********************************
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 pnyompen/sd-controlnet-lora using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"pnyompen/sd-controlnet-lora:45f27d985ae0409c990d1c23cbb9656f3ef8ed826078dd606b3af243e09d6244",
{
input: {
auto_generate_caption: true,
condition_scale: 0.5,
generated_caption_weight: 0.1,
guidance_scale: 7.5,
image: "https://replicate.delivery/pbxt/JiOTMCHj4oGrTTf8Pg2r7vyI8YdXc5jL2IDyC2SfhuggjYe6/out-0%20%281%29.png",
img2img: true,
ip_adapter_scale: 0.1,
lora_scale: 0.95,
negative_prompt: "worst quality, photorealistic ",
num_inference_steps: 15,
num_outputs: 1,
prompt: "An astronaut riding a rainbow unicorn, In the style of oil painting",
scheduler: "KarrasDPM",
strength: 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_78D**********************************
This is your API token. Keep it to yourself.
import replicate
Run pnyompen/sd-controlnet-lora using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"pnyompen/sd-controlnet-lora:45f27d985ae0409c990d1c23cbb9656f3ef8ed826078dd606b3af243e09d6244",
input={
"auto_generate_caption": True,
"condition_scale": 0.5,
"generated_caption_weight": 0.1,
"guidance_scale": 7.5,
"image": "https://replicate.delivery/pbxt/JiOTMCHj4oGrTTf8Pg2r7vyI8YdXc5jL2IDyC2SfhuggjYe6/out-0%20%281%29.png",
"img2img": True,
"ip_adapter_scale": 0.1,
"lora_scale": 0.95,
"negative_prompt": "worst quality, photorealistic ",
"num_inference_steps": 15,
"num_outputs": 1,
"prompt": "An astronaut riding a rainbow unicorn, In the style of oil painting",
"scheduler": "KarrasDPM",
"strength": 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_78D**********************************
This is your API token. Keep it to yourself.
Run pnyompen/sd-controlnet-lora 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": "pnyompen/sd-controlnet-lora:45f27d985ae0409c990d1c23cbb9656f3ef8ed826078dd606b3af243e09d6244",
"input": {
"auto_generate_caption": true,
"condition_scale": 0.5,
"generated_caption_weight": 0.1,
"guidance_scale": 7.5,
"image": "https://replicate.delivery/pbxt/JiOTMCHj4oGrTTf8Pg2r7vyI8YdXc5jL2IDyC2SfhuggjYe6/out-0%20%281%29.png",
"img2img": true,
"ip_adapter_scale": 0.1,
"lora_scale": 0.95,
"negative_prompt": "worst quality, photorealistic ",
"num_inference_steps": 15,
"num_outputs": 1,
"prompt": "An astronaut riding a rainbow unicorn, In the style of oil painting",
"scheduler": "KarrasDPM",
"strength": 1
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "nsqe78gr5srge0cgw6k8pbv89g",
"model": "pnyompen/sd-controlnet-lora",
"version": "45f27d985ae0409c990d1c23cbb9656f3ef8ed826078dd606b3af243e09d6244",
"input": {
"auto_generate_caption": true,
"condition_scale": 0.5,
"generated_caption_weight": 0.1,
"guidance_scale": 7.5,
"image": "https://replicate.delivery/pbxt/JiOTMCHj4oGrTTf8Pg2r7vyI8YdXc5jL2IDyC2SfhuggjYe6/out-0%20%281%29.png",
"img2img": true,
"ip_adapter_scale": 0.1,
"lora_scale": 0.95,
"negative_prompt": "worst quality, photorealistic ",
"num_inference_steps": 15,
"num_outputs": 1,
"prompt": "An astronaut riding a rainbow unicorn, In the style of oil painting",
"scheduler": "KarrasDPM",
"strength": 1
},
"logs": "Using seed: 60585\nOriginal width:1024, height:1024\nAspect Ratio: 1.00\nnew_width:512, new_height:512\nauto_generate_caption mode\nGenerating captions\nGenerated captions ['portrait of a beautiful young woman in a city street']\nGenerating captions took: 0.4332544803619385\nPrompt: (\"An astronaut riding a rainbow unicorn, In the style of oil painting\", \"portrait of a beautiful young woman in a city street\").blend(1, 0.1)\nimg2img mode\n 0%| | 0/15 [00:00<?, ?it/s]\n 7%|▋ | 1/15 [00:00<00:01, 9.49it/s]\n 13%|█▎ | 2/15 [00:00<00:02, 6.12it/s]\n 20%|██ | 3/15 [00:00<00:02, 5.51it/s]\n 27%|██▋ | 4/15 [00:00<00:02, 5.29it/s]\n 33%|███▎ | 5/15 [00:00<00:01, 5.05it/s]\n 40%|████ | 6/15 [00:01<00:01, 4.93it/s]\n 47%|████▋ | 7/15 [00:01<00:01, 4.90it/s]\n 53%|█████▎ | 8/15 [00:01<00:01, 4.88it/s]\n 60%|██████ | 9/15 [00:01<00:01, 4.86it/s]\n 67%|██████▋ | 10/15 [00:01<00:01, 4.85it/s]\n 73%|███████▎ | 11/15 [00:02<00:00, 4.85it/s]\n 80%|████████ | 12/15 [00:02<00:00, 4.81it/s]\n 87%|████████▋ | 13/15 [00:02<00:00, 4.81it/s]\n 93%|█████████▎| 14/15 [00:02<00:00, 4.80it/s]\n100%|██████████| 15/15 [00:03<00:00, 4.81it/s]\n100%|██████████| 15/15 [00:03<00:00, 4.98it/s]",
"output": [
"https://replicate.delivery/czjl/mdTFmveZmU1LN6ryofjfQgTsS9YQ4zqh02UInvXlJ9jUk7WmA/out-0.png"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-07-23T22:11:17.166Z",
"started_at": "2024-07-23T22:11:17.188984Z",
"completed_at": "2024-07-23T22:11:22.266318Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/nsqe78gr5srge0cgw6k8pbv89g/cancel",
"get": "https://api.replicate.com/v1/predictions/nsqe78gr5srge0cgw6k8pbv89g",
"web": "https://replicate.com/p/nsqe78gr5srge0cgw6k8pbv89g"
},
"metrics": {
"predict_time": 5.077333746,
"total_time": 5.100318
}
}
