flux-schnell
Generate a 1 megapixel image from a text prompt in roughly one second on a warm worker. The model is Black Forest Labs' four-step diffusion checkpoint, hosted on Replicate and called through the Socaity backend, so a single Socaity API key covers everything. The default output is WebP at quality 80. PNG and JPEG are also supported.
by black-forest-labs · socaity.sdk.replicate.black_forest_labs.flux_schnell
- Text-to-image generation in four denoising steps (around one second per image on a warm worker)
- Throughput-tuned mode (
go_fast=True, the default); setgo_fast=Falsefor the higher-precision path - Configurable aspect ratio: 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, and more
- Output format webp (default), png, or jpg, with quality 0 to 100
- Up to four images per call via
num_outputs - Reproducible generation with an integer
seed - Built-in safety checker, with opt-out via
disable_safety_checker
pip install socaity
socaity install black-forest-labs/flux-schnell Socaity proxies the Replicate call for you, so one API key covers everything. Set SOCAITY_API_KEY in your environment. You do not need a Replicate key. Get a Socaity key at socaity.ai/account/secrets.
export SOCAITY_API_KEY="sk_..." Generate one 1 MP WebP image at the default settings. .get_result() blocks until the job finishes and returns one image object per requested output.
import os
from socaity.sdk.replicate.black_forest_labs import flux_schnell
flux = flux_schnell(api_key=os.getenv("SOCAITY_API_KEY"))
# predictions(...) submits the job and returns a Job handle.
# flux(prompt=...) and flux.run(prompt=...) are aliases for the same call.
image = flux.predictions(
prompt="a cat sitting on mars, cinematic lighting",
go_fast=True,
megapixels="1",
num_outputs=1,
aspect_ratio="1:1",
output_format="webp",
output_quality=80,
num_inference_steps=4,
).get_result()
image.save("output.webp")predictions(prompt, seed=42, go_fast=True, megapixels="1", num_outputs=1, aspect_ratio="1:1", output_format="webp", output_quality=80, num_inference_steps=4, disable_safety_checker=False, **kwargs) -> JobSubmit a text-to-image job and return a Job object. flux(prompt=...) and flux.run(prompt=...) are aliases that call the same endpoint.
| Parameter | Type | Default | Description |
|---|---|---|---|
prompt | str | required | Text description of the image to generate. |
seed | int | 42 | Seed for reproducible generation. Defaults to a fixed value of 42 for deterministic output, not a random seed; change it to vary results. |
go_fast | bool | True | Throughput-tuned generation path. Set to False for the higher-precision path. |
megapixels | str | "1" | Approximate output resolution in megapixels. |
num_outputs | int | 1 | Number of images to generate per call. |
aspect_ratio | str | "1:1" | Aspect ratio of the output image (e.g. "16:9", "9:16", "4:3"). |
output_format | str | "webp" | Output image format. Options: webp, png, jpg. |
output_quality | int | 80 | Compression quality for webp and jpg outputs (0 to 100). Not applied to png. |
num_inference_steps | int | 4 | Denoising steps. 4 is the recommended value; lower values reduce quality. |
disable_safety_checker | bool | False | Disable the built-in safety filter on generated images. |
Current pricing and the interactive playground live on socaity.ai.
Open flux-schnell on socaity.ai- Run your first model: end-to-end walkthrough of the install, auth, and first job.
- Multi-model pipeline: chain flux_schnell with a hosted text-to-speech model to produce an image and a narration in one script.
- Python SDK reference: full surface of FastSDK, job lifecycle, and gather helpers.