Working with BFL FLUX in Pixeltable

This notebook demonstrates how to use Black Forest Labs (BFL) FLUX models for image generation and editing through Pixeltable.

Providers · Notebook · Updated

Colab runs it in your browser. If it calls a model provider, it asks for that provider's API key in a cell.

What it covers

  • Text-to-Image Generation
  • Image Editing
  • Using Seeds for Reproducibility
  • Image Expansion (Outpainting)
  • Inpainting with Fill
  • Best Practices
  • Learn More

What it uses

Install
terminal
pip install pixeltable
Environment variables it names
BFL_API_KEY
Pixeltable calls
bfl.generate()bfl.edit()bfl.expand()bfl.fill()pxt.create_table()add_computed_column()insert()

A look at the code

working-with-bfl.ipynb
# Create a table for image generation
prompts_t = pxt.create_table(
'bfl_demo.prompts',
{'prompt': pxt.String, 'style': pxt.String},
if_exists='replace',
)
# Add a computed column that generates images from prompts
prompts_t.add_computed_column(
image=bfl.generate(
prompts_t.prompt, model='flux-pro-1.1', width=1024, height=1024
)
)

One cell of the notebook, copied as it is. Open it in Colab for the rest.

Browse all 103