Add Resolution for nano (#287)
This commit is contained in:
1 parent
fd28a14409
commit
513b8ba347
28 files changed
+530
-24
No files matched your search
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"type": "minor",
|
||||
"comment": "update nano resolution",
|
||||
"packageName": "@acedatacloud/nexior",
|
||||
"email": "cqc@cuiqingcai.com",
|
||||
"dependentChangeType": "patch"
|
||||
}
|
||||
@@ -2,9 +2,10 @@
|
||||
<div class="flex flex-col h-full">
|
||||
<div class="flex-1 overflow-y-auto p-[15px]">
|
||||
<model-selector class="mb-4" />
|
||||
<resolution-selector class="mb-4" />
|
||||
<action-selector class="mb-4" />
|
||||
<prompt-input class="mb-4" />
|
||||
<aspect-ratio-selector v-if="config?.action === 'generate'" class="mb-4" />
|
||||
<aspect-ratio-selector class="mb-4" />
|
||||
<image-urls-input v-if="config?.action === 'edit'" class="mb-4" />
|
||||
</div>
|
||||
<div class="flex flex-col items-center justify-center px-[15px] pb-[15px]">
|
||||
@@ -28,6 +29,7 @@ import AspectRatioSelector from './config/AspectRatioSelector.vue';
|
||||
import Consumption from '../common/Consumption.vue';
|
||||
import { getConsumption } from '@/utils';
|
||||
import ModelSelector from './config/ModelSelector.vue';
|
||||
import ResolutionSelector from './config/ResolutionSelector.vue';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'ConfigPanel',
|
||||
@@ -39,7 +41,8 @@ export default defineComponent({
|
||||
ActionSelector,
|
||||
ImageUrlsInput,
|
||||
AspectRatioSelector,
|
||||
ModelSelector
|
||||
ModelSelector,
|
||||
ResolutionSelector
|
||||
},
|
||||
emits: ['generate'],
|
||||
computed: {
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
<template>
|
||||
<div class="field">
|
||||
<h2 class="title font-bold">{{ $t('nanobanana.name.task') }}</h2>
|
||||
<div class="label">
|
||||
<div class="box">
|
||||
<h2 class="title font-bold">{{ $t('nanobanana.name.task') }}</h2>
|
||||
<info-icon :content="actionDescription" class="info" />
|
||||
</div>
|
||||
</div>
|
||||
<el-select v-model="value" class="value" :placeholder="$t('nanobanana.placeholder.select')">
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
@@ -11,12 +16,14 @@
|
||||
import { defineComponent } from 'vue';
|
||||
import { ElSelect, ElOption } from 'element-plus';
|
||||
import { NANOBANANA_DEFAULT_ACTION } from '@/constants';
|
||||
import InfoIcon from '@/components/common/InfoIcon.vue';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'ActionSelector',
|
||||
components: {
|
||||
ElSelect,
|
||||
ElOption
|
||||
ElOption,
|
||||
InfoIcon
|
||||
},
|
||||
props: {
|
||||
modelValue: {
|
||||
@@ -50,6 +57,13 @@ export default defineComponent({
|
||||
action: val
|
||||
});
|
||||
}
|
||||
},
|
||||
actionDescription(): string {
|
||||
const fallback =
|
||||
'The action to generate the images. If generate, images are generated from the prompt; if edit, they are edited based on the prompt and uploaded images.';
|
||||
return (this as any).$te('nanobanana.description.action')
|
||||
? (this.$t('nanobanana.description.action') as string)
|
||||
: fallback;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -67,10 +81,25 @@ export default defineComponent({
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
margin: 0;
|
||||
.label {
|
||||
width: 30%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.box {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.info {
|
||||
margin-left: 6px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.value {
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
<template>
|
||||
<div class="field">
|
||||
<h2 class="title font-bold">{{ $t('nanobanana.name.model') }}</h2>
|
||||
<div class="label">
|
||||
<div class="box">
|
||||
<h2 class="title font-bold">{{ $t('nanobanana.name.model') }}</h2>
|
||||
<info-icon :content="modelDescription" class="info" />
|
||||
</div>
|
||||
</div>
|
||||
<el-select v-model="value" class="value" :placeholder="$t('nanobanana.placeholder.select')">
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
@@ -11,12 +16,14 @@
|
||||
import { defineComponent } from 'vue';
|
||||
import { ElSelect, ElOption } from 'element-plus';
|
||||
import { NANOBANANA_DEFAULT_MODEL, NANOBANANA_MODEL_NANO_BANANA, NANOBANANA_MODEL_NANO_BANANA_PRO } from '@/constants';
|
||||
import InfoIcon from '@/components/common/InfoIcon.vue';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'NanobananaModelSelector',
|
||||
components: {
|
||||
ElSelect,
|
||||
ElOption
|
||||
ElOption,
|
||||
InfoIcon
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -43,6 +50,9 @@ export default defineComponent({
|
||||
model: val
|
||||
});
|
||||
}
|
||||
},
|
||||
modelDescription(): string {
|
||||
return this.$t('nanobanana.description.model');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -60,10 +70,25 @@ export default defineComponent({
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
margin: 0;
|
||||
.label {
|
||||
width: 30%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.box {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.info {
|
||||
margin-left: 6px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.value {
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
<template>
|
||||
<div class="field">
|
||||
<div class="label">
|
||||
<div class="box">
|
||||
<h2 class="title font-bold">{{ $t('nanobanana.name.resolution') }}</h2>
|
||||
<info-icon :content="$t('nanobanana.description.resolutionProOnly')" class="info" />
|
||||
</div>
|
||||
</div>
|
||||
<el-select v-model="value" class="value" :placeholder="$t('nanobanana.placeholder.select')" :disabled="!isProModel">
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import { ElSelect, ElOption } from 'element-plus';
|
||||
import InfoIcon from '@/components/common/InfoIcon.vue';
|
||||
import {
|
||||
NANOBANANA_DEFAULT_RESOLUTION,
|
||||
NANOBANANA_MODEL_NANO_BANANA_PRO,
|
||||
NANOBANANA_RESOLUTION_1K,
|
||||
NANOBANANA_RESOLUTION_2K,
|
||||
NANOBANANA_RESOLUTION_4K
|
||||
} from '@/constants';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'NanobananaResolutionSelector',
|
||||
components: {
|
||||
ElSelect,
|
||||
ElOption,
|
||||
InfoIcon
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
cachedResolution: NANOBANANA_DEFAULT_RESOLUTION,
|
||||
options: [
|
||||
{
|
||||
value: NANOBANANA_RESOLUTION_1K,
|
||||
label: NANOBANANA_RESOLUTION_1K
|
||||
},
|
||||
{
|
||||
value: NANOBANANA_RESOLUTION_2K,
|
||||
label: NANOBANANA_RESOLUTION_2K
|
||||
},
|
||||
{
|
||||
value: NANOBANANA_RESOLUTION_4K,
|
||||
label: NANOBANANA_RESOLUTION_4K
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
value: {
|
||||
get() {
|
||||
return this.$store.state.nanobanana?.config?.resolution;
|
||||
},
|
||||
set(val: string) {
|
||||
this.$store.commit('nanobanana/setConfig', {
|
||||
...this.$store.state.nanobanana?.config,
|
||||
resolution: val
|
||||
});
|
||||
}
|
||||
},
|
||||
isProModel(): boolean {
|
||||
return this.$store.state.nanobanana?.config?.model === NANOBANANA_MODEL_NANO_BANANA_PRO;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
value(newVal: string) {
|
||||
if (this.isProModel && newVal) {
|
||||
this.cachedResolution = newVal;
|
||||
}
|
||||
},
|
||||
isProModel(newVal: boolean) {
|
||||
if (newVal) {
|
||||
if (!this.value) {
|
||||
this.value = this.cachedResolution || NANOBANANA_DEFAULT_RESOLUTION;
|
||||
}
|
||||
} else {
|
||||
if (this.value) {
|
||||
this.cachedResolution = this.value;
|
||||
}
|
||||
this.$store.commit('nanobanana/setConfig', {
|
||||
...this.$store.state.nanobanana?.config,
|
||||
resolution: undefined
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.isProModel && !this.value) {
|
||||
this.value = NANOBANANA_DEFAULT_RESOLUTION;
|
||||
}
|
||||
if (!this.isProModel && this.value) {
|
||||
this.cachedResolution = this.value;
|
||||
this.$store.commit('nanobanana/setConfig', {
|
||||
...this.$store.state.nanobanana?.config,
|
||||
resolution: undefined
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.field {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.label {
|
||||
width: 30%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.box {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.info {
|
||||
margin-left: 6px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.value {
|
||||
width: 160px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -45,12 +45,35 @@
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<el-alert :closable="false" class="mt-2 success">
|
||||
<p class="text-[var(--el-text-color-regular)] text-xs mb-0">
|
||||
<p v-if="modelValue?.request?.model" class="text-[var(--el-text-color-regular)] text-xs mb-2">
|
||||
<font-awesome-icon icon="fa-solid fa-cube" class="mr-1" />
|
||||
{{ $t('nanobanana.name.model') }}:
|
||||
{{ modelValue?.request?.model }}
|
||||
</p>
|
||||
<p v-if="modelValue?.request?.resolution" class="text-[var(--el-text-color-regular)] text-xs mb-2">
|
||||
<font-awesome-icon icon="fa-solid fa-image" class="mr-1" />
|
||||
{{ $t('nanobanana.name.resolution') }}:
|
||||
{{ modelValue?.request?.resolution }}
|
||||
</p>
|
||||
<p v-if="modelValue?.request?.action" class="text-[var(--el-text-color-regular)] text-xs mb-2">
|
||||
<font-awesome-icon icon="fa-solid fa-bolt" class="mr-1" />
|
||||
{{ $t('nanobanana.name.task') }}:
|
||||
{{
|
||||
modelValue?.request?.action === 'generate' ? $t('nanobanana.name.generate') : $t('nanobanana.name.edits')
|
||||
}}
|
||||
</p>
|
||||
<p class="text-[var(--el-text-color-regular)] text-xs mb-2">
|
||||
<font-awesome-icon icon="fa-solid fa-magic" class="mr-1" />
|
||||
{{ $t('nanobanana.name.taskId') }}:
|
||||
{{ modelValue?.id }}
|
||||
<copy-to-clipboard :content="modelValue?.id!" class="btn-copy inline-block" />
|
||||
</p>
|
||||
<p v-if="modelValue?.response?.trace_id" class="text-[var(--el-text-color-regular)] text-xs mb-0">
|
||||
<font-awesome-icon icon="fa-solid fa-hashtag" class="mr-1" />
|
||||
{{ $t('nanobanana.name.traceId') }}:
|
||||
{{ modelValue?.response?.trace_id }}
|
||||
<copy-to-clipboard :content="modelValue?.response?.trace_id" class="btn-copy inline-block" />
|
||||
</p>
|
||||
</el-alert>
|
||||
</div>
|
||||
<div v-if="modelValue?.response?.success === false" :class="{ content: true }">
|
||||
@@ -59,6 +82,23 @@
|
||||
<font-awesome-icon icon="fa-solid fa-exclamation-triangle" class="mr-1" />
|
||||
{{ $t('nanobanana.name.failure') }}
|
||||
</template>
|
||||
<p v-if="modelValue?.request?.model" class="text-[var(--el-text-color-regular)] text-xs mb-2">
|
||||
<font-awesome-icon icon="fa-solid fa-cube" class="mr-1" />
|
||||
{{ $t('nanobanana.name.model') }}:
|
||||
{{ modelValue?.request?.model }}
|
||||
</p>
|
||||
<p v-if="modelValue?.request?.resolution" class="text-[var(--el-text-color-regular)] text-xs mb-2">
|
||||
<font-awesome-icon icon="fa-solid fa-image" class="mr-1" />
|
||||
{{ $t('nanobanana.name.resolution') }}:
|
||||
{{ modelValue?.request?.resolution }}
|
||||
</p>
|
||||
<p v-if="modelValue?.request?.action" class="text-[var(--el-text-color-regular)] text-xs mb-2">
|
||||
<font-awesome-icon icon="fa-solid fa-bolt" class="mr-1" />
|
||||
{{ $t('nanobanana.name.task') }}:
|
||||
{{
|
||||
modelValue?.request?.action === 'generate' ? $t('nanobanana.name.generate') : $t('nanobanana.name.edits')
|
||||
}}
|
||||
</p>
|
||||
<p class="text-[var(--el-text-color-regular)] text-xs mb-2">
|
||||
<font-awesome-icon icon="fa-solid fa-magic" class="mr-1" />
|
||||
{{ $t('nanobanana.name.taskId') }}:
|
||||
@@ -85,7 +125,24 @@
|
||||
<font-awesome-icon icon="fa-solid fa-exclamation-triangle" class="mr-1" />
|
||||
{{ $t('nanobanana.name.failure') }}
|
||||
</template>
|
||||
<p class="text-[var(--el-text-color-regular)] text-xs mb-0">
|
||||
<p v-if="modelValue?.request?.model" class="text-[var(--el-text-color-regular)] text-xs mb-2">
|
||||
<font-awesome-icon icon="fa-solid fa-cube" class="mr-1" />
|
||||
{{ $t('nanobanana.name.model') }}:
|
||||
{{ modelValue?.request?.model }}
|
||||
</p>
|
||||
<p v-if="modelValue?.request?.resolution" class="text-[var(--el-text-color-regular)] text-xs mb-2">
|
||||
<font-awesome-icon icon="fa-solid fa-image" class="mr-1" />
|
||||
{{ $t('nanobanana.name.resolution') }}:
|
||||
{{ modelValue?.request?.resolution }}
|
||||
</p>
|
||||
<p v-if="modelValue?.request?.action" class="text-[var(--el-text-color-regular)] text-xs mb-2">
|
||||
<font-awesome-icon icon="fa-solid fa-bolt" class="mr-1" />
|
||||
{{ $t('nanobanana.name.task') }}:
|
||||
{{
|
||||
modelValue?.request?.action === 'generate' ? $t('nanobanana.name.generate') : $t('nanobanana.name.edits')
|
||||
}}
|
||||
</p>
|
||||
<p class="text-[var(--el-text-color-regular)] text-xs mb-2">
|
||||
<font-awesome-icon icon="fa-solid fa-magic" class="mr-1" />
|
||||
{{ $t('nanobanana.name.taskId') }}:
|
||||
{{ modelValue?.id }}
|
||||
|
||||
@@ -4,6 +4,11 @@ export const NANOBANANA_DEFAULT_ACTION: 'generate' | 'edit' = 'generate';
|
||||
|
||||
export const NANOBANANA_DEFAULT_ASPECT_RATIO = '1:1';
|
||||
|
||||
export const NANOBANANA_RESOLUTION_1K = '1K';
|
||||
export const NANOBANANA_RESOLUTION_2K = '2K';
|
||||
export const NANOBANANA_RESOLUTION_4K = '4K';
|
||||
export const NANOBANANA_DEFAULT_RESOLUTION = NANOBANANA_RESOLUTION_1K;
|
||||
|
||||
export const NANOBANANA_MODEL_NANO_BANANA = 'nano-banana';
|
||||
export const NANOBANANA_MODEL_NANO_BANANA_PRO = 'nano-banana-pro';
|
||||
|
||||
|
||||
@@ -47,10 +47,22 @@
|
||||
"message": "نسبة العرض إلى الارتفاع",
|
||||
"description": "نسبة العرض إلى الارتفاع للصورة المولدة"
|
||||
},
|
||||
"name.resolution": {
|
||||
"message": "الدقة",
|
||||
"description": "دقة الصورة المولدة"
|
||||
},
|
||||
"description.resolutionProOnly": {
|
||||
"message": "اختيار الدقة متاح فقط لنموذج nano-banana-pro.",
|
||||
"description": "إعداد الدقة يسري على نموذج البرو فقط"
|
||||
},
|
||||
"description.prompt": {
|
||||
"message": "نص التوليد أو التحرير للصورة",
|
||||
"description": "وصف نص التلميح"
|
||||
},
|
||||
"description.model": {
|
||||
"message": "النموذج المستخدم لتوليد الصور. الافتراضي هو nano-banana. nano-banana-pro هو اسم مستعار لـ gemini-3-pro-image، و nano-banana هو اسم مستعار لـ gemini-2.5-flash-image.",
|
||||
"description": "وصف حقل النموذج"
|
||||
},
|
||||
"description.imageUrls": {
|
||||
"message": "يجب تحميل 1-5 صور في مهمة تحرير الصورة.",
|
||||
"description": "وصف معلمة image_urls"
|
||||
|
||||
@@ -47,10 +47,22 @@
|
||||
"message": "Seitenverhältnis",
|
||||
"description": "Seitenverhältnis des generierten Bildes"
|
||||
},
|
||||
"name.resolution": {
|
||||
"message": "Auflösung",
|
||||
"description": "Auflösung des generierten Bildes"
|
||||
},
|
||||
"description.resolutionProOnly": {
|
||||
"message": "Nur das Modell nano-banana-pro unterstützt die Auswahl der Auflösung.",
|
||||
"description": "Die Auflösung gilt nur für das Pro-Modell"
|
||||
},
|
||||
"description.prompt": {
|
||||
"message": "Aufforderungswörter zum Erstellen oder Bearbeiten von Bildern",
|
||||
"description": "Beschreibung der Aufforderungswörter"
|
||||
},
|
||||
"description.model": {
|
||||
"message": "Das Modell zum Generieren der Bilder. Standard ist nano-banana. nano-banana-pro ist ein Alias für gemini-3-pro-image, nano-banana ist ein Alias für gemini-2.5-flash-image.",
|
||||
"description": "Beschreibung des Modell-Parameters"
|
||||
},
|
||||
"description.imageUrls": {
|
||||
"message": "Es müssen 1-5 Bilder für die Bildbearbeitungsaufgabe hochgeladen werden.",
|
||||
"description": "Erläuterung des Parameters image_urls"
|
||||
|
||||
@@ -47,10 +47,22 @@
|
||||
"message": "Αναλογία διαστάσεων",
|
||||
"description": "Αναλογία διαστάσεων της παραγόμενης εικόνας"
|
||||
},
|
||||
"name.resolution": {
|
||||
"message": "Ανάλυση",
|
||||
"description": "Ανάλυση της παραγόμενης εικόνας"
|
||||
},
|
||||
"description.resolutionProOnly": {
|
||||
"message": "Η επιλογή ανάλυσης ισχύει μόνο για το μοντέλο nano-banana-pro.",
|
||||
"description": "Η ρύθμιση ανάλυσης εφαρμόζεται μόνο στο μοντέλο pro"
|
||||
},
|
||||
"description.prompt": {
|
||||
"message": "Λέξεις-κλειδιά για δημιουργία ή επεξεργασία εικόνας",
|
||||
"description": "Περιγραφή λέξεων-κλειδιών"
|
||||
},
|
||||
"description.model": {
|
||||
"message": "Το μοντέλο που χρησιμοποιείται για τη δημιουργία των εικόνων. Προεπιλεγμένο το nano-banana. Το nano-banana-pro είναι ψευδώνυμο του gemini-3-pro-image, το nano-banana είναι ψευδώνυμο του gemini-2.5-flash-image.",
|
||||
"description": "Περιγραφή της παραμέτρου model"
|
||||
},
|
||||
"description.imageUrls": {
|
||||
"message": "Πρέπει να ανεβάσετε 1-5 εικόνες για την εργασία επεξεργασίας εικόνας.",
|
||||
"description": "Περιγραφή παραμέτρου image_urls"
|
||||
|
||||
@@ -47,10 +47,26 @@
|
||||
"message": "Aspect Ratio",
|
||||
"description": "Aspect ratio of the generated image"
|
||||
},
|
||||
"name.resolution": {
|
||||
"message": "Resolution",
|
||||
"description": "Resolution of the generated image"
|
||||
},
|
||||
"description.resolutionProOnly": {
|
||||
"message": "Only nano-banana-pro supports resolution selection.",
|
||||
"description": "Resolution setting applies to the pro model only"
|
||||
},
|
||||
"description.prompt": {
|
||||
"message": "Prompt words for generating or editing images",
|
||||
"description": "Description of the prompt words"
|
||||
},
|
||||
"description.action": {
|
||||
"message": "The action to generate the images. If `generate`, images are generated from the prompt; if `edit`, they are edited based on the prompt and uploaded images.",
|
||||
"description": "Description of the action parameter"
|
||||
},
|
||||
"description.model": {
|
||||
"message": "The model used to generate the images. Default is nano-banana. nano-banana-pro is an alias of gemini-3-pro-image; nano-banana is an alias of gemini-2.5-flash-image.",
|
||||
"description": "Description of the model parameter"
|
||||
},
|
||||
"description.imageUrls": {
|
||||
"message": "You must upload 1-5 images for the edit image task.",
|
||||
"description": "Description of the image_urls parameter"
|
||||
|
||||
@@ -47,10 +47,22 @@
|
||||
"message": "Relación de aspecto",
|
||||
"description": "Relación de aspecto de la imagen generada"
|
||||
},
|
||||
"name.resolution": {
|
||||
"message": "Resolución",
|
||||
"description": "Resolución de la imagen generada"
|
||||
},
|
||||
"description.resolutionProOnly": {
|
||||
"message": "Solo el modelo nano-banana-pro admite elegir resolución.",
|
||||
"description": "La configuración de resolución aplica solo al modelo pro"
|
||||
},
|
||||
"description.prompt": {
|
||||
"message": "Palabras clave para generar o editar imágenes",
|
||||
"description": "Descripción de las palabras clave"
|
||||
},
|
||||
"description.model": {
|
||||
"message": "El modelo usado para generar las imágenes. El valor predeterminado es nano-banana. nano-banana-pro es un alias de gemini-3-pro-image; nano-banana es un alias de gemini-2.5-flash-image.",
|
||||
"description": "Descripción del parámetro model"
|
||||
},
|
||||
"description.imageUrls": {
|
||||
"message": "Se deben subir de 1 a 5 imágenes en la tarea de edición de imágenes.",
|
||||
"description": "Descripción del parámetro image_urls"
|
||||
|
||||
@@ -47,10 +47,22 @@
|
||||
"message": "Kuvan kuvasuhde",
|
||||
"description": "Luotavan kuvan kuvasuhde"
|
||||
},
|
||||
"name.resolution": {
|
||||
"message": "Resoluutio",
|
||||
"description": "Luodun kuvan resoluutio"
|
||||
},
|
||||
"description.resolutionProOnly": {
|
||||
"message": "Resoluutio toimii vain nano-banana-pro -mallilla.",
|
||||
"description": "Resoluutioasetus koskee vain pro-mallia"
|
||||
},
|
||||
"description.prompt": {
|
||||
"message": "Luodun tai muokatun kuvan ohjeet",
|
||||
"description": "Ohjeiden kuvaus"
|
||||
},
|
||||
"description.model": {
|
||||
"message": "Malli, jolla kuvat luodaan. Oletuksena nano-banana. nano-banana-pro on alias gemini-3-pro-image -mallille, nano-banana on alias gemini-2.5-flash-image -mallille.",
|
||||
"description": "Malliparametrin kuvaus"
|
||||
},
|
||||
"description.imageUrls": {
|
||||
"message": "Muokkaustehtävässä on ladattava 1-5 kuvaa.",
|
||||
"description": "image_urls-parametrin selitys"
|
||||
|
||||
@@ -47,10 +47,22 @@
|
||||
"message": "Ratio d'aspect",
|
||||
"description": "Ratio d'aspect de l'image générée"
|
||||
},
|
||||
"name.resolution": {
|
||||
"message": "Résolution",
|
||||
"description": "Résolution de l'image générée"
|
||||
},
|
||||
"description.resolutionProOnly": {
|
||||
"message": "Seul le modèle nano-banana-pro prend en charge le choix de la résolution.",
|
||||
"description": "Le réglage de la résolution s'applique uniquement au modèle pro"
|
||||
},
|
||||
"description.prompt": {
|
||||
"message": "Mots d'invite pour générer ou éditer une image",
|
||||
"description": "Description des mots d'invite"
|
||||
},
|
||||
"description.model": {
|
||||
"message": "Le modèle utilisé pour générer les images. Par défaut : nano-banana. nano-banana-pro est un alias de gemini-3-pro-image ; nano-banana est un alias de gemini-2.5-flash-image.",
|
||||
"description": "Description du paramètre model"
|
||||
},
|
||||
"description.imageUrls": {
|
||||
"message": "Vous devez télécharger de 1 à 5 images pour la tâche d'édition d'image.",
|
||||
"description": "Description du paramètre image_urls"
|
||||
|
||||
@@ -47,10 +47,22 @@
|
||||
"message": "Rapporto d'aspetto",
|
||||
"description": "Rapporto d'aspetto dell'immagine generata"
|
||||
},
|
||||
"name.resolution": {
|
||||
"message": "Risoluzione",
|
||||
"description": "Risoluzione dell'immagine generata"
|
||||
},
|
||||
"description.resolutionProOnly": {
|
||||
"message": "Solo il modello nano-banana-pro supporta la scelta della risoluzione.",
|
||||
"description": "L'impostazione della risoluzione vale solo per il modello pro"
|
||||
},
|
||||
"description.prompt": {
|
||||
"message": "Parole chiave per generare o modificare l'immagine",
|
||||
"description": "Descrizione delle parole chiave"
|
||||
},
|
||||
"description.model": {
|
||||
"message": "Il modello usato per generare le immagini. Il predefinito è nano-banana. nano-banana-pro è un alias di gemini-3-pro-image; nano-banana è un alias di gemini-2.5-flash-image.",
|
||||
"description": "Descrizione del parametro model"
|
||||
},
|
||||
"description.imageUrls": {
|
||||
"message": "È necessario caricare da 1 a 5 immagini per il compito di modifica dell'immagine.",
|
||||
"description": "Descrizione del parametro image_urls"
|
||||
|
||||
@@ -47,10 +47,22 @@
|
||||
"message": "アスペクト比",
|
||||
"description": "生成画像のアスペクト比"
|
||||
},
|
||||
"name.resolution": {
|
||||
"message": "解像度",
|
||||
"description": "生成画像の解像度"
|
||||
},
|
||||
"description.resolutionProOnly": {
|
||||
"message": "解像度の指定は nano-banana-pro モデルでのみ有効です。",
|
||||
"description": "解像度設定はプロモデル専用"
|
||||
},
|
||||
"description.prompt": {
|
||||
"message": "画像を生成または編集するためのプロンプト",
|
||||
"description": "プロンプトの説明"
|
||||
},
|
||||
"description.model": {
|
||||
"message": "画像生成に使用するモデル。デフォルトは nano-banana。nano-banana-pro は gemini-3-pro-image の別名、nano-banana は gemini-2.5-flash-image の別名です。",
|
||||
"description": "model パラメータの説明"
|
||||
},
|
||||
"description.imageUrls": {
|
||||
"message": "画像編集タスクでは、1〜5枚の画像をアップロードする必要があります。",
|
||||
"description": "image_urls パラメータの説明"
|
||||
|
||||
@@ -47,10 +47,22 @@
|
||||
"message": "가로 세로 비율",
|
||||
"description": "생성된 이미지의 가로 세로 비율"
|
||||
},
|
||||
"name.resolution": {
|
||||
"message": "해상도",
|
||||
"description": "생성된 이미지의 해상도"
|
||||
},
|
||||
"description.resolutionProOnly": {
|
||||
"message": "해상도 설정은 nano-banana-pro 모델에서만 적용됩니다.",
|
||||
"description": "해상도 옵션은 프로 모델에만 해당"
|
||||
},
|
||||
"description.prompt": {
|
||||
"message": "이미지를 생성하거나 편집하기 위한 프롬프트",
|
||||
"description": "프롬프트 설명"
|
||||
},
|
||||
"description.model": {
|
||||
"message": "이미지 생성에 사용되는 모델입니다. 기본값은 nano-banana입니다. nano-banana-pro는 gemini-3-pro-image의 별칭이고, nano-banana는 gemini-2.5-flash-image의 별칭입니다.",
|
||||
"description": "model 파라미터 설명"
|
||||
},
|
||||
"description.imageUrls": {
|
||||
"message": "이미지 편집 작업에서는 1-5장의 이미지를 업로드해야 합니다.",
|
||||
"description": "image_urls 매개변수 설명"
|
||||
|
||||
@@ -47,10 +47,22 @@
|
||||
"message": "Proporcje",
|
||||
"description": "Proporcje generowanego obrazu"
|
||||
},
|
||||
"name.resolution": {
|
||||
"message": "Rozdzielczość",
|
||||
"description": "Rozdzielczość generowanego obrazu"
|
||||
},
|
||||
"description.resolutionProOnly": {
|
||||
"message": "Tylko model nano-banana-pro obsługuje wybór rozdzielczości.",
|
||||
"description": "Ustawienie rozdzielczości dotyczy tylko modelu pro"
|
||||
},
|
||||
"description.prompt": {
|
||||
"message": "Słowa kluczowe do generowania lub edytowania obrazu",
|
||||
"description": "Opis słów kluczowych"
|
||||
},
|
||||
"description.model": {
|
||||
"message": "Model używany do generowania obrazów. Domyślnie nano-banana. nano-banana-pro to alias gemini-3-pro-image, a nano-banana to alias gemini-2.5-flash-image.",
|
||||
"description": "Opis parametru model"
|
||||
},
|
||||
"description.imageUrls": {
|
||||
"message": "W zadaniu edycji obrazu należy przesłać od 1 do 5 obrazów.",
|
||||
"description": "Opis parametru image_urls"
|
||||
|
||||
@@ -47,10 +47,22 @@
|
||||
"message": "Proporção",
|
||||
"description": "Proporção da imagem gerada"
|
||||
},
|
||||
"name.resolution": {
|
||||
"message": "Resolução",
|
||||
"description": "Resolução da imagem gerada"
|
||||
},
|
||||
"description.resolutionProOnly": {
|
||||
"message": "Apenas o modelo nano-banana-pro suporta escolher a resolução.",
|
||||
"description": "A configuração de resolução vale somente para o modelo pro"
|
||||
},
|
||||
"description.prompt": {
|
||||
"message": "Palavras-chave para gerar ou editar a imagem",
|
||||
"description": "Descrição das palavras-chave"
|
||||
},
|
||||
"description.model": {
|
||||
"message": "O modelo usado para gerar as imagens. Padrão: nano-banana. nano-banana-pro é um alias de gemini-3-pro-image; nano-banana é um alias de gemini-2.5-flash-image.",
|
||||
"description": "Descrição do parâmetro model"
|
||||
},
|
||||
"description.imageUrls": {
|
||||
"message": "É necessário enviar de 1 a 5 imagens na tarefa de edição de imagem.",
|
||||
"description": "Descrição do parâmetro image_urls"
|
||||
|
||||
@@ -47,10 +47,22 @@
|
||||
"message": "Соотношение сторон",
|
||||
"description": "Соотношение сторон генерируемого изображения"
|
||||
},
|
||||
"name.resolution": {
|
||||
"message": "Разрешение",
|
||||
"description": "Разрешение сгенерированного изображения"
|
||||
},
|
||||
"description.resolutionProOnly": {
|
||||
"message": "Выбор разрешения действует только для модели nano-banana-pro.",
|
||||
"description": "Настройка разрешения применяется только к pro-модели"
|
||||
},
|
||||
"description.prompt": {
|
||||
"message": "Подсказка для генерации или редактирования изображения",
|
||||
"description": "Описание подсказки"
|
||||
},
|
||||
"description.model": {
|
||||
"message": "Модель, используемая для генерации изображений. По умолчанию nano-banana. nano-banana-pro — алиас gemini-3-pro-image, nano-banana — алиас gemini-2.5-flash-image.",
|
||||
"description": "Описание параметра model"
|
||||
},
|
||||
"description.imageUrls": {
|
||||
"message": "В задаче редактирования изображения необходимо загрузить от 1 до 5 изображений.",
|
||||
"description": "Описание параметра image_urls"
|
||||
|
||||
@@ -47,10 +47,22 @@
|
||||
"message": "Odnos širine i visine",
|
||||
"description": "Odnos širine i visine generisane slike"
|
||||
},
|
||||
"name.resolution": {
|
||||
"message": "Rezolucija",
|
||||
"description": "Rezolucija generisane slike"
|
||||
},
|
||||
"description.resolutionProOnly": {
|
||||
"message": "Samo model nano-banana-pro podržava izbor rezolucije.",
|
||||
"description": "Podešavanje rezolucije važi samo za pro model"
|
||||
},
|
||||
"description.prompt": {
|
||||
"message": "Reči za generisanje ili uređivanje slike",
|
||||
"description": "Opis reči za uputstvo"
|
||||
},
|
||||
"description.model": {
|
||||
"message": "Model koji se koristi za generisanje slika. Podrazumevano je nano-banana. nano-banana-pro je alias za gemini-3-pro-image, a nano-banana je alias za gemini-2.5-flash-image.",
|
||||
"description": "Opis parametra model"
|
||||
},
|
||||
"description.imageUrls": {
|
||||
"message": "U zadatku za uređivanje slika potrebno je otpremiti 1-5 slika.",
|
||||
"description": "Objašnjenje parametra image_urls"
|
||||
|
||||
@@ -47,10 +47,22 @@
|
||||
"message": "Bildförhållande",
|
||||
"description": "Bildförhållandet för den genererade bilden"
|
||||
},
|
||||
"name.resolution": {
|
||||
"message": "Upplösning",
|
||||
"description": "Upplösning för den genererade bilden"
|
||||
},
|
||||
"description.resolutionProOnly": {
|
||||
"message": "Endast modellen nano-banana-pro stöder val av upplösning.",
|
||||
"description": "Upplösningsinställningen gäller bara pro-modellen"
|
||||
},
|
||||
"description.prompt": {
|
||||
"message": "Promptord för att generera eller redigera bilden",
|
||||
"description": "Beskrivning av promptord"
|
||||
},
|
||||
"description.model": {
|
||||
"message": "Modellen som används för att generera bilderna. Standard är nano-banana. nano-banana-pro är ett alias för gemini-3-pro-image, nano-banana är ett alias för gemini-2.5-flash-image.",
|
||||
"description": "Beskrivning av model-parametern"
|
||||
},
|
||||
"description.imageUrls": {
|
||||
"message": "Du måste ladda upp 1-5 bilder i redigeringsuppgiften.",
|
||||
"description": "Beskrivning av image_urls parametern"
|
||||
|
||||
@@ -47,10 +47,22 @@
|
||||
"message": "Співвідношення сторін",
|
||||
"description": "Співвідношення сторін для створюваного зображення"
|
||||
},
|
||||
"name.resolution": {
|
||||
"message": "Роздільна здатність",
|
||||
"description": "Роздільна здатність згенерованого зображення"
|
||||
},
|
||||
"description.resolutionProOnly": {
|
||||
"message": "Вибір роздільної здатності працює лише для моделі nano-banana-pro.",
|
||||
"description": "Налаштування роздільної здатності діє тільки для pro-моделі"
|
||||
},
|
||||
"description.prompt": {
|
||||
"message": "Слова підказки для створення або редагування зображення",
|
||||
"description": "Опис підказки"
|
||||
},
|
||||
"description.model": {
|
||||
"message": "Модель, що використовується для генерації зображень. За замовчуванням nano-banana. nano-banana-pro — псевдонім gemini-3-pro-image, nano-banana — псевдонім gemini-2.5-flash-image.",
|
||||
"description": "Опис параметра model"
|
||||
},
|
||||
"description.imageUrls": {
|
||||
"message": "У завданні редагування зображення потрібно завантажити 1-5 зображень.",
|
||||
"description": "Опис параметра image_urls"
|
||||
|
||||
@@ -47,10 +47,26 @@
|
||||
"message": "宽高比",
|
||||
"description": "生成图像的宽高比"
|
||||
},
|
||||
"name.resolution": {
|
||||
"message": "分辨率",
|
||||
"description": "生成图像的分辨率"
|
||||
},
|
||||
"description.resolutionProOnly": {
|
||||
"message": "仅 nano-banana-pro 支持分辨率设置。",
|
||||
"description": "分辨率选项仅对 pro 模型生效"
|
||||
},
|
||||
"description.prompt": {
|
||||
"message": "生成或编辑图像的提示词",
|
||||
"description": "提示词描述"
|
||||
},
|
||||
"description.action": {
|
||||
"message": "生成图片的动作。如果为 `generate`,将根据提示词生成图片;如果为 `edit`,则会基于提示词和上传的图片进行编辑。",
|
||||
"description": "action 参数说明"
|
||||
},
|
||||
"description.model": {
|
||||
"message": "用于生成图片的模型。默认是 nano-banana。nano-banana-pro 是 gemini-3-pro-image 的别名,nano-banana 是 gemini-2.5-flash-image 的别名。",
|
||||
"description": "model 参数说明"
|
||||
},
|
||||
"description.imageUrls": {
|
||||
"message": "在编辑图片任务中必须上传 1-5 张图片。",
|
||||
"description": "image_urls 参数说明"
|
||||
@@ -68,7 +84,7 @@
|
||||
"description": "选择占位"
|
||||
},
|
||||
"placeholder.prompt": {
|
||||
"message": "输入提示词,例如:a white siamese cat",
|
||||
"message": "输入提示词,例如:一只白色的暹罗猫",
|
||||
"description": "提示占位"
|
||||
},
|
||||
"button.generate": {
|
||||
@@ -104,15 +120,15 @@
|
||||
"description": "上传失败"
|
||||
},
|
||||
"name.model": {
|
||||
"message": "Model",
|
||||
"description": "Nano Banana model selector label"
|
||||
"message": "模型",
|
||||
"description": "Nano Banana 模型选择标签"
|
||||
},
|
||||
"model.nanoBanana": {
|
||||
"message": "nano-banana",
|
||||
"description": "Nano Banana base model option"
|
||||
"description": "Nano Banana 基础模型选项"
|
||||
},
|
||||
"model.nanoBananaPro": {
|
||||
"message": "nano-banana-pro",
|
||||
"description": "Nano Banana pro model option"
|
||||
"description": "Nano Banana 专业模型选项"
|
||||
}
|
||||
}
|
||||
@@ -47,10 +47,26 @@
|
||||
"message": "寬高比",
|
||||
"description": "生成圖像的寬高比"
|
||||
},
|
||||
"name.resolution": {
|
||||
"message": "解析度",
|
||||
"description": "生成圖像的解析度"
|
||||
},
|
||||
"description.resolutionProOnly": {
|
||||
"message": "僅 nano-banana-pro 支援設定解析度。",
|
||||
"description": "解析度選項僅對 pro 模型生效"
|
||||
},
|
||||
"description.prompt": {
|
||||
"message": "生成或編輯圖像的提示詞",
|
||||
"description": "提示詞描述"
|
||||
},
|
||||
"description.action": {
|
||||
"message": "生成圖片的動作。如果為 `generate`,將根據提示詞生成圖片;如果為 `edit`,則會基於提示詞與上傳的圖片進行編輯。",
|
||||
"description": "action 參數說明"
|
||||
},
|
||||
"description.model": {
|
||||
"message": "用於生成圖片的模型。預設為 nano-banana。nano-banana-pro 是 gemini-3-pro-image 的別名,nano-banana 是 gemini-2.5-flash-image 的別名。",
|
||||
"description": "model 參數說明"
|
||||
},
|
||||
"description.imageUrls": {
|
||||
"message": "在編輯圖片任務中必須上傳 1-5 張圖片。",
|
||||
"description": "image_urls 參數說明"
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
export interface INanobananaConfig {
|
||||
action?: 'generate' | 'edit';
|
||||
model?: string;
|
||||
prompt?: string;
|
||||
image_urls?: string[];
|
||||
aspect_ratio?: string;
|
||||
resolution?: string;
|
||||
callback_url?: string;
|
||||
model?: string;
|
||||
}
|
||||
|
||||
export interface INanobananaGenerateRequest {
|
||||
@@ -13,6 +14,7 @@ export interface INanobananaGenerateRequest {
|
||||
prompt?: string;
|
||||
image_urls?: string[];
|
||||
aspect_ratio?: string;
|
||||
resolution?: string;
|
||||
callback_url?: string;
|
||||
mirror?: boolean;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ import ConfigPanel from '@/components/nanobanana/ConfigPanel.vue';
|
||||
import { nanobananaOperator } from '@/operators';
|
||||
import { INanobananaGenerateRequest, Status } from '@/models';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { ERROR_CODE_USED_UP } from '@/constants';
|
||||
import { ERROR_CODE_USED_UP, NANOBANANA_DEFAULT_RESOLUTION, NANOBANANA_MODEL_NANO_BANANA_PRO } from '@/constants';
|
||||
import RecentPanel from '@/components/nanobanana/RecentPanel.vue';
|
||||
import { INanobananaTask } from '@/models';
|
||||
|
||||
@@ -129,10 +129,16 @@ export default defineComponent({
|
||||
},
|
||||
async onGenerate() {
|
||||
const cfg: any = { ...(this.config || {}) };
|
||||
// When action is 'edit', do not send image_urls
|
||||
// When action is 'generate', do not send image_urls
|
||||
if (cfg?.action === 'generate' && 'image_urls' in cfg) {
|
||||
delete cfg.image_urls;
|
||||
}
|
||||
if (cfg?.model !== NANOBANANA_MODEL_NANO_BANANA_PRO && 'resolution' in cfg) {
|
||||
delete cfg.resolution;
|
||||
}
|
||||
if (cfg?.model === NANOBANANA_MODEL_NANO_BANANA_PRO && !cfg?.resolution) {
|
||||
cfg.resolution = NANOBANANA_DEFAULT_RESOLUTION;
|
||||
}
|
||||
const request = {
|
||||
...cfg,
|
||||
callback_url: CALLBACK_URL
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
import { INanobananaState } from './models';
|
||||
import { Status } from '@/models';
|
||||
import { NANOBANANA_DEFAULT_ACTION, NANOBANANA_DEFAULT_ASPECT_RATIO, NANOBANANA_DEFAULT_MODEL } from '@/constants';
|
||||
import {
|
||||
NANOBANANA_DEFAULT_ACTION,
|
||||
NANOBANANA_DEFAULT_ASPECT_RATIO,
|
||||
NANOBANANA_DEFAULT_MODEL,
|
||||
NANOBANANA_DEFAULT_RESOLUTION
|
||||
} from '@/constants';
|
||||
|
||||
export default (): INanobananaState => {
|
||||
return {
|
||||
@@ -12,7 +17,8 @@ export default (): INanobananaState => {
|
||||
config: {
|
||||
action: NANOBANANA_DEFAULT_ACTION,
|
||||
aspect_ratio: NANOBANANA_DEFAULT_ASPECT_RATIO,
|
||||
model: NANOBANANA_DEFAULT_MODEL
|
||||
model: NANOBANANA_DEFAULT_MODEL,
|
||||
resolution: NANOBANANA_DEFAULT_RESOLUTION
|
||||
},
|
||||
status: {
|
||||
getService: Status.None,
|
||||
|
||||
Reference in new issue
Block a user