Skip to main content
text to imageGated

FLUX.1-schnell

by black-forest-labs

A powerful AI model available via API.

563,011 downloads6,301 likes
Get API Key

API Usage

Endpoint

POST https://api.gpu.fm/v1/inference

Request

curl -X POST https://api.gpu.fm/v1/inference \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "black-forest-labs/FLUX.1-schnell",
    "inputs": "A serene mountain landscape at sunset, photorealistic",
    "parameters": {
      "max_new_tokens": 256
    }
  }'

Response

{
  "result": [base64 encoded image data],
  "usage": {
    "inputTokens": 12,
    "outputTokens": 128
  },
  "pricing": {
    "total": "0.000018"
  }
}

Python SDK

import requests

response = requests.post(
    "https://api.gpu.fm/v1/inference",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={
        "model": "black-forest-labs/FLUX.1-schnell",
        "inputs": "A serene mountain landscape at sunset, photorealistic",
        "parameters": {"max_new_tokens": 256}
    }
)

result = response.json()
print(result["result"])

Pricing

Per Image$0.0026/image

Billed from your prepaid credits. No minimum commitment.

Details

Model ID
black-forest-labs/FLUX.1-schnell
Library
diffusers
Pipeline
text to image
Updated
8/16/2024

Tags

diffuserssafetensorstext-to-imageimage-generationfluxenlicense:apache-2.0endpoints_compatiblediffusers:FluxPipelinedeploy:sagemaker