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.
pnyompen /dreamshaper-controlnet:dd8762dc
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 pnyompen/dreamshaper-controlnet using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"pnyompen/dreamshaper-controlnet:dd8762dc2485e169c50f12f0a80acfd1e931bddcf67fac2bd17acd83793e02a1",
{
input: {
image: "https://replicate.delivery/pbxt/JiOTMCHj4oGrTTf8Pg2r7vyI8YdXc5jL2IDyC2SfhuggjYe6/out-0%20%281%29.png",
prompt: "In the style of rainbow unicorn painting",
img2img: true,
strength: 1,
remove_bg: true,
scheduler: "KarrasDPM",
lora_scale: 0.95,
num_outputs: 1,
guidance_scale: 7.5,
condition_scale: 0.5,
negative_prompt: "EasyNegative",
ip_adapter_scale: 0.1,
num_inference_steps: 15,
auto_generate_caption: true,
generated_caption_weight: 0.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=<paste-your-token-here>
Find your API token in your account settings.
import replicate
Run pnyompen/dreamshaper-controlnet using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"pnyompen/dreamshaper-controlnet:dd8762dc2485e169c50f12f0a80acfd1e931bddcf67fac2bd17acd83793e02a1",
input={
"image": "https://replicate.delivery/pbxt/JiOTMCHj4oGrTTf8Pg2r7vyI8YdXc5jL2IDyC2SfhuggjYe6/out-0%20%281%29.png",
"prompt": "In the style of rainbow unicorn painting",
"img2img": True,
"strength": 1,
"remove_bg": True,
"scheduler": "KarrasDPM",
"lora_scale": 0.95,
"num_outputs": 1,
"guidance_scale": 7.5,
"condition_scale": 0.5,
"negative_prompt": "EasyNegative",
"ip_adapter_scale": 0.1,
"num_inference_steps": 15,
"auto_generate_caption": True,
"generated_caption_weight": 0.1
}
)
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 pnyompen/dreamshaper-controlnet 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/dreamshaper-controlnet:dd8762dc2485e169c50f12f0a80acfd1e931bddcf67fac2bd17acd83793e02a1",
"input": {
"image": "https://replicate.delivery/pbxt/JiOTMCHj4oGrTTf8Pg2r7vyI8YdXc5jL2IDyC2SfhuggjYe6/out-0%20%281%29.png",
"prompt": "In the style of rainbow unicorn painting",
"img2img": true,
"strength": 1,
"remove_bg": true,
"scheduler": "KarrasDPM",
"lora_scale": 0.95,
"num_outputs": 1,
"guidance_scale": 7.5,
"condition_scale": 0.5,
"negative_prompt": "EasyNegative",
"ip_adapter_scale": 0.1,
"num_inference_steps": 15,
"auto_generate_caption": true,
"generated_caption_weight": 0.1
}
}' \
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": "2024-08-29T22:27:22.767901Z",
"created_at": "2024-08-29T22:27:17.990000Z",
"data_removed": false,
"error": null,
"id": "k1mqx0gdcsrga0chm10bw53340",
"input": {
"image": "https://replicate.delivery/pbxt/JiOTMCHj4oGrTTf8Pg2r7vyI8YdXc5jL2IDyC2SfhuggjYe6/out-0%20%281%29.png",
"prompt": "In the style of rainbow unicorn painting",
"img2img": true,
"strength": 1,
"remove_bg": true,
"scheduler": "KarrasDPM",
"lora_scale": 0.95,
"num_outputs": 1,
"guidance_scale": 7.5,
"condition_scale": 0.5,
"negative_prompt": "EasyNegative",
"ip_adapter_scale": 0.1,
"num_inference_steps": 15,
"auto_generate_caption": true,
"generated_caption_weight": 0.1
},
"logs": "Using seed: 57174\nOriginal width:1024, height:1024\nAspect Ratio: 1.00\nnew_width:512, new_height:512\nRemoving background\n/src/is_net/api.py:35: UserWarning: `nn.functional.upsample` is deprecated. Use `nn.functional.interpolate` instead.\nim_tensor = F.upsample(torch.unsqueeze(\n/src/is_net/models/isnet.py:77: UserWarning: `nn.functional.upsample` is deprecated. Use `nn.functional.interpolate` instead.\nsrc = F.upsample(src,size=tar.shape[2:],mode='bilinear')\n/src/is_net/api.py:42: UserWarning: `nn.functional.upsample` is deprecated. Use `nn.functional.interpolate` instead.\nresult = torch.squeeze(F.upsample(\nauto_generate_caption mode\nGenerating captions\nGenerated captions ['she is standing with a long hair, wearing an orange and teal colored shirt']\nGenerating captions took: 0.4200553894042969\nPrompt: (\"In the style of rainbow unicorn painting\", \"she is standing with a long hair, wearing an orange and teal colored shirt\").blend(1, 0.1)\nimg2img mode\n 0%| | 0/15 [00:00<?, ?it/s]\n 13%|█▎ | 2/15 [00:00<00:01, 7.41it/s]\n 20%|██ | 3/15 [00:00<00:01, 6.31it/s]\n 27%|██▋ | 4/15 [00:00<00:01, 5.83it/s]\n 33%|███▎ | 5/15 [00:00<00:01, 5.56it/s]\n 40%|████ | 6/15 [00:01<00:01, 5.41it/s]\n 47%|████▋ | 7/15 [00:01<00:01, 5.33it/s]\n 53%|█████▎ | 8/15 [00:01<00:01, 5.31it/s]\n 60%|██████ | 9/15 [00:01<00:01, 5.26it/s]\n 67%|██████▋ | 10/15 [00:01<00:00, 5.24it/s]\n 73%|███████▎ | 11/15 [00:02<00:00, 5.20it/s]\n 80%|████████ | 12/15 [00:02<00:00, 5.19it/s]\n 87%|████████▋ | 13/15 [00:02<00:00, 5.18it/s]\n 93%|█████████▎| 14/15 [00:02<00:00, 5.17it/s]\n100%|██████████| 15/15 [00:02<00:00, 5.18it/s]\n100%|██████████| 15/15 [00:02<00:00, 5.39it/s]",
"metrics": {
"predict_time": 4.760366303,
"total_time": 4.777901
},
"output": [
"https://replicate.delivery/czjl/WZ6hWYsx5IKlMhuKaSSkk5JtzbgMQ3qMbXSTfIXrAcFlP1rJA/out-0.png",
"https://replicate.delivery/czjl/UaJqpX6SuvY6MlPKwsz48kkEKEAbGHkHj9GIQUQZ8Qhyn61E/out-0-mask.png"
],
"started_at": "2024-08-29T22:27:18.007535Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/k1mqx0gdcsrga0chm10bw53340",
"cancel": "https://api.replicate.com/v1/predictions/k1mqx0gdcsrga0chm10bw53340/cancel"
},
"version": "dd8762dc2485e169c50f12f0a80acfd1e931bddcf67fac2bd17acd83793e02a1"
}
Using seed: 57174
Original width:1024, height:1024
Aspect Ratio: 1.00
new_width:512, new_height:512
Removing background
/src/is_net/api.py:35: UserWarning: `nn.functional.upsample` is deprecated. Use `nn.functional.interpolate` instead.
im_tensor = F.upsample(torch.unsqueeze(
/src/is_net/models/isnet.py:77: UserWarning: `nn.functional.upsample` is deprecated. Use `nn.functional.interpolate` instead.
src = F.upsample(src,size=tar.shape[2:],mode='bilinear')
/src/is_net/api.py:42: UserWarning: `nn.functional.upsample` is deprecated. Use `nn.functional.interpolate` instead.
result = torch.squeeze(F.upsample(
auto_generate_caption mode
Generating captions
Generated captions ['she is standing with a long hair, wearing an orange and teal colored shirt']
Generating captions took: 0.4200553894042969
Prompt: ("In the style of rainbow unicorn painting", "she is standing with a long hair, wearing an orange and teal colored shirt").blend(1, 0.1)
img2img mode
0%| | 0/15 [00:00<?, ?it/s]
13%|█▎ | 2/15 [00:00<00:01, 7.41it/s]
20%|██ | 3/15 [00:00<00:01, 6.31it/s]
27%|██▋ | 4/15 [00:00<00:01, 5.83it/s]
33%|███▎ | 5/15 [00:00<00:01, 5.56it/s]
40%|████ | 6/15 [00:01<00:01, 5.41it/s]
47%|████▋ | 7/15 [00:01<00:01, 5.33it/s]
53%|█████▎ | 8/15 [00:01<00:01, 5.31it/s]
60%|██████ | 9/15 [00:01<00:01, 5.26it/s]
67%|██████▋ | 10/15 [00:01<00:00, 5.24it/s]
73%|███████▎ | 11/15 [00:02<00:00, 5.20it/s]
80%|████████ | 12/15 [00:02<00:00, 5.19it/s]
87%|████████▋ | 13/15 [00:02<00:00, 5.18it/s]
93%|█████████▎| 14/15 [00:02<00:00, 5.17it/s]
100%|██████████| 15/15 [00:02<00:00, 5.18it/s]
100%|██████████| 15/15 [00:02<00:00, 5.39it/s]