typefile
{
"image": "https://replicate.delivery/pbxt/JfcQVKRWgew5Rzpti9VyJyG4Dfa6JfPx3xIV1wGBH6UVLbLs/pCrb5DS.jpg",
"image_guidance_scale": 1.5,
"instruction": "Detect Berkeley's Sather tower.",
"text_guidance_scale": 7.5
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Auf**********************************
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 cjwbw/instructcv using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"cjwbw/instructcv:38123d3d9aea7dc19796bcac6dae9667229247a8d39805fb71219e0d0a0b00e6",
{
input: {
image: "https://replicate.delivery/pbxt/JfcQVKRWgew5Rzpti9VyJyG4Dfa6JfPx3xIV1wGBH6UVLbLs/pCrb5DS.jpg",
image_guidance_scale: 1.5,
instruction: "Detect Berkeley's Sather tower.",
text_guidance_scale: 7.5
}
}
);
// To access the file URL:
console.log(output.url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", output);
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_Auf**********************************
This is your API token. Keep it to yourself.
import replicate
Run cjwbw/instructcv using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"cjwbw/instructcv:38123d3d9aea7dc19796bcac6dae9667229247a8d39805fb71219e0d0a0b00e6",
input={
"image": "https://replicate.delivery/pbxt/JfcQVKRWgew5Rzpti9VyJyG4Dfa6JfPx3xIV1wGBH6UVLbLs/pCrb5DS.jpg",
"image_guidance_scale": 1.5,
"instruction": "Detect Berkeley's Sather tower.",
"text_guidance_scale": 7.5
}
)
# To access the file URL:
print(output.url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output.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_Auf**********************************
This is your API token. Keep it to yourself.
Run cjwbw/instructcv 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": "cjwbw/instructcv:38123d3d9aea7dc19796bcac6dae9667229247a8d39805fb71219e0d0a0b00e6",
"input": {
"image": "https://replicate.delivery/pbxt/JfcQVKRWgew5Rzpti9VyJyG4Dfa6JfPx3xIV1wGBH6UVLbLs/pCrb5DS.jpg",
"image_guidance_scale": 1.5,
"instruction": "Detect Berkeley\'s Sather tower.",
"text_guidance_scale": 7.5
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "4io4o3dbkmossdei7vqlkn4vha",
"model": "cjwbw/instructcv",
"version": "38123d3d9aea7dc19796bcac6dae9667229247a8d39805fb71219e0d0a0b00e6",
"input": {
"image": "https://replicate.delivery/pbxt/JfcQVKRWgew5Rzpti9VyJyG4Dfa6JfPx3xIV1wGBH6UVLbLs/pCrb5DS.jpg",
"image_guidance_scale": 1.5,
"instruction": "Detect Berkeley's Sather tower.",
"text_guidance_scale": 7.5
},
"logs": "Using seed: 38141\n 0%| | 0/50 [00:00<?, ?it/s]\n 4%|▍ | 2/50 [00:00<00:03, 14.77it/s]\n 10%|█ | 5/50 [00:00<00:02, 19.05it/s]\n 16%|█▌ | 8/50 [00:00<00:02, 20.39it/s]\n 22%|██▏ | 11/50 [00:00<00:01, 21.02it/s]\n 28%|██▊ | 14/50 [00:00<00:01, 21.35it/s]\n 34%|███▍ | 17/50 [00:00<00:01, 21.57it/s]\n 40%|████ | 20/50 [00:00<00:01, 21.72it/s]\n 46%|████▌ | 23/50 [00:01<00:01, 21.76it/s]\n 52%|█████▏ | 26/50 [00:01<00:01, 21.76it/s]\n 58%|█████▊ | 29/50 [00:01<00:00, 21.80it/s]\n 64%|██████▍ | 32/50 [00:01<00:00, 21.83it/s]\n 70%|███████ | 35/50 [00:01<00:00, 21.83it/s]\n 76%|███████▌ | 38/50 [00:01<00:00, 21.83it/s]\n 82%|████████▏ | 41/50 [00:01<00:00, 21.84it/s]\n 88%|████████▊ | 44/50 [00:02<00:00, 21.86it/s]\n 94%|█████████▍| 47/50 [00:02<00:00, 21.86it/s]\n100%|██████████| 50/50 [00:02<00:00, 21.87it/s]\n100%|██████████| 50/50 [00:02<00:00, 21.49it/s]",
"output": "https://replicate.delivery/pbxt/7B09JVo3qwrILNlXQolxuMmYzbGTRMfJmOenmIK6lvjjhdsRA/out.png",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-10-09T16:12:18.500587Z",
"started_at": "2023-10-09T16:12:16.348662Z",
"completed_at": "2023-10-09T16:12:20.441556Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/4io4o3dbkmossdei7vqlkn4vha/cancel",
"get": "https://api.replicate.com/v1/predictions/4io4o3dbkmossdei7vqlkn4vha"
},
"metrics": {
"predict_time": 4.092894,
"total_time": 1.940969
}
}
