typetext
{
"clip_skip": 0,
"eta": 0,
"guidance_scale": 3,
"height": 1024,
"num_images": 1,
"prompt": "A man with hoodie on, illustration",
"steps": 25,
"width": 1024
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_ENX**********************************
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/playground-v2.5 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"jyoung105/playground-v2.5:5fda98020af104f265d61b52bfb5ce4b2e3987e3d94cb61a6997bf009454fddf",
{
input: {
clip_skip: 0,
eta: 0,
guidance_scale: 3,
height: 1024,
num_images: 1,
prompt: "A man with hoodie on, illustration",
steps: 25,
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_ENX**********************************
This is your API token. Keep it to yourself.
import replicate
Run jyoung105/playground-v2.5 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"jyoung105/playground-v2.5:5fda98020af104f265d61b52bfb5ce4b2e3987e3d94cb61a6997bf009454fddf",
input={
"clip_skip": 0,
"eta": 0,
"guidance_scale": 3,
"height": 1024,
"num_images": 1,
"prompt": "A man with hoodie on, illustration",
"steps": 25,
"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_ENX**********************************
This is your API token. Keep it to yourself.
Run jyoung105/playground-v2.5 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/playground-v2.5:5fda98020af104f265d61b52bfb5ce4b2e3987e3d94cb61a6997bf009454fddf",
"input": {
"clip_skip": 0,
"eta": 0,
"guidance_scale": 3,
"height": 1024,
"num_images": 1,
"prompt": "A man with hoodie on, illustration",
"steps": 25,
"width": 1024
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "0njdga6cexrgp0ck8c0r47xk4w",
"model": "jyoung105/playground-v2.5",
"version": "5fda98020af104f265d61b52bfb5ce4b2e3987e3d94cb61a6997bf009454fddf",
"input": {
"clip_skip": 0,
"eta": 0,
"guidance_scale": 3,
"height": 1024,
"num_images": 1,
"prompt": "A man with hoodie on, illustration",
"steps": 25,
"width": 1024
},
"logs": "[Debug] DEVICE: cuda\n[Debug] DTYPE: torch.float16\nSetup completed in 0.00 seconds.\n[~] Generating images...\n[Debug] Prompt: A man with hoodie on, illustration, best quality, high detail, sharp focus\n[Debug] Seed: 53071\n 0%| | 0/25 [00:00<?, ?it/s]\n 4%|▍ | 1/25 [00:01<00:31, 1.30s/it]\n 12%|█▏ | 3/25 [00:01<00:09, 2.29it/s]\n 16%|█▌ | 4/25 [00:01<00:07, 2.84it/s]\n 20%|██ | 5/25 [00:01<00:05, 3.35it/s]\n 24%|██▍ | 6/25 [00:02<00:05, 3.79it/s]\n 28%|██▊ | 7/25 [00:02<00:04, 4.12it/s]\n 32%|███▏ | 8/25 [00:02<00:03, 4.41it/s]\n 36%|███▌ | 9/25 [00:02<00:03, 4.63it/s]\n 40%|████ | 10/25 [00:02<00:03, 4.80it/s]\n 44%|████▍ | 11/25 [00:03<00:02, 4.92it/s]\n 48%|████▊ | 12/25 [00:03<00:02, 4.98it/s]\n 52%|█████▏ | 13/25 [00:03<00:02, 5.05it/s]\n 56%|█████▌ | 14/25 [00:03<00:02, 5.09it/s]\n 60%|██████ | 15/25 [00:03<00:01, 5.13it/s]\n 64%|██████▍ | 16/25 [00:04<00:01, 5.15it/s]\n 68%|██████▊ | 17/25 [00:04<00:01, 5.16it/s]\n 72%|███████▏ | 18/25 [00:04<00:01, 5.17it/s]\n 76%|███████▌ | 19/25 [00:04<00:01, 5.18it/s]\n 80%|████████ | 20/25 [00:04<00:00, 5.18it/s]\n 84%|████████▍ | 21/25 [00:05<00:00, 5.19it/s]\n 88%|████████▊ | 22/25 [00:05<00:00, 5.18it/s]\n 92%|█████████▏| 23/25 [00:05<00:00, 5.18it/s]\n 96%|█████████▌| 24/25 [00:05<00:00, 5.18it/s]\n100%|██████████| 25/25 [00:05<00:00, 5.19it/s]\n100%|██████████| 25/25 [00:05<00:00, 4.31it/s]\nImage generation completed in 7.10 seconds.",
"output": [
"https://replicate.delivery/pbxt/fMnI1LfuKnnPJUAyVaaiffN6PbfesZMSFVdPiMH6GZ6IHcn8E/out_0.png"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-11-19T06:00:11.639Z",
"started_at": "2024-11-19T06:03:00.938116Z",
"completed_at": "2024-11-19T06:03:09.809417Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/0njdga6cexrgp0ck8c0r47xk4w/cancel",
"get": "https://api.replicate.com/v1/predictions/0njdga6cexrgp0ck8c0r47xk4w",
"web": "https://replicate.com/p/0njdga6cexrgp0ck8c0r47xk4w"
},
"metrics": {
"predict_time": 8.871300686,
"total_time": 178.170417
}
}