typetext
{
"max_length": 100,
"prompt": "Image: a gaugin painting",
"repetition_penalty": 1.5,
"temperature": 1,
"top_p": 1
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_HyX**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run fofr/image-prompts using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"fofr/image-prompts:ba4130c13f3f1cd9771bc671bb13eab6ad5d839b2e55723b40742c03ef7f99ff",
{
input: {
max_length: 100,
prompt: "Image: a gaugin painting",
repetition_penalty: 1.5,
temperature: 1,
top_p: 1
}
}
);
console.log(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_HyX**********************************
This is your API token. Keep it to yourself.
import replicate
Run fofr/image-prompts using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"fofr/image-prompts:ba4130c13f3f1cd9771bc671bb13eab6ad5d839b2e55723b40742c03ef7f99ff",
input={
"max_length": 100,
"prompt": "Image: a gaugin painting",
"repetition_penalty": 1.5,
"temperature": 1,
"top_p": 1
}
)
# The fofr/image-prompts model can stream output as it's running.
# The predict method returns an iterator, and you can iterate over that output.
for item in output:
# https://replicate.com/fofr/image-prompts/api#output-schema
print(item, end="")
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_HyX**********************************
This is your API token. Keep it to yourself.
Run fofr/image-prompts 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": "fofr/image-prompts:ba4130c13f3f1cd9771bc671bb13eab6ad5d839b2e55723b40742c03ef7f99ff",
"input": {
"max_length": 100,
"prompt": "Image: a gaugin painting",
"repetition_penalty": 1.5,
"temperature": 1,
"top_p": 1
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Prompt: a gaugin painting, water, the garden at sunset, fenegrean, daffodils, and an island with palm trees, 1950 --ar 3:2
{
"id": "6uf6bm72wfcl3nrnyqbeojzb5i",
"model": "fofr/image-prompts",
"version": "ba4130c13f3f1cd9771bc671bb13eab6ad5d839b2e55723b40742c03ef7f99ff",
"input": {
"max_length": 100,
"prompt": "Image: a gaugin painting",
"repetition_penalty": 1.5,
"temperature": 1,
"top_p": 1
},
"logs": "",
"output": [
"Prompt:",
" a",
" gaugin",
" painting,",
" water,",
" the",
" garden",
" at",
" sunset,",
" fenegrean,",
" daffodils,",
" and",
" an",
" island",
" with",
" palm",
" trees,",
" 1950",
" --ar",
" 3:2"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-04-26T14:42:06.509052Z",
"started_at": "2023-04-26T14:42:06.621622Z",
"completed_at": "2023-04-26T14:42:08.321342Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/6uf6bm72wfcl3nrnyqbeojzb5i/cancel",
"get": "https://api.replicate.com/v1/predictions/6uf6bm72wfcl3nrnyqbeojzb5i"
},
"metrics": {
"predict_time": 1.69972,
"total_time": 1.81229
}
}