FLUX.1
[schnell] is a
12 billion parameter rectified flow transformer capable of generating images
from text descriptions. The FP8 version uses reduced precision numerics for 2x
faster inference.See our
Playground
to quickly try it out in your browser.
Specifies which format to return the response in. With image/png and
image/jpeg, the server will populate the response body with a binary image
of the specified format. With application/json, the server will populate the
response body with schema:
base64 contains a list of base64-encoded image files in PNG format. finishReason is SUCCESS unless
safety_check=true and the image response was filtered. seed is the seed
that was used when generating the image.
Enable a safety check for each response. If the safety check model detects unsafe content, the response will be filtered with Finish-Reason = CONTENT_FILTERED.
Copy
Ask AI
import requestsurl = "https://api.fireworks.ai/inference/v1/workflows/accounts/fireworks/models/flux-1-schnell-fp8/text_to_image"headers = { "Content-Type": "application/json", "Accept": "image/jpeg", "Authorization": "Bearer $API_KEY",}data = { "prompt": "A beautiful sunset over the ocean"}response = requests.post(url, headers=headers, json=data)if response.status_code == 200: with open("a.jpg", "wb") as f: f.write(response.content) print("Image saved as a.jpg")else: print("Error:", response.status_code, response.text)
Includes a base64-encoded string containing an image in PNG format.
To retrieve the image, base64-decode the string into binary data,
then load that binary data as a PNG file.
Can be SUCCESS or CONTENT_FILTERED.Specifies the outcome of the image generation process. It could be
SUCCESS indicating that the image was successfully generated, or
CONTENT_FILTERED if the image was filtered due to the safety_check=true
parameter being set.