Skip to content

BFL FLUX Models

Black Forest Labs' FLUX series image generation models, known for outstanding image quality and text rendering capabilities.

Quick Start

python
from openai import OpenAI

client = OpenAI(
    base_url="https://open.dieyuyun.com/v1",
    api_key="YOUR_API_KEY"
)

response = client.images.generate(
    model="flux-1.1-pro",
    prompt="A neon-lit cyberpunk city street at night, rain reflections on the ground",
    size="1024x1024",
    n=1
)

print(response.data[0].url)

Endpoint

ItemValue
MethodPOST
Path/v1/images/generations
Base URLhttps://open.dieyuyun.com
ProtocolOpenAI Images API

Authentication

Bearer Token: Authorization: Bearer YOUR_API_KEY

Available Models

Model CodeDescription
flux-1.1-proFLUX 1.1 Pro, high-quality professional version (default)
flux-proFLUX Pro, high-quality version
flux-devFLUX Dev, development version, faster speed
flux-schnellFLUX Schnell, fastest version, ideal for rapid iteration

Standard Request Fields

FieldTypeRequiredDefaultDescription
modelstringYesModel identifier, e.g. flux-1.1-pro
promptstringYesImage description text
sizestringNo1024x1024Image size
qualitystringNostandardGeneration quality: standard, hd
nintegerNo1Number of images to generate
response_formatstringNourlResponse format: url or b64_json

Supported Sizes

SizeAspect RatioDescription
1024x10241:1Square
1536x10243:2Landscape
1024x15362:3Portrait
1344x76816:9Widescreen
768x13449:16Vertical

Request Examples

bash
curl https://open.dieyuyun.com/v1/images/generations \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "flux-1.1-pro",
    "prompt": "A neon-lit cyberpunk city street at night, rain reflections on the ground",
    "size": "1024x1024",
    "n": 1
  }'
python
from openai import OpenAI

client = OpenAI(
    base_url="https://open.dieyuyun.com/v1",
    api_key="YOUR_API_KEY"
)

response = client.images.generate(
    model="flux-1.1-pro",
    prompt="A neon-lit cyberpunk city street at night, rain reflections on the ground",
    size="1024x1024",
    n=1
)

print(response.data[0].url)
javascript
import OpenAI from 'openai'

const client = new OpenAI({
  baseURL: 'https://open.dieyuyun.com/v1',
  apiKey: 'YOUR_API_KEY',
})

const response = await client.images.generate({
  model: 'flux-1.1-pro',
  prompt: 'A neon-lit cyberpunk city street at night, rain reflections on the ground',
  size: '1024x1024',
  n: 1,
})

console.log(response.data[0].url)

Response Format

Success Response

json
{
  "created": 1717000000,
  "data": [
    {
      "url": "https://...",
      "revised_prompt": "..."
    }
  ]
}
FieldTypeDescription
createdintegerUnix timestamp
dataarrayArray of generated results
data[].urlstringImage URL
data[].revised_promptstringThe revised/optimized prompt used for generation

Error Response

See Error Codes for details.

Best Practices

  • Model selection: Choose flux-1.1-pro for the highest quality, flux-schnell for rapid iteration, and flux-dev for a balance of speed and quality.
  • Text rendering: The FLUX series excels at rendering text within images compared to most models, making it ideal for scenes with text elements (posters, banners, etc.).
  • Prompt style: FLUX responds well to natural language descriptions. Write prompts like you would describe a scene naturally, without excessive keyword stacking.
  • High-resolution output: For larger dimensions, choose non-square resolutions like 1536x1024 or 1344x768 for better widescreen results.

Rate Limits

See Rate Limits for details.