typetext
{
"aspect_ratio": "1:1",
"height": 1440,
"output_format": "webp",
"output_quality": 80,
"prompt": "a photo of a green monochrome vector display Tektronix 4010 CRT terminal displaying a wireframe 3d render of an egg-shaped permaculture megastructure enclosure with a central trunk that has a waterfall and elevators, supporting branching platforms holding modular stacked buildings, connected by small roadways with small cars driving between them, fruit and nut trees, green glowing lines on black background, green glow from curved CRT screen reflecting off of mechanical keyboard integrated into terminal, photo taken in 1979",
"prompt_upsampling": false,
"safety_tolerance": 4,
"width": 1440
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_6Lr**********************************
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 black-forest-labs/flux-1.1-pro using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
aspect_ratio: "1:1",
height: 1440,
output_format: "webp",
output_quality: 80,
prompt: "a photo of a green monochrome vector display Tektronix 4010 CRT terminal displaying a wireframe 3d render of an egg-shaped permaculture megastructure enclosure with a central trunk that has a waterfall and elevators, supporting branching platforms holding modular stacked buildings, connected by small roadways with small cars driving between them, fruit and nut trees, green glowing lines on black background, green glow from curved CRT screen reflecting off of mechanical keyboard integrated into terminal, photo taken in 1979",
prompt_upsampling: false,
safety_tolerance: 4,
width: 1440
};
const output = await replicate.run("black-forest-labs/flux-1.1-pro", { 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_6Lr**********************************
This is your API token. Keep it to yourself.
import replicate
Run black-forest-labs/flux-1.1-pro using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"black-forest-labs/flux-1.1-pro",
input={
"aspect_ratio": "1:1",
"height": 1440,
"output_format": "webp",
"output_quality": 80,
"prompt": "a photo of a green monochrome vector display Tektronix 4010 CRT terminal displaying a wireframe 3d render of an egg-shaped permaculture megastructure enclosure with a central trunk that has a waterfall and elevators, supporting branching platforms holding modular stacked buildings, connected by small roadways with small cars driving between them, fruit and nut trees, green glowing lines on black background, green glow from curved CRT screen reflecting off of mechanical keyboard integrated into terminal, photo taken in 1979",
"prompt_upsampling": False,
"safety_tolerance": 4,
"width": 1440
}
)
# 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_6Lr**********************************
This is your API token. Keep it to yourself.
Run black-forest-labs/flux-1.1-pro 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": {
"aspect_ratio": "1:1",
"height": 1440,
"output_format": "webp",
"output_quality": 80,
"prompt": "a photo of a green monochrome vector display Tektronix 4010 CRT terminal displaying a wireframe 3d render of an egg-shaped permaculture megastructure enclosure with a central trunk that has a waterfall and elevators, supporting branching platforms holding modular stacked buildings, connected by small roadways with small cars driving between them, fruit and nut trees, green glowing lines on black background, green glow from curved CRT screen reflecting off of mechanical keyboard integrated into terminal, photo taken in 1979",
"prompt_upsampling": false,
"safety_tolerance": 4,
"width": 1440
}
}' \
https://api.replicate.com/v1/models/black-forest-labs/flux-1.1-pro/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "6ez0x8xqvsrga0cjadg8m7bah0",
"model": "black-forest-labs/flux-1.1-pro",
"version": "hidden",
"input": {
"aspect_ratio": "1:1",
"height": 1440,
"output_format": "webp",
"output_quality": 80,
"prompt": "a photo of a green monochrome vector display Tektronix 4010 CRT terminal displaying a wireframe 3d render of an egg-shaped permaculture megastructure enclosure with a central trunk that has a waterfall and elevators, supporting branching platforms holding modular stacked buildings, connected by small roadways with small cars driving between them, fruit and nut trees, green glowing lines on black background, green glow from curved CRT screen reflecting off of mechanical keyboard integrated into terminal, photo taken in 1979",
"prompt_upsampling": false,
"safety_tolerance": 4,
"width": 1440
},
"logs": "Using seed: 31806\nRunning prediction... \nGenerating image...",
"output": "https://replicate.delivery/czjl/bv0gPsGfgNSoRC3zKB9nM8kupj2yLQyH68TFNPQY7skSGkxJA/output.webp",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-10-03T17:15:00.446Z",
"started_at": "2024-10-03T17:15:00.453596Z",
"completed_at": "2024-10-03T17:15:17.402351Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/6ez0x8xqvsrga0cjadg8m7bah0/cancel",
"get": "https://api.replicate.com/v1/predictions/6ez0x8xqvsrga0cjadg8m7bah0",
"web": "https://replicate.com/p/6ez0x8xqvsrga0cjadg8m7bah0"
},
"metrics": {
"image_count": 1,
"predict_time": 16.948754535,
"total_time": 16.956351
}
}