typetext
{
"prompt": "This model is deprecated, please use ostris/flux-dev-lora-trainer"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_TF1**********************************
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 lucataco/ai-toolkit using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"lucataco/ai-toolkit:06e50f60983aa9ad9e4c13ba1d56ee235925ee6bd1c604d94c26a3322aeb8d47",
{
input: {
prompt: "This model is deprecated, please use ostris/flux-dev-lora-trainer"
}
}
);
// 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_TF1**********************************
This is your API token. Keep it to yourself.
import replicate
Run lucataco/ai-toolkit using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"lucataco/ai-toolkit:06e50f60983aa9ad9e4c13ba1d56ee235925ee6bd1c604d94c26a3322aeb8d47",
input={
"prompt": "This model is deprecated, please use ostris/flux-dev-lora-trainer"
}
)
# 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_TF1**********************************
This is your API token. Keep it to yourself.
Run lucataco/ai-toolkit 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": "lucataco/ai-toolkit:06e50f60983aa9ad9e4c13ba1d56ee235925ee6bd1c604d94c26a3322aeb8d47",
"input": {
"prompt": "This model is deprecated, please use ostris/flux-dev-lora-trainer"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "7jzzexka05rj00cm0gyv6vdjzw",
"model": "lucataco/ai-toolkit",
"version": "06e50f60983aa9ad9e4c13ba1d56ee235925ee6bd1c604d94c26a3322aeb8d47",
"input": {
"prompt": "This model is deprecated, please use ostris/flux-dev-lora-trainer"
},
"logs": "",
"output": "https://replicate.delivery/yhqm/5BnBqaoA8R7oKZJJeQeQKOwonif4wFRmf4fRb6rIWXDRlp2fE/empty.zip",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-12-26T18:32:01.281Z",
"started_at": "2024-12-26T18:32:10.718688Z",
"completed_at": "2024-12-26T18:32:10.733309Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/7jzzexka05rj00cm0gyv6vdjzw/cancel",
"get": "https://api.replicate.com/v1/predictions/7jzzexka05rj00cm0gyv6vdjzw",
"stream": "https://stream.replicate.com/v1/files/qoxq-ssjecsoitsrnmd4z3krjlobnju6eiptecbkr2m5pawm2kvxqtpna",
"web": "https://replicate.com/p/7jzzexka05rj00cm0gyv6vdjzw"
},
"metrics": {
"predict_time": 0.01462056,
"total_time": 9.452309
}
}