FLUX.1 Schnell API
/v1/tasks All models are called through the Unified Async API POST /v1/tasks endpoint; only the input fields differ (see input parameters below).
Model summary
| Model name | flux-schnell/text-to-image |
|---|---|
| Type | Image generation (text-to-image) |
| Endpoint | POST /v1/tasks |
| Pricing | See HiAPI Pricing |
FLUX.1 Schnell is the open-source 12B rapid text-to-image model from Black Forest Labs: 1-4 step inference returns images in seconds, it sits in the lowest price tier across HiAPI, and the Apache 2.0 license permits commercial use — built for batch generation and fast iteration.
Production guidance
- For production, pass callback.url at the top level of the request body so HiAPI can notify your service when the task reaches a terminal state.
- GET /v1/tasks/:id is better for local debugging, low-volume jobs, or fallback reconciliation if a callback is missed.
- Use callback.when=final. Both success and fail are terminal states, so your service should deduplicate by taskId.
Best suited for
1-4 step inference in the lowest price tier keeps both unit cost and latency at a minimum — a fit for e-commerce assets, content library fills and other jobs that render hundreds of images at a time.
num_inference_stepsSecond-level turnaround makes the tweak-and-regenerate loop nearly waitless: explore composition and style with schnell first, then hand the chosen direction to a higher-quality model for the final render.
promptseedThe few-step distilled architecture naturally suits real-time previews, in-app illustrations and other online scenarios, sustaining more requests per second on the same budget.
The Apache 2.0 license covers personal, research and commercial use. Combined with the lowest price tier, it works well for prototypes and early-stage products that need compliant commercial usage on a tight budget.
Request parameters
model string required Fixed value flux-schnell/text-to-image.
input object required Business parameters. Put FLUX.1 Schnell-specific configuration here.
prompt string required Text prompt for image generation. The upstream T5 encoder caps at roughly 256 tokens; longer prompts get truncated, so keep them concise.
aspect_ratio enum optional Output aspect ratio.
num_inference_steps integer optional Denoising steps (1-12). The official recommendation is 1-4 (default 4); higher step counts bring limited gains.
guidance_scale number optional schnell is a timestep-distilled model and the official reference implementation does not use guidance. This parameter exists for upstream compatibility; keep the default in most cases.
output_format enum optional Format of the output image.
seed integer optional Random seed for reproducible generation.
enable_safety_checker boolean optional Enable content safety filtering.
callback object optional Optional callback configuration. When set, HiAPI notifies your service when the task reaches a terminal state.
url string required Required when callback is set; HTTPS URL that receives terminal task notifications.
when enum optional Callback trigger timing. Use final.
Example requests
Drop the step count to 1 while exploring composition — the fastest, cheapest way to sketch ideas before re-running the winner at higher steps or on a higher-quality model.
{
"model": "flux-schnell/text-to-image",
"input": {
"prompt": "serene Japanese garden with cherry blossoms, koi pond, wooden bridge, soft morning light, highly detailed",
"aspect_ratio": "4:3",
"num_inference_steps": 1
}
}Pin the seed while iterating on prompt wording so every change can be compared against a stable baseline — also handy for reproducing a single result inside batch pipelines.
{
"model": "flux-schnell/text-to-image",
"input": {
"prompt": "a majestic red fox on a misty cliff at golden hour, cinematic lighting, photorealistic, depth of field",
"aspect_ratio": "3:4",
"num_inference_steps": 4,
"seed": 42
}
}Getting the result
- The response returns a taskId immediately without waiting for generation to finish.
- In production, prefer waiting for callback.url to receive the terminal notification. For local debugging, poll GET /v1/tasks/:id.
- When status=success, download the generated image from output[].url.
- When status=fail, fix the request based on the returned error instead of retrying the same invalid payload.
FAQ
How is FLUX.1 Schnell billed?
Billed per image, and schnell sits in the lowest price tier across HiAPI models; aspect ratio does not affect the unit price. See the pricing page for the current rate. View live pricing
Why does changing guidance_scale seem to have no effect?
schnell is a timestep-distilled model and the official reference implementation does not use guidance (diffusers requires the value to be 0 for it). The guidance_scale field here is an upstream compatibility parameter — keep the default in most cases and steer results by refining the prompt instead.
How many inference steps should I use?
The official recommendation is 1-4 steps (default 4) — the model is distilled specifically for few-step sampling. HiAPI allows up to 12, but higher step counts bring limited gains; drop to 1-2 steps for the fastest drafts.
Can I use the generated images commercially?
The FLUX.1 Schnell weights are released under the Apache 2.0 license, which permits personal, research and commercial use, so outputs can go into commercial projects. The content itself must still comply with applicable laws and platform policies.