Model ID
black-forest-labs/flux.2-flex
Capabilities
| Modes | Text-to-image · Image-to-image |
| Inputs | Up to 3 images (image-to-image) |
| Native auto size | No |
| Magic prompt | Supported |
Generate
import Mynth from "@mynthio/sdk";
const mynth = new Mynth();
const task = await mynth.image.generate({
prompt: "Architectural photograph of a brutalist library at golden hour",
model: "black-forest-labs/flux.2-flex",
size: "landscape",
count: 1,
});
console.log(task.urls);
curl https://api.mynth.io/image/generate \
-X POST \
-H "Authorization: Bearer $MYNTH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Architectural photograph of a brutalist library at golden hour",
"model": "black-forest-labs/flux.2-flex",
"size": "landscape",
"count": 1
}'
Use inputs
Pass up to 3 input images for image-to-image. URLs or uploaded files both work. See Upload input images.const task = await mynth.image.generate({
prompt: "Restyle this photo as a cinematic still",
model: "black-forest-labs/flux.2-flex",
inputs: ["https://example.com/input-image.jpg"],
size: "landscape",
});
curl https://api.mynth.io/image/generate \
-X POST \
-H "Authorization: Bearer $MYNTH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Restyle this photo as a cinematic still",
"model": "black-forest-labs/flux.2-flex",
"inputs": [
{
"type": "image",
"source": { "type": "url", "url": "https://example.com/input-image.jpg" }
}
],
"size": "landscape"
}'