Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
柴进
/
GoogleNanoBananaApp
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
3c58ff8e
authored
2026-01-13 17:37:18 +0800
by
柴进
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
极速模式支持多张图协同出图,移除单张限制
1 parent
5563b76b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
29 deletions
image_generator.py
image_generator.py
View file @
3c58ff8
...
...
@@ -1779,7 +1779,7 @@ class ImageGeneratorWindow(QMainWindow):
self
.
logger
.
info
(
f
"图片上传完成,有效图片: {valid_count} 张"
)
# 检查极速模式下的多图限制
self
.
check_multi_image_mode_conflict
()
#
self.check_multi_image_mode_conflict()
else
:
self
.
logger
.
info
(
"用户取消了图片选择"
)
...
...
@@ -1811,7 +1811,7 @@ class ImageGeneratorWindow(QMainWindow):
self
.
status_label
.
setStyleSheet
(
"QLabel { color: #34C759; }"
)
# 检查极速模式下的多图限制
self
.
check_multi_image_mode_conflict
()
#
self.check_multi_image_mode_conflict()
else
:
self
.
logger
.
warning
(
"没有找到有效的拖拽图片文件"
)
QMessageBox
.
warning
(
self
,
"警告"
,
"没有找到有效的图片文件"
)
...
...
@@ -1856,7 +1856,7 @@ class ImageGeneratorWindow(QMainWindow):
self
.
logger
.
info
(
f
"剪贴板图片已成功保存到: {temp_file_path}"
)
# 检查极速模式下的多图限制
self
.
check_multi_image_mode_conflict
()
#
self.check_multi_image_mode_conflict()
else
:
self
.
logger
.
error
(
"图片保存失败"
)
QMessageBox
.
critical
(
self
,
"错误"
,
"无法保存剪贴板图片"
)
...
...
@@ -2115,7 +2115,7 @@ class ImageGeneratorWindow(QMainWindow):
if
self
.
generation_mode
.
currentText
()
==
"慢速模式"
:
return
"gemini-3-pro-image-preview"
else
:
return
"gemini-2.5-flash-image
-preview
"
return
"gemini-2.5-flash-image"
def
on_generation_mode_changed
(
self
,
index
):
"""生成模式切换时的处理"""
...
...
@@ -2142,30 +2142,30 @@ class ImageGeneratorWindow(QMainWindow):
else
:
# 用户拒绝,恢复到1K
self
.
image_size
.
setCurrentIndex
(
0
)
def
check_multi_image_mode_conflict
(
self
):
"""检查极速模式下的多图限制"""
current_mode
=
self
.
generation_mode
.
currentText
()
image_count
=
len
(
self
.
uploaded_images
)
# 如果是极速模式且有多张图片,提示切换
if
current_mode
==
"极速模式"
and
image_count
>
1
:
reply
=
QMessageBox
.
question
(
self
,
"模式切换确认"
,
f
"极速模式只支持单张参考图,您已上传 {image_count} 张图片。
\n
是否切换到慢速模式以使用多图功能?"
,
QMessageBox
.
Yes
|
QMessageBox
.
No
,
QMessageBox
.
No
)
if
reply
==
QMessageBox
.
Yes
:
self
.
generation_mode
.
setCurrentIndex
(
1
)
# 切换到慢速模式
else
:
# 用户拒绝,移除多余的图片,只保留第一张
self
.
uploaded_images
=
self
.
uploaded_images
[:
1
]
self
.
update_image_preview
()
self
.
image_count_label
.
setText
(
f
"已选择 {len(self.uploaded_images)} 张"
)
self
.
status_label
.
setText
(
"● 已保留第一张参考图片"
)
self
.
status_label
.
setStyleSheet
(
"QLabel { color: #FF9500; }"
)
#
#
def check_multi_image_mode_conflict(self):
#
"""检查极速模式下的多图限制"""
#
current_mode = self.generation_mode.currentText()
#
image_count = len(self.uploaded_images)
#
#
# 如果是极速模式且有多张图片,提示切换
#
if current_mode == "极速模式" and image_count > 1:
#
reply = QMessageBox.question(
#
self,
#
"模式切换确认",
#
f"极速模式只支持单张参考图,您已上传 {image_count} 张图片。\n是否切换到慢速模式以使用多图功能?",
#
QMessageBox.Yes | QMessageBox.No,
#
QMessageBox.No
#
)
#
if reply == QMessageBox.Yes:
#
self.generation_mode.setCurrentIndex(1) # 切换到慢速模式
#
else:
#
# 用户拒绝,移除多余的图片,只保留第一张
#
self.uploaded_images = self.uploaded_images[:1]
#
self.update_image_preview()
#
self.image_count_label.setText(f"已选择 {len(self.uploaded_images)} 张")
#
self.status_label.setText("● 已保留第一张参考图片")
#
self.status_label.setStyleSheet("QLabel { color: #FF9500; }")
def
generate_image_async
(
self
):
"""Submit image generation task to queue"""
...
...
@@ -3613,7 +3613,7 @@ class StyleDesignerTab(QWidget):
if
self
.
generation_mode
.
currentText
()
==
"慢速模式"
:
return
"gemini-3-pro-image-preview"
else
:
return
"gemini-2.5-flash-image
-preview
"
return
"gemini-2.5-flash-image"
def
on_generation_mode_changed
(
self
,
index
):
"""生成模式切换时的处理"""
...
...
Please
register
or
sign in
to post a comment