Model Picker

Pick the FLUX model by the endpoint it's called at, each option saying what it's for and, if you charge per generation, what it costs.

In use

In the Playground's toolbar, each option priced for the run's image count and size. Models over the balance disable.

Lumen
CreateEditVideo
240 credits

Your image will appear here

Your image will appear here

Your image will appear here

Your image will appear here

16 credits

Installation

pnpm dlx shadcn@latest add https://mgp.paukraft.com/r/model-picker.json

ModelPicker

PropTypeDefault
value / defaultValuestring

The endpoint, e.g. "flux-3-image" for /v1/flux-3-image. Controlled with onValueChange.

—
onValueChange(value: string) => void

Called with the picked endpoint.

—
models{ value, label, description?, kind, cost? }[]

Options, in order. kind is "image" or "video"; cost is what a run costs your user, in your unit.

BFL_MODELS
balancenumber

What the user can spend. Models costing more are disabled.

Infinity
formatCost(cost: number) => ReactNode

Labels each option's cost: "4 credits", "$0.04". Defaults to Cost Badge's formatCredits.

formatCredits
disabledboolean

E.g. while a generation is in flight.

false

Pricing

Charging per generation? Costs are yours, not BFL's: map your prices onto the models from the run's settings, e.g. times the number of outputs, and pass the user's balance. The demo's balance of 20 disables FLUX 3 Video.

Parts

PropTypeDefault
ModelPickerItem{ model, formatCost? }

One option: its kind, name, what it's for and its cost.

—
BFL_MODELSModel[]

FLUX 3, FLUX.2 and Kontext; filter by kind or endpoint.

—