feat(ai-studio): clarify hosted model tiers
This commit is contained in:
@@ -7,7 +7,7 @@ import os
|
||||
from PySide6.QtCore import QMimeData
|
||||
from PySide6.QtWidgets import QListWidget, QListWidgetItem
|
||||
|
||||
from ... import accounts, appconfig, db, image_studio, image_studio_export, prompts
|
||||
from ... import accounts, appconfig, cmhub_models, db, image_studio, image_studio_export, prompts
|
||||
from .. import file_manager
|
||||
from ..widgets import *
|
||||
from ..workers import (
|
||||
@@ -278,6 +278,7 @@ class ImageStudioTab(QWidget):
|
||||
|
||||
self._build_ui()
|
||||
self._connect_signals()
|
||||
self._refresh_model_hint()
|
||||
self.refresh_accounts()
|
||||
self.refresh_templates()
|
||||
self.refresh_projects()
|
||||
@@ -434,7 +435,7 @@ class ImageStudioTab(QWidget):
|
||||
form.addRow("比例", self.aspect_combo)
|
||||
layout.addLayout(form)
|
||||
|
||||
self.billing_label = QLabel("cmhub 托管模型:扣点以返回结果为准")
|
||||
self.billing_label = QLabel("cmhub 托管默认档:扣点以返回结果为准")
|
||||
self.billing_label.setObjectName("imageStudioBillingLabel")
|
||||
self.billing_label.setWordWrap(True)
|
||||
layout.addWidget(self.billing_label)
|
||||
@@ -1045,7 +1046,7 @@ class ImageStudioTab(QWidget):
|
||||
self.progress_bar.setRange(0, count)
|
||||
self.progress_bar.setValue(0)
|
||||
self.log_view.clear()
|
||||
self._append_log(f"[AI工场] 本轮生图开始:{count} 张,来源 cmhub 托管模型")
|
||||
self._append_log(f"[AI工场] 本轮生图开始:{count} 张,使用 {self._cmhub_image_model_summary()}")
|
||||
worker = ImageStudioGenerateJobsWorker(
|
||||
self.current_project.id,
|
||||
source.id,
|
||||
@@ -1189,7 +1190,7 @@ class ImageStudioTab(QWidget):
|
||||
self.progress_bar.setRange(0, total)
|
||||
self.progress_bar.setValue(done)
|
||||
if payload.get("points_balance") is not None:
|
||||
text = f"cmhub 托管模型:余额 {payload.get('points_balance')}"
|
||||
text = f"{self._cmhub_image_model_summary()};余额 {payload.get('points_balance')}"
|
||||
if payload.get("points_cost") is not None:
|
||||
text += f",本张扣点 {payload.get('points_cost')}"
|
||||
self.billing_label.setText(text)
|
||||
@@ -1339,6 +1340,13 @@ class ImageStudioTab(QWidget):
|
||||
scrollbar = self.log_view.verticalScrollBar()
|
||||
scrollbar.setValue(scrollbar.maximum())
|
||||
|
||||
def _refresh_model_hint(self):
|
||||
self.billing_label.setText(self._cmhub_image_model_summary())
|
||||
|
||||
def _cmhub_image_model_summary(self):
|
||||
alias = appconfig.cmhub_config(self.config).get("image_alias", "")
|
||||
return cmhub_models.configured_alias_summary(alias)
|
||||
|
||||
def _message(self, title, text):
|
||||
box = QMessageBox(self)
|
||||
box.setWindowTitle(str(title or "提示"))
|
||||
|
||||
Reference in New Issue
Block a user