본문으로 건너뛰기
cccskills
무료GitHub에 공개

bfl-api

Integrate FLUX image generation and editing into applications through the BFL API. The guide covers authentication, checking asynchronous results, completion notifications through webhooks, request limits, error handling, regional endpoints, and downloading generated images before their URLs expire.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

BFL FLUX API integration guide covering endpoints, async polling patterns, rate limiting, error handling, webhooks, and regional endpoints with Python and TypeScript code examples.

연동 도구X (Twitter)
설치 방법 보기

이럴 때 유용합니다

  • Add FLUX image generation and editing to an application
  • Implement result checks and completion notifications
  • Handle request limits and API errors
  • Combine elements from multiple reference images

포함된 파일(10)

  • SKILL.md9.7 KB
  • references/api-key-setup.md1.4 KB
  • references/code-examples/curl-examples.sh5.1 KB
  • references/code-examples/python-client.py13.6 KB
  • references/code-examples/typescript-client.ts12.2 KB
  • references/endpoints.md7.6 KB
  • references/error-handling.md8.3 KB
  • references/polling-patterns.md6.6 KB
  • references/rate-limiting.md6.6 KB
  • references/webhook-integration.md8.2 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

BFL API Integration Guide

Use this skill when integrating BFL FLUX APIs into applications for image generation, editing, and processing.

First: Check API Key

Before generating images, verify your API key is set:

echo $BFL_API_KEY

If empty or you see "Not authenticated" errors, see API Key Setup below.

Important: Image URLs Expire in 10 Minutes

Result URLs from the API are temporary. Download images immediately after generation completes - do not store or cache the URLs themselves.

When to Use

  • Setting up BFL API client
  • Implementing async polling patterns
  • Handling rate limits and errors
  • Configuring webhooks for production
  • Selecting regional endpoints
  • Building production-ready integrations

Quick Reference

Base Endpoints

RegionEndpointUse Case
Globalhttps://api.bfl.aiDefault, automatic failover
EUhttps://api.eu.bfl.aiGDPR compliance
UShttps://api.us.bfl.aiUS data residency

Model Endpoints & Pricing

Credit pricing: 1 credit = $0.01 USD. FLUX.2 uses megapixel-based pricing (cost scales with resolution).

FLUX.2 Models

ModelPath1st MP+MP1MP T2I1MP I2IBest For
FLUX.2 [klein] 4B/v1/flux-2-klein-4b1.4c0.1c$0.014$0.015Real-time, high volume
FLUX.2 [klein] 9B/v1/flux-2-klein-9b1.5c0.2c$0.015$0.017Balanced quality/speed
FLUX.2 [pro]/v1/flux-2-pro3c1.5c$0.03$0.045Production, fast turnaround
FLUX.2 [max]/v1/flux-2-max7c3c$0.07$0.10Maximum quality
FLUX.2 [flex]/v1/flux-2-flex5c5c$0.05$0.10Typography, adjustable controls
FLUX.2 [dev]---FreeFreeLocal development (non-commercial)

Pricing formula: (firstMP + (outputMP-1) * mpPrice) + (inputMP * mpPrice) in cents

FLUX.1 Models

ModelPathPrice/ImageBest For
FLUX.1 Kontext [pro]/v1/flux-kontext$0.04Image editing with context
FLUX.1 Kontext [max]/v1/flux-kontext-max$0.08Max quality editing
FLUX1.1 [pro]/v1/flux-pro-1.1$0.04Standard T2I, fast & reliable
FLUX1.1 [pro] Ultra/v1/flux-pro-1.1-ultra$0.06Ultra high-resolution
FLUX1.1 [pro] Raw/v1/flux-pro-1.1-raw$0.06Candid photography feel
FLUX.1 Fill [pro]/v1/flux-pro-1.0-fill$0.05Inpainting

Tip: All FLUX.2 models support image editing via the input_image parameter - no separate editing endpoint needed. Use bfl.ai/pricing calculator for exact costs at different resolutions.

Image Input for Editing

Preferred: Use URLs directly - simpler and more convenient than base64.

Single image editing:

curl -X POST "https://api.bfl.ai/v1/flux-2-pro" \
  -H "x-key: $BFL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Change the background to a sunset",
    "input_image": "https://example.com/photo.jpg"
  }'

Multi-reference editing:

curl -X POST "https://api.bfl.ai/v1/flux-2-pro" \
  -H "x-key: $BFL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "The person from image 1 in the environment from image 2",
    "input_image": "https://example.com/person.jpg",
    "input_image_2": "https://example.com/background.jpg"
  }'

The API fetches URLs automatically. Both URL and base64 work, but URLs are recommended when available.

Multi-Reference I2I

FLUX.2 models support multiple input images for combining elements, style transfer, and character consistency:

ModelMax References
FLUX.2 [klein]4 images
FLUX.2 [pro/max/flex]8 images

Parameters: input_image, input_image_2, input_image_3, ... input_image_8

Prompt pattern: Reference images by number in your prompt:

  • "The subject from image 1 in the environment from image 2"
  • "Apply the style of image 2 to the scene in image 1"
  • "The person from image 1 wearing the outfit from image 2, in the pose from image 3"

For detailed multi-reference patterns (character consistency, style transfer, pose guidance), see flux-best-practices/rules/multi-reference-editing.md

Rate Limits

TierConcurrent Requests
Standard (most endpoints)24

Polling vs Webhooks

ApproachUse When
PollingScripts, CLI tools, local development, single requests, simple integrations
WebhooksProduction apps, high volume, server-to-server, when you need immediate notification

Start with polling - it's simpler and works everywhere. Switch to webhooks when you need to scale or want event-driven architecture.

Key Behaviors

  • Polling: Response includes polling_url for async results
  • URL Expiration: Result URLs expire after 10 minutes
  • Webhook Support: Configure webhook_url for production workloads

API Key Setup

Required: The BFL_API_KEY environment variable must be set before using the API.

Quick Check

echo $BFL_API_KEY

If Not Set

  1. Get a key: Go to https://dashboard.bfl.ai/get-started → Click "Create Key" → Select organization
  2. Save to .env (recommended for persistence):
    echo 'BFL_API_KEY=bfl_your_key_here' >> .env
    echo '.env' >> .gitignore  # Don't commit secrets
    

See references/api-key-setup.md for detailed setup instructions.

Authentication

x-key: YOUR_API_KEY

Basic Request Flow

1. POST request to model endpoint
   └─> Response: { "polling_url": "..." }

2. GET polling_url (repeat until complete)
   └─> Response: { "status": "Pending" | "Ready" | "Error", ... }

3. When Ready, download result URL
   └─> URL expires in 10 minutes - download immediately

Related

  • Prompting best practices (T2I, I2I, typography, colors): see the flux-best-practices skill
  • Multi-reference patterns (character consistency, style transfer, pose guidance): see flux-best-practices/rules/multi-reference-editing.md

References

Code Examples

Note: cURL examples are preferred by default as they work universally without requiring Python or Node.js. Use language-specific clients when building production applications.

Quick Start Example

1. Submit Generation Request

curl -s -X POST "https://api.bfl.ai/v1/flux-2-pro" \
  -H "x-key: $BFL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "A serene mountain landscape at sunset", "width": 1024, "height": 1024}'

Response:

{ "id": "abc123", "polling_url": "https://api.bfl.ai/v1/get_result?id=abc123" }

2. Poll for Result

curl -s "POLLING_URL" -H "x-key: $BFL_API_KEY"

Response when ready:

{ "status": "Ready", "result": { "sample": "https://...", "seed": 1234 } }

3. Download Image

curl -s -o output.png "IMAGE_URL"

Tip: Result URLs expire in 10 minutes. Download immediately after status becomes Ready.

4. Multi-Reference Example

Combine elements from multiple images:

curl -s -X POST "https://api.bfl.ai/v1/flux-2-pro" \
  -H "x-key: $BFL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "The cat from image 1 sitting in the cozy room from image 2",
    "input_image": "https://example.com/cat.jpg",
    "input_image_2": "https://example.com/room.jpg",
    "width": 1024,
    "height": 1024
  }'

Reference images by number in your prompt. See Multi-Reference I2I for limits and patterns.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Create 3D objects from text or images, choose catalog assets for repeated scenery, and inspect the results in Blender. The workflow checks geometry, materials, scale, and ground contact while recording asset sources and generation costs.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Create a unique 3D object from a text description
  • Reconstruct a 3D object from a concept image
  • Populate scenery with catalog vegetation and rocks
calesthio/OpenMontage7만2026년 10월 17일 업데이트

acestep

무료

Generate background music and songs with lyrics using ACE-Step 1.5, with controls for duration, tempo, and musical key. You can also restyle reference audio and separate vocals or individual instruments from mixed tracks.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Generate background music to match a video scene
  • Create a short jingle with supplied lyrics
  • Make a jazz arrangement of reference audio
calesthio/OpenMontage7만2026년 10월 17일 업데이트

agents

무료

Build voice assistants and conversational characters with ElevenLabs. Configure voices, language models, and external tools, then connect conversations to a website widget or use Twilio integration for outbound phone calls.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Creating a voice bot for customer support
  • Embedding a voice assistant on a website
  • Building an interactive voice character
calesthio/OpenMontage7만2026년 10월 17일 업데이트

Generate video clips from text descriptions or reference images through multiple API services. Compare available providers by cost and task needs, choose aspect ratios, track generation progress, and refine existing clips through conversational editing with Gemini Omni.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Generating clips from written scene descriptions
  • Animating a product photo
  • Creating vertical videos for social media
calesthio/OpenMontage7만2026년 10월 17일 업데이트

Create AI video clips from text or reference images, choosing among providers to match the task and budget. Supports vertical social videos, product photo animation, and conversational editing of existing clips with Gemini Omni Flash.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Create vertical video clips for social media
  • Animate product photos
  • Choose a video provider for a budget and visual style
calesthio/OpenMontage7만2026년 10월 17일 업데이트

Generate and edit images and videos through Atlas Cloud using one API key across multiple model families. Choose supported models for each task, download the results, and retain details about the model, inputs, and estimated cost.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Generate images and videos through one service
  • Edit product images using reference materials
  • Create videos from images, video, or audio references
calesthio/OpenMontage7만2026년 10월 17일 업데이트

calesthio의 스킬 모두 보기

이 스킬의 문제 신고