fix: 统一前端模型展示名称
This commit is contained in:
@@ -29,6 +29,7 @@ import {
|
||||
} from "lucide-react";
|
||||
import type { AITask, Asset, ImageConversation, ImageConversationTask, ModelConfig, ModelEntity, Product, WorkbenchTask } from "../types";
|
||||
import { api } from "../api";
|
||||
import { imageModelPickerOptions } from "../model-display";
|
||||
import { ModelLibrary } from "../components/model-library";
|
||||
import { SkeletonRows } from "../components/loading";
|
||||
import { ConfirmModal, MediaLightbox } from "../components/overlays";
|
||||
@@ -533,10 +534,6 @@ const MODEL_COUNT_OPTIONS = ["1", "2", "4"];
|
||||
|
||||
// 生图模型选择(写入 localStorage,下次进页面读回)。默认火山。
|
||||
const GEN_MODEL_KEY = "airshelf:imgwb:gen_model";
|
||||
const GEN_MODEL_OPTIONS: { value: string; label: string }[] = [
|
||||
{ value: "volcano", label: "火山 Seedream" },
|
||||
{ value: "gpt-image", label: "gpt-image-2" },
|
||||
];
|
||||
const COVER_COUNT_OPTIONS = ["4", "8", "12"];
|
||||
|
||||
/* 图片创作 · 空态提示词建议 chip(基线 image-optimize EXAMPLES) */
|
||||
@@ -672,11 +669,12 @@ export function ImageWorkbenchPage({
|
||||
const blockNonIntegerKey = (event: React.KeyboardEvent<HTMLInputElement>) => {
|
||||
if ([".", "+", "-", "e", "E"].includes(event.key)) event.preventDefault();
|
||||
};
|
||||
// 生图模型选择:默认火山(内衣等敏感品类不被审核拦,还原也更好),可切 gpt-image-2。持久化到 localStorage。
|
||||
// 生图模型选择:保存后端路由键;展示名由共享映射统一提供。
|
||||
const [genModel, setGenModel] = useState<string>(() => {
|
||||
try { return localStorage.getItem(GEN_MODEL_KEY) || "volcano"; } catch { return "volcano"; }
|
||||
});
|
||||
useEffect(() => { try { localStorage.setItem(GEN_MODEL_KEY, genModel); } catch { /* 忽略 */ } }, [genModel]);
|
||||
const selectedImageModelLabel = imageModelPickerOptions.find((option) => option.id === genModel)?.label || imageModelPickerOptions[0].label;
|
||||
const [count, setCount] = useState(mode === "image" ? "4" : "4");
|
||||
// 模特单选(长度恒 0/1);平台改回多选(P0③:可选多个平台,各出一组结果)
|
||||
const [pickedIds, setPickedIds] = useState<string[]>([]);
|
||||
@@ -1651,8 +1649,8 @@ export function ImageWorkbenchPage({
|
||||
<div className="ic-input-bottom">
|
||||
<Pill
|
||||
label="模型"
|
||||
value={GEN_MODEL_OPTIONS.find((o) => o.value === genModel)?.label || "火山 Seedream"}
|
||||
options={GEN_MODEL_OPTIONS.map((o) => ({ id: o.value, label: o.label }))}
|
||||
value={selectedImageModelLabel}
|
||||
options={imageModelPickerOptions}
|
||||
onSelect={setGenModel}
|
||||
/>
|
||||
<Pill
|
||||
@@ -2005,8 +2003,8 @@ export function ImageWorkbenchPage({
|
||||
<div className="iw-prompt-bar">
|
||||
<Pill
|
||||
label="模型"
|
||||
value={GEN_MODEL_OPTIONS.find((o) => o.value === genModel)?.label || "火山 Seedream"}
|
||||
options={GEN_MODEL_OPTIONS.map((o) => ({ id: o.value, label: o.label }))}
|
||||
value={selectedImageModelLabel}
|
||||
options={imageModelPickerOptions}
|
||||
onSelect={setGenModel}
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user