Setup
To get started, sign into Baseten with Truss and then install the Pythonrequests library.
Sign in to Baseten
Install requests
- dev
- schnell
black-forest-labs/FLUX.1-dev is a 12B-parameter diffusion transformer model.This preset serves FLUX.1 dev on H100 40GB, tuned for text-to-image throughput.Then create a file named You should see output similar to:Your model ID is the string after
Hardware
H100_40GB
Write the config
Create and move into the project directory:config.yaml and paste the following:config.yaml
Deploy
Push the config to Baseten:/models/ in the logs URL (abcd1234 in the example). Use it wherever you see {model_id} in the next section.Call the model
Your deployment exposes/predict. Replace {model_id} with your model ID and make sure BASETEN_API_KEY is set.The deployment returns the generated image as base64-encoded bytes. Decode the response to write the image to disk.- Python
- cURL
main.py