feat: extend model picker to image model (Cloudflare FLUX)
Apply the same interactive model picker UI to the image model field. Since Cloudflare models don't come from OpenRouter's registry, the two FLUX models are embedded as static data in the page config and the JS popup renders cost-per-image instead of token pricing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -80,6 +80,33 @@ class PRAutoBlogger_Admin_Page {
|
||||
'generateText' => __( 'Generate Now', 'prautoblogger' ),
|
||||
'testingText' => __( 'Testing...', 'prautoblogger' ),
|
||||
'testText' => __( 'Test Connections', 'prautoblogger' ),
|
||||
// Static Cloudflare image models for the picker (no registry API for these).
|
||||
'cloudflareModels' => [
|
||||
[
|
||||
'id' => 'flux-1-schnell',
|
||||
'name' => 'FLUX.1 [schnell]',
|
||||
'provider' => 'cloudflare',
|
||||
'context_length' => 0,
|
||||
'input_price_per_m' => 0,
|
||||
'output_price_per_m' => 0,
|
||||
'cost_per_image' => 0.0007,
|
||||
'capabilities' => [ 'cloudflare_image' ],
|
||||
'deprecated' => false,
|
||||
'description' => __( 'Fast + cheap (4 steps). Default choice.', 'prautoblogger' ),
|
||||
],
|
||||
[
|
||||
'id' => 'flux-1-dev',
|
||||
'name' => 'FLUX.1 [dev]',
|
||||
'provider' => 'cloudflare',
|
||||
'context_length' => 0,
|
||||
'input_price_per_m' => 0,
|
||||
'output_price_per_m' => 0,
|
||||
'cost_per_image' => 0.0028,
|
||||
'capabilities' => [ 'cloudflare_image' ],
|
||||
'deprecated' => false,
|
||||
'description' => __( 'Higher quality (20 steps), ~4× cost.', 'prautoblogger' ),
|
||||
],
|
||||
],
|
||||
] );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user