typefile
{
"adapter_mode": "original",
"block_mode": "style-only",
"enable_negative_content": false,
"guidance_scale": 5,
"height": 1024,
"negative_content_strength": 0.5,
"num_inference_steps": 30,
"num_outputs": 1,
"prompt": "A dog",
"style_image": "https://replicate.delivery/pbxt/KgoIir7Dz5vLdvy1ZOspa1dVI8L6FldaTuGH4d2QYDx1NGjl/0.jpg",
"style_strength": 1,
"width": 1024
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_BZQ**********************************
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 jyoung105/instant-style using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"jyoung105/instant-style:a11eb1cb58caf320176953852871ac4882c49baeb88893cd1eacfcd91cd71769",
{
input: {
adapter_mode: "original",
block_mode: "style-only",
enable_negative_content: false,
guidance_scale: 5,
height: 1024,
negative_content_strength: 0.5,
num_inference_steps: 30,
num_outputs: 1,
prompt: "A dog",
style_image: "https://replicate.delivery/pbxt/KgoIir7Dz5vLdvy1ZOspa1dVI8L6FldaTuGH4d2QYDx1NGjl/0.jpg",
style_strength: 1,
width: 1024
}
}
);
// 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_BZQ**********************************
This is your API token. Keep it to yourself.
import replicate
Run jyoung105/instant-style using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"jyoung105/instant-style:a11eb1cb58caf320176953852871ac4882c49baeb88893cd1eacfcd91cd71769",
input={
"adapter_mode": "original",
"block_mode": "style-only",
"enable_negative_content": False,
"guidance_scale": 5,
"height": 1024,
"negative_content_strength": 0.5,
"num_inference_steps": 30,
"num_outputs": 1,
"prompt": "A dog",
"style_image": "https://replicate.delivery/pbxt/KgoIir7Dz5vLdvy1ZOspa1dVI8L6FldaTuGH4d2QYDx1NGjl/0.jpg",
"style_strength": 1,
"width": 1024
}
)
# 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_BZQ**********************************
This is your API token. Keep it to yourself.
Run jyoung105/instant-style 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": "jyoung105/instant-style:a11eb1cb58caf320176953852871ac4882c49baeb88893cd1eacfcd91cd71769",
"input": {
"adapter_mode": "original",
"block_mode": "style-only",
"enable_negative_content": false,
"guidance_scale": 5,
"height": 1024,
"negative_content_strength": 0.5,
"num_inference_steps": 30,
"num_outputs": 1,
"prompt": "A dog",
"style_image": "https://replicate.delivery/pbxt/KgoIir7Dz5vLdvy1ZOspa1dVI8L6FldaTuGH4d2QYDx1NGjl/0.jpg",
"style_strength": 1,
"width": 1024
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "sd42yq7049rgg0ceq79995gf3g",
"model": "jyoung105/instant-style",
"version": "a11eb1cb58caf320176953852871ac4882c49baeb88893cd1eacfcd91cd71769",
"input": {
"adapter_mode": "original",
"block_mode": "style-only",
"enable_negative_content": false,
"guidance_scale": 5,
"height": 1024,
"negative_content_strength": 0.5,
"num_inference_steps": 30,
"num_outputs": 1,
"prompt": "A dog",
"style_image": "https://replicate.delivery/pbxt/KgoIir7Dz5vLdvy1ZOspa1dVI8L6FldaTuGH4d2QYDx1NGjl/0.jpg",
"style_strength": 1,
"width": 1024
},
"logs": "Using seed: 21469\nDEVICE: cuda\nDTYPE: torch.float16\nStart inference...\n[Debug] Prompt: A dog, best quality, high detail, sharp focus,\n[Debug] Neg Prompt: text, watermark, lowres, low quality, worst quality, deformed, glitch, low contrast, noisy, saturation, blurry,\n 0%| | 0/30 [00:00<?, ?it/s]\n 3%|▎ | 1/30 [00:00<00:07, 4.03it/s]\n 7%|▋ | 2/30 [00:00<00:04, 5.93it/s]\n 10%|█ | 3/30 [00:00<00:04, 5.51it/s]\n 13%|█▎ | 4/30 [00:00<00:04, 5.33it/s]\n 17%|█▋ | 5/30 [00:00<00:04, 5.22it/s]\n 20%|██ | 6/30 [00:01<00:04, 5.14it/s]\n 23%|██▎ | 7/30 [00:01<00:04, 5.11it/s]\n 27%|██▋ | 8/30 [00:01<00:04, 5.09it/s]\n 30%|███ | 9/30 [00:01<00:04, 5.08it/s]\n 33%|███▎ | 10/30 [00:01<00:03, 5.07it/s]\n 37%|███▋ | 11/30 [00:02<00:03, 5.06it/s]\n 40%|████ | 12/30 [00:02<00:03, 5.04it/s]\n 43%|████▎ | 13/30 [00:02<00:03, 5.03it/s]\n 47%|████▋ | 14/30 [00:02<00:03, 5.05it/s]\n 50%|█████ | 15/30 [00:02<00:02, 5.05it/s]\n 53%|█████▎ | 16/30 [00:03<00:02, 5.04it/s]\n 57%|█████▋ | 17/30 [00:03<00:02, 5.03it/s]\n 60%|██████ | 18/30 [00:03<00:02, 5.03it/s]\n 63%|██████▎ | 19/30 [00:03<00:02, 5.03it/s]\n 67%|██████▋ | 20/30 [00:03<00:01, 5.04it/s]\n 70%|███████ | 21/30 [00:04<00:01, 5.03it/s]\n 73%|███████▎ | 22/30 [00:04<00:01, 5.02it/s]\n 77%|███████▋ | 23/30 [00:04<00:01, 5.02it/s]\n 80%|████████ | 24/30 [00:04<00:01, 5.02it/s]\n 83%|████████▎ | 25/30 [00:04<00:00, 5.01it/s]\n 87%|████████▋ | 26/30 [00:05<00:00, 5.03it/s]\n 90%|█████████ | 27/30 [00:05<00:00, 5.02it/s]\n 93%|█████████▎| 28/30 [00:05<00:00, 5.02it/s]\n 97%|█████████▋| 29/30 [00:05<00:00, 5.02it/s]\n100%|██████████| 30/30 [00:05<00:00, 5.03it/s]\n100%|██████████| 30/30 [00:05<00:00, 5.06it/s]\nFinish generation in 6.64692759513855 secs.",
"output": [
"https://replicate.delivery/pbxt/FzfZtZfRRUnQgU78LexGzwyH59WDlQ33zRQXUrgnQXgbGTQlA/out_0.png"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-04-07T18:29:48.706Z",
"started_at": "2024-04-07T18:32:29.371695Z",
"completed_at": "2024-04-07T18:32:47.332133Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/sd42yq7049rgg0ceq79995gf3g/cancel",
"get": "https://api.replicate.com/v1/predictions/sd42yq7049rgg0ceq79995gf3g",
"web": "https://replicate.com/p/sd42yq7049rgg0ceq79995gf3g"
},
"metrics": {
"predict_time": 17.960438,
"total_time": 178.626133
}
}
