Skip to content

Commit c1cf547

Browse files
kzamanbdakzmoudud
andauthored
feat: add Nano Banana Gemini image models (#61)
* feat: add Nano Banana Gemini image models - Relabel gemini-2.5-flash-image as "Nano Banana (gemini-2.5-flash-image)" - Add gemini-3.1-flash-image (Nano Banana 2) and gemini-3-pro-image (Nano Banana Pro), each labelled "Name (model-string)" - Default image model -> gemini-3.1-flash-image - Refactor image model config into a get_image_model_config() builder Related: getdokan/tryaura-pro#14 * feat: add .vscode to .gitignore for VSCode configuration * chore: bump version to 1.0.4 Update version across package.json, plugin header, Plugin.php ($version), and readme.txt Stable tag. --------- Co-authored-by: Moudud Ahmed <abdulkader225704@gmail.com>
1 parent 9c578b1 commit c1cf547

5 files changed

Lines changed: 109 additions & 87 deletions

File tree

inc/Common/Assets.php

Lines changed: 105 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -43,97 +43,119 @@ public function register_all_scripts() {
4343
* @return void
4444
*/
4545
public function localize_scripts() {
46+
$image_models = array(
47+
'gemini-2.5-flash-image' => __( 'Nano Banana (gemini-2.5-flash-image)', 'tryaura' ),
48+
'gemini-3.1-flash-image' => __( 'Nano Banana 2 (gemini-3.1-flash-image)', 'tryaura' ),
49+
'gemini-3-pro-image' => __( 'Nano Banana Pro (gemini-3-pro-image)', 'tryaura' ),
50+
);
51+
52+
$google_models = array();
53+
foreach ( $image_models as $model => $label ) {
54+
$google_models[ $model ] = $this->get_image_model_config( $label );
55+
}
56+
4657
$config = array(
4758
'aiProviders' => array(
48-
'google' => array(
49-
'gemini-2.5-flash-image' => array(
50-
'label' => __( 'gemini-2.5-flash-image', 'tryaura' ),
51-
'identity' => 'image',
52-
'inputTypes' => array( 'text', 'image' ),
53-
'outputTypes' => array( 'image' ),
54-
'supported' => true,
55-
'locked' => false,
56-
'capabilities' => array(
57-
'image' => array(
58-
'supported' => true,
59-
'locked' => false,
60-
),
61-
'prompt' => array(
62-
'supported' => true,
63-
'locked' => false,
64-
),
59+
'google' => $google_models,
60+
),
61+
'defaultProvider' => 'google',
62+
'defaultImageModel' => 'gemini-3.1-flash-image',
63+
);
64+
65+
wp_localize_script( 'tryaura-ai-models', 'tryAuraAiProviderModels', apply_filters( 'tryaura_ai_models', $config ) );
66+
}
67+
68+
/**
69+
* Get the shared configuration for a Gemini image model.
70+
*
71+
* @since 1.0.4
72+
*
73+
* @param string $label Display label shown in the model dropdown.
74+
*
75+
* @return array
76+
*/
77+
private function get_image_model_config( $label ) {
78+
return array(
79+
'label' => $label,
80+
'identity' => 'image',
81+
'inputTypes' => array( 'text', 'image' ),
82+
'outputTypes' => array( 'image' ),
83+
'supported' => true,
84+
'locked' => false,
85+
'capabilities' => array(
86+
'image' => array(
87+
'supported' => true,
88+
'locked' => false,
89+
),
90+
'prompt' => array(
91+
'supported' => true,
92+
'locked' => false,
93+
),
94+
),
95+
'parameters' => array(
96+
'aspectRatio' => array(
97+
'supported' => true,
98+
'locked' => false,
99+
'default' => '1:1',
100+
'values' => array(
101+
array(
102+
'label' => __( '1:1', 'tryaura' ),
103+
'value' => '1:1',
104+
'locked' => false,
105+
),
106+
array(
107+
'label' => __( '16:9', 'tryaura' ),
108+
'value' => '16:9',
109+
'locked' => false,
110+
),
111+
array(
112+
'label' => __( '9:16', 'tryaura' ),
113+
'value' => '9:16',
114+
'locked' => false,
115+
),
116+
array(
117+
'label' => __( '4:3', 'tryaura' ),
118+
'value' => '4:3',
119+
'locked' => false,
120+
),
121+
array(
122+
'label' => __( '3:4', 'tryaura' ),
123+
'value' => '3:4',
124+
'locked' => false,
125+
),
126+
),
127+
),
128+
'personGeneration' => array(
129+
'supported' => true,
130+
'locked' => false,
131+
'default' => 'allow_adult',
132+
'values' => array(
133+
array(
134+
'label' => __( 'Allow Adult', 'tryaura' ),
135+
'value' => 'allow_adult',
136+
'locked' => false,
65137
),
66-
'parameters' => array(
67-
'aspectRatio' => array(
68-
'supported' => true,
69-
'locked' => false,
70-
'default' => '1:1',
71-
'values' => array(
72-
array(
73-
'label' => __( '1:1', 'tryaura' ),
74-
'value' => '1:1',
75-
'locked' => false,
76-
),
77-
array(
78-
'label' => __( '16:9', 'tryaura' ),
79-
'value' => '16:9',
80-
'locked' => false,
81-
),
82-
array(
83-
'label' => __( '9:16', 'tryaura' ),
84-
'value' => '9:16',
85-
'locked' => false,
86-
),
87-
array(
88-
'label' => __( '4:3', 'tryaura' ),
89-
'value' => '4:3',
90-
'locked' => false,
91-
),
92-
array(
93-
'label' => __( '3:4', 'tryaura' ),
94-
'value' => '3:4',
95-
'locked' => false,
96-
),
97-
),
98-
),
99-
'personGeneration' => array(
100-
'supported' => true,
101-
'locked' => false,
102-
'default' => 'allow_adult',
103-
'values' => array(
104-
array(
105-
'label' => __( 'Allow Adult', 'tryaura' ),
106-
'value' => 'allow_adult',
107-
'locked' => false,
108-
),
109-
array(
110-
'label' => __( 'Disallow', 'tryaura' ),
111-
'value' => 'disallow',
112-
'locked' => false,
113-
),
114-
),
115-
),
116-
'candidateCount' => array(
117-
'supported' => true,
118-
'locked' => false,
119-
'default' => '1',
120-
'values' => array(
121-
array(
122-
'label' => __( '1 image', 'tryaura' ),
123-
'value' => '1',
124-
'locked' => false,
125-
),
126-
),
127-
),
138+
array(
139+
'label' => __( 'Disallow', 'tryaura' ),
140+
'value' => 'disallow',
141+
'locked' => false,
142+
),
143+
),
144+
),
145+
'candidateCount' => array(
146+
'supported' => true,
147+
'locked' => false,
148+
'default' => '1',
149+
'values' => array(
150+
array(
151+
'label' => __( '1 image', 'tryaura' ),
152+
'value' => '1',
153+
'locked' => false,
128154
),
129155
),
130156
),
131157
),
132-
'defaultProvider' => 'google',
133-
'defaultImageModel' => 'gemini-2.5-flash-image',
134158
);
135-
136-
wp_localize_script( 'tryaura-ai-models', 'tryAuraAiProviderModels', apply_filters( 'tryaura_ai_models', $config ) );
137159
}
138160

139161
/**

inc/Plugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class Plugin {
2222
*
2323
* @var string
2424
*/
25-
private $version = '1.0.3';
25+
private $version = '1.0.4';
2626
private Container $container;
2727

2828
/**

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tryaura",
3-
"version": "1.0.3",
3+
"version": "1.0.4",
44
"description": "an AI-powered virtual try-on and content creation platform built for fashion and eCommerce.",
55
"private": true,
66
"main": "index.js",

readme.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Requires at least: 6.6
55
Tested up to: 6.9.4
66
WC tested up to: 10.7.0
77
Requires PHP: 7.4
8-
Stable tag: 1.0.3
8+
Stable tag: 1.0.4
99
License: GPLv2 or later
1010
License URI: https://www.gnu.org/licenses/gpl-2.0.html
1111

tryaura.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* Plugin Name: TryAura: AI Virtual Try-On, Product Visualization & Product Videos for WooCommerce
44
* Description: TryAura is an AI-powered virtual try-on and content creation platform built for fashion and eCommerce. With seamless WooCommerce integration, it allows brands and shoppers to instantly visualize clothing on models, customers, or in any scene — without costly photoshoots. From product images to lifestyle videos, TryAura helps online stores boost engagement, reduce returns, and elevate their shopping experience with cutting-edge AI.
5-
* Version: 1.0.3
5+
* Version: 1.0.4
66
* Requires at least: 6.6
77
* Requires PHP: 7.4
88
* Author: weDevs

0 commit comments

Comments
 (0)