Prediction
black-forest-labs/flux-devOfficial model
ID
nbgkpy68m1rm40chr1faxpw2vg
Status
Succeeded
Source
Web
Total duration
Created
by @lucataco
Input
- prompt
- latina model
- guidance
- 3.5
- num_outputs
- 1
- aspect_ratio
- 1:1
- output_format
- webp
- output_quality
- 80
- prompt_strength
- 0.8
- num_inference_steps
- 28
{
"prompt": "latina model",
"guidance": 3.5,
"num_outputs": 1,
"aspect_ratio": "1:1",
"output_format": "webp",
"output_quality": 80,
"prompt_strength": 0.8,
"num_inference_steps": 28
}
Install Replicate’s Node.js client library:
npm install replicate
Set the
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import and set up the client:
import Replicate from "replicate";
import fs from "node:fs";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run black-forest-labs/flux-dev using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
prompt: "latina model",
guidance: 3.5,
num_outputs: 1,
aspect_ratio: "1:1",
output_format: "webp",
output_quality: 80,
prompt_strength: 0.8,
num_inference_steps: 28
};
const output = await replicate.run("black-forest-labs/flux-dev", { input });
// To access the file URL:
console.log(output[0].url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", output[0]);
To learn more, take a look at the guide on getting started with Node.js.
Install Replicate’s Python client library:
pip install replicate
Set the
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import the client:
import replicate
Run black-forest-labs/flux-dev using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"black-forest-labs/flux-dev",
input={
"prompt": "latina model",
"guidance": 3.5,
"num_outputs": 1,
"aspect_ratio": "1:1",
"output_format": "webp",
"output_quality": 80,
"prompt_strength": 0.8,
"num_inference_steps": 28
}
)
# To access the file URL:
print(output[0].url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output[0].read())
To learn more, take a look at the guide on getting started with Python.
Set the
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Run black-forest-labs/flux-dev 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": "latina model",
"guidance": 3.5,
"num_outputs": 1,
"aspect_ratio": "1:1",
"output_format": "webp",
"output_quality": 80,
"prompt_strength": 0.8,
"num_inference_steps": 28
}
}' \
https://api.replicate.com/v1/models/black-forest-labs/flux-dev/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{
"completed_at": "2024-09-05T04:08:52.954120Z",
"created_at": "2024-09-05T04:08:42.912000Z",
"data_removed": false,
"error": null,
"id": "nbgkpy68m1rm40chr1faxpw2vg",
"input": {
"prompt": "latina model",
"guidance": 3.5,
"num_outputs": 1,
"aspect_ratio": "1:1",
"output_format": "webp",
"output_quality": 80,
"prompt_strength": 0.8,
"num_inference_steps": 28
},
"logs": "Using seed: 54017\n0it [00:00, ?it/s]\n2it [00:00, 13.73it/s]\n4it [00:00, 8.01it/s]\n5it [00:00, 7.38it/s]\n6it [00:00, 6.99it/s]\n7it [00:00, 6.49it/s]\n8it [00:01, 6.37it/s]\n9it [00:01, 6.31it/s]\n10it [00:01, 6.28it/s]\n11it [00:01, 6.26it/s]\n12it [00:01, 6.25it/s]\n13it [00:01, 6.11it/s]\n14it [00:02, 6.09it/s]\n15it [00:02, 6.09it/s]\n16it [00:02, 6.12it/s]\n17it [00:02, 6.16it/s]\n18it [00:02, 6.15it/s]\n19it [00:02, 6.09it/s]\n20it [00:03, 6.05it/s]\n21it [00:03, 6.07it/s]\n22it [00:03, 6.10it/s]\n23it [00:03, 6.11it/s]\n24it [00:03, 6.11it/s]\n25it [00:03, 6.09it/s]\n26it [00:04, 6.07it/s]\n27it [00:04, 6.08it/s]\n28it [00:04, 6.10it/s]\n28it [00:04, 6.35it/s]\nTotal safe images: 1 out of 1",
"metrics": {
"image_count": 1,
"predict_time": 5.046805054,
"total_time": 10.04212
},
"output": [
"https://replicate.delivery/yhqm/0IJIfDzOLO05ciFy0ABzvgfmu19xw5g0Cp9WcOengNSoGczmA/out-0.webp"
],
"started_at": "2024-09-05T04:08:47.907315Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/nbgkpy68m1rm40chr1faxpw2vg",
"cancel": "https://api.replicate.com/v1/predictions/nbgkpy68m1rm40chr1faxpw2vg/cancel",
"web": "https://replicate.com/p/nbgkpy68m1rm40chr1faxpw2vg"
},
"version": "hidden"
}
Generated in
Using seed: 54017
0it [00:00, ?it/s]
2it [00:00, 13.73it/s]
4it [00:00, 8.01it/s]
5it [00:00, 7.38it/s]
6it [00:00, 6.99it/s]
7it [00:00, 6.49it/s]
8it [00:01, 6.37it/s]
9it [00:01, 6.31it/s]
10it [00:01, 6.28it/s]
11it [00:01, 6.26it/s]
12it [00:01, 6.25it/s]
13it [00:01, 6.11it/s]
14it [00:02, 6.09it/s]
15it [00:02, 6.09it/s]
16it [00:02, 6.12it/s]
17it [00:02, 6.16it/s]
18it [00:02, 6.15it/s]
19it [00:02, 6.09it/s]
20it [00:03, 6.05it/s]
21it [00:03, 6.07it/s]
22it [00:03, 6.10it/s]
23it [00:03, 6.11it/s]
24it [00:03, 6.11it/s]
25it [00:03, 6.09it/s]
26it [00:04, 6.07it/s]
27it [00:04, 6.08it/s]
28it [00:04, 6.10it/s]
28it [00:04, 6.35it/s]
Total safe images: 1 out of 1