typetext
{
"prompt": "\"Test Kitchen\", where ingredients and recipes are put to the test, to create the most YUMMY large language model context in town\n\ncute software project logo, chef",
"size": "1024x1024",
"style": "any"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_881**********************************
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 recraft-ai/recraft-v3-svg using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
prompt: "\"Test Kitchen\", where ingredients and recipes are put to the test, to create the most YUMMY large language model context in town\n\ncute software project logo, chef",
size: "1024x1024",
style: "any"
};
const output = await replicate.run("recraft-ai/recraft-v3-svg", { input });
// 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_881**********************************
This is your API token. Keep it to yourself.
import replicate
Run recraft-ai/recraft-v3-svg using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"recraft-ai/recraft-v3-svg",
input={
"prompt": "\"Test Kitchen\", where ingredients and recipes are put to the test, to create the most YUMMY large language model context in town\n\ncute software project logo, chef",
"size": "1024x1024",
"style": "any"
}
)
# 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_881**********************************
This is your API token. Keep it to yourself.
Run recraft-ai/recraft-v3-svg 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 $'{
"input": {
"prompt": "\\"Test Kitchen\\", where ingredients and recipes are put to the test, to create the most YUMMY large language model context in town\\n\\ncute software project logo, chef",
"size": "1024x1024",
"style": "any"
}
}' \
https://api.replicate.com/v1/models/recraft-ai/recraft-v3-svg/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "5wbdvsj69xrga0ckdv0sqt7mrr",
"model": "recraft-ai/recraft-v3-svg",
"version": "hidden",
"input": {
"prompt": "\"Test Kitchen\", where ingredients and recipes are put to the test, to create the most YUMMY large language model context in town\n\ncute software project logo, chef",
"size": "1024x1024",
"style": "any"
},
"logs": "Running prediction... \nStarting image generation...\nGenerated image in 16.33sec",
"output": "https://replicate.delivery/czjl/e1HyQLEXiVSWMqmzgPLvPEmtwYhL6TZGf5M8yqiVnDoN6Q1TA/output.svg",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-11-27T17:53:00.495Z",
"started_at": "2024-11-27T17:53:00.503498Z",
"completed_at": "2024-11-27T17:53:17.078323Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/5wbdvsj69xrga0ckdv0sqt7mrr/cancel",
"get": "https://api.replicate.com/v1/predictions/5wbdvsj69xrga0ckdv0sqt7mrr",
"stream": "https://stream.replicate.com/v1/files/fddq-z46fk43k6gqiukjen36us545p4y5ovcorvtdnfzsogx2qpi2khca",
"web": "https://replicate.com/p/5wbdvsj69xrga0ckdv0sqt7mrr"
},
"metrics": {
"image_count": 1,
"predict_time": 16.574824800000002,
"total_time": 16.583323
}
}