Skip to content
IMAGE
replicate

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

Capabilities

  • 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); set go_fast=False for 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

Install

bash
pip install socaity
socaity install black-forest-labs/flux-schnell

Authentication

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.

bash
export SOCAITY_API_KEY="sk_..."

Quick start

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.

python
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")

Methods

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) -> Job

Submit a text-to-image job and return a Job object. flux(prompt=...) and flux.run(prompt=...) are aliases that call the same endpoint.

ParameterTypeDefaultDescription
promptstrrequiredText description of the image to generate.
seedint42Seed for reproducible generation. Defaults to a fixed value of 42 for deterministic output, not a random seed; change it to vary results.
go_fastboolTrueThroughput-tuned generation path. Set to False for the higher-precision path.
megapixelsstr"1"Approximate output resolution in megapixels.
num_outputsint1Number of images to generate per call.
aspect_ratiostr"1:1"Aspect ratio of the output image (e.g. "16:9", "9:16", "4:3").
output_formatstr"webp"Output image format. Options: webp, png, jpg.
output_qualityint80Compression quality for webp and jpg outputs (0 to 100). Not applied to png.
num_inference_stepsint4Denoising steps. 4 is the recommended value; lower values reduce quality.
disable_safety_checkerboolFalseDisable the built-in safety filter on generated images.

Pricing & live playground

Current pricing and the interactive playground live on socaity.ai.

Open flux-schnell on socaity.ai

Next steps