dsh-mo-image 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/client.js CHANGED
@@ -574,27 +574,6 @@ window.__ModuleLoader__.load({
574
574
  return out;
575
575
  }
576
576
 
577
- // Fast 是纯视觉开关( codex 一样),按会话记住;存储不可用时只。
578
- // 内存镜像,绝不能因为它把选择器弄坏。
579
- const CODEX_FAST_PREFIX = 'dsh.mo-image.codex-fast.v1.';
580
- const codexFastMemory = new Map();
581
- function readCodexFast(sessionId) {
582
- if (!sessionId) return false;
583
- if (codexFastMemory.has(sessionId)) return codexFastMemory.get(sessionId);
584
- try {
585
- if (typeof localStorage === 'undefined') return false;
586
- return localStorage.getItem(CODEX_FAST_PREFIX + sessionId) === '1';
587
- } catch (_error) { return false; }
588
- }
589
- function writeCodexFast(sessionId, on) {
590
- if (!sessionId) return;
591
- codexFastMemory.set(sessionId, on);
592
- try {
593
- if (typeof localStorage === 'undefined') return;
594
- localStorage.setItem(CODEX_FAST_PREFIX + sessionId, on ? '1' : '0');
595
- } catch (_error) { /* storage disabled; the memory mirror still holds it */ }
596
- }
597
-
598
577
  function useThemeClassRevision() {
599
578
  const [, setRevision] = React.useState(0);
600
579
  React.useEffect(() => {
@@ -626,6 +605,41 @@ window.__ModuleLoader__.load({
626
605
  return spec && Array.isArray(spec.options) && spec.options.length ? spec : null;
627
606
  }
628
607
 
608
+ /**
609
+ * 尺寸能力:由宿主按「提供商 + 模型」下发,查不到就按宽高输入框渲染。
610
+ * control: 'wh' | 'aspect' | 'preset' | 'prompt'
611
+ */
612
+ function sizeSpecFor(providerId, model) {
613
+ const provider = imageCatalog.capabilities.find((item) => item && item.providerId === providerId);
614
+ const entry = provider && Array.isArray(provider.models)
615
+ ? provider.models.find((item) => item && item.model === model)
616
+ : undefined;
617
+ const spec = entry && entry.size;
618
+ return spec && typeof spec === 'object' ? spec : null;
619
+ }
620
+
621
+ function sizeControlOf(spec) {
622
+ const control = spec && spec.control ? String(spec.control) : 'wh';
623
+ return ['wh', 'aspect', 'preset', 'prompt'].includes(control) ? control : 'wh';
624
+ }
625
+
626
+ /** 尺寸的一级显示值:和面板里实际的控件保持一致。 */
627
+ function sizeValueLabel(spec, defaults, translate) {
628
+ const t = translate || fallbackTranslate;
629
+ if (!defaults || defaults.auto) return t('seat.sizeAutoValue');
630
+ const control = sizeControlOf(spec);
631
+ if (control === 'aspect') {
632
+ const aspect = String(defaults.aspect || '');
633
+ const tier = String(defaults.tier || '');
634
+ return [aspect, tier].filter(Boolean).join(' · ') || t('seat.sizeAutoValue');
635
+ }
636
+ if (control === 'preset') {
637
+ const preset = String(defaults.preset || '');
638
+ return /^\d+x\d+$/.test(preset) ? preset.split('x').join(' × ') : preset;
639
+ }
640
+ return defaults.width + ' × ' + defaults.height;
641
+ }
642
+
629
643
  function qualityValueFor(value, spec) {
630
644
  const raw = normalizeQuality(value);
631
645
  if (spec) {
@@ -709,9 +723,8 @@ window.__ModuleLoader__.load({
709
723
  };
710
724
  }
711
725
 
712
- function sizeLabelOf(defaults, translate) {
713
- if (!defaults || defaults.auto) return (translate || fallbackTranslate)('seat.sizeAutoValue');
714
- return defaults.width + ' × ' + defaults.height;
726
+ function sizeLabelOf(defaults, translate, spec) {
727
+ return sizeValueLabel(spec, defaults, translate);
715
728
  }
716
729
 
717
730
  function makeId() {
@@ -1054,6 +1067,8 @@ window.__ModuleLoader__.load({
1054
1067
  useThemeClassRevision();
1055
1068
  const t = props.t || fallbackTranslate;
1056
1069
  const isNew = !!props.isNew;
1070
+ // 尺寸交给模型(自动)时,面板里才需要显示宽高落在哪。
1071
+ const sizeAuto = props.sizeAuto !== false;
1057
1072
  const [draft, setDraft] = React.useState(() => ({
1058
1073
  ...props.provider,
1059
1074
  id: props.provider.id,
@@ -1348,7 +1363,7 @@ window.__ModuleLoader__.load({
1348
1363
  const modelOptions = { ...prev.modelOptions };
1349
1364
  const entry = { ...(modelOptions[id] || {}) };
1350
1365
  mutate(entry);
1351
- if (entry.workflow) modelOptions[id] = entry;
1366
+ if (entry.workflow || entry.params || entry.expose) modelOptions[id] = entry;
1352
1367
  else delete modelOptions[id];
1353
1368
  return { ...prev, modelOptions: modelOptions };
1354
1369
  });
@@ -1450,7 +1465,9 @@ window.__ModuleLoader__.load({
1450
1465
  return value === key ? '' : value;
1451
1466
  };
1452
1467
  /** 默认对对话模型可见的参数,和服务端的 DEFAULT_EXPOSED 保持一致。 */
1453
- const DEFAULT_EXPOSED = new Set(['prompt', 'negative_prompt', 'width', 'height']);
1468
+ const DEFAULT_EXPOSED = new Set(['prompt', 'negative_prompt']);
1469
+ /** 尺寸由选择器经 mapping 注入;认出来就不占列表,认不出来才留手选。 */
1470
+ const SIZE_ROLES = new Set(['width', 'height']);
1454
1471
  const MAPPING_ROWS = [
1455
1472
  ['prompt', 'form.modelMappingPrompt'],
1456
1473
  ['negative_prompt', 'form.modelMappingNegative'],
@@ -1482,6 +1499,8 @@ window.__ModuleLoader__.load({
1482
1499
  const pool = Array.isArray(candidates[key]) ? candidates[key] : [];
1483
1500
  const current = mapping[key];
1484
1501
  if (!pool.length && !current) continue;
1502
+ // 尺寸固定时由选择器注入,认出来就不再占列表;自动时留给模型,需要看见落点。
1503
+ if (SIZE_ROLES.has(key) && current && !sizeAuto) continue;
1485
1504
  rows.push({
1486
1505
  key, name: key, label: t(labelKey), role: true, allowSkip: true,
1487
1506
  value: current ? current.node + '::' + current.input : '',
@@ -1577,6 +1596,42 @@ window.__ModuleLoader__.load({
1577
1596
  })()
1578
1597
  );
1579
1598
  };
1599
+ /** A1111 没有工作流,只给一张参数开关表;默认全不暴露。 */
1600
+ const A1111_ROWS = [
1601
+ ['steps', 'param.steps', 'INT'],
1602
+ ['cfg_scale', 'param.cfg', 'FLOAT'],
1603
+ ['sampler_name', 'param.sampler_name', 'STRING'],
1604
+ ['scheduler', 'param.scheduler', 'STRING'],
1605
+ ['seed', 'param.seed', 'INT'],
1606
+ ['denoising_strength', 'param.denoise', 'FLOAT']
1607
+ ];
1608
+ const a1111ParamsPanel = (id) => {
1609
+ const cell = {
1610
+ display: 'grid', gridTemplateColumns: 'minmax(96px, 1fr) 64px 76px',
1611
+ alignItems: 'center', gap: 8, minHeight: 32
1612
+ };
1613
+ return h('div', { style: { display: 'grid', gap: 4 } },
1614
+ h('p', { className: MC.advancedHint, style: { margin: 0 } }, t('form.a1111ParamsHint')),
1615
+ h('div', { className: MC.advancedHint, style: Object.assign({}, cell, { minHeight: 0 }) },
1616
+ h('span', null, t('form.modelMappingColName')),
1617
+ h('span', null, t('form.a1111ColType')),
1618
+ h('span', { style: { textAlign: 'right', whiteSpace: 'nowrap' } }, t('form.modelMappingColExpose'))),
1619
+ ...A1111_ROWS.map(([name, labelKey, type]) => h('div', { key: name, style: cell },
1620
+ h('span', { className: MC.modelFieldLabel, style: { margin: 0 } }, t(labelKey)),
1621
+ h('span', { className: MC.advancedHint, style: { margin: 0 } }, type),
1622
+ h('input', {
1623
+ type: 'checkbox',
1624
+ checked: exposedOf(id, name, false),
1625
+ 'aria-label': t(labelKey),
1626
+ style: {
1627
+ accentColor: 'var(--dsw-alias-state-business-primary, #3989f6)',
1628
+ width: 16, height: 16, flex: 'none', justifySelf: 'end'
1629
+ },
1630
+ onChange: (event) => toggleParam(id, name, event.target.checked)
1631
+ })
1632
+ ))
1633
+ );
1634
+ };
1580
1635
  // 没有自己的 ComfyUI 工作流时,先插一个能跑 SD/SDXL 的骨架,改起来比重写快。
1581
1636
  const modelWorkflowTemplate = () => JSON.stringify({
1582
1637
  '1': { class_type: 'CheckpointLoaderSimple', inputs: { ckpt_name: '{{model}}' } },
@@ -1675,7 +1730,7 @@ window.__ModuleLoader__.load({
1675
1730
  const dragging = dragFrom === index;
1676
1731
  const target = !dragging && dragFrom >= 0 && dropAt && dropAt.index === index ? dropAt.half : null;
1677
1732
  // 自定义工作流只对 ComfyUI 部署器有意义,其它提供商(含云端)禁用该入口。
1678
- const workflowSupported = String(draft.adapter || '') === 'comfyui';
1733
+ const workflowSupported = String(draft.adapter || '') === 'comfyui' || String(draft.adapter || '') === 'a1111';
1679
1734
  const optionsOpen = optionsFor === model && model !== '' && workflowSupported;
1680
1735
  return h('div', {
1681
1736
  className: MC.modelEntry,
@@ -1726,7 +1781,9 @@ window.__ModuleLoader__.load({
1726
1781
  title: t('form.deleteModel'), 'aria-label': t('form.deleteModel') + ' ' + (index + 1)
1727
1782
  }, IconTrash ? h(IconTrash, { size: 14 }) : '×'),
1728
1783
  modelField('name', index, model),
1729
- optionsOpen ? h('div', { className: MC.modelAdvanced },
1784
+ optionsOpen ? (String(draft.adapter || '') === 'a1111'
1785
+ ? h('div', { className: MC.modelAdvanced }, a1111ParamsPanel(model))
1786
+ : h('div', { className: MC.modelAdvanced },
1730
1787
  h('p', { className: MC.advancedHint, style: { gridColumn: '1 / -1', margin: 0 } },
1731
1788
  t('form.modelOptionsHint')),
1732
1789
  h('label', { className: MC.modelField, style: { gridColumn: '1 / -1' } },
@@ -1762,7 +1819,7 @@ window.__ModuleLoader__.load({
1762
1819
  : t('form.modelMappingParse')) : null
1763
1820
  ),
1764
1821
  mappingPanel(model)
1765
- ) : null
1822
+ )) : null
1766
1823
  )
1767
1824
  );
1768
1825
  })
@@ -2180,13 +2237,13 @@ window.__ModuleLoader__.load({
2180
2237
  h('button', { type: 'button', className: MC.dangerButton, onClick: () => remove(provider) }, t('action.delete'))
2181
2238
  )
2182
2239
  ),
2183
- editing ? h(ImageProviderForm, { provider: edit.provider, onSave: save, onClose: () => setEdit(null), t: t }) : null
2240
+ editing ? h(ImageProviderForm, { provider: edit.provider, onSave: save, onClose: () => setEdit(null), sizeAuto: store.defaults.auto !== false, t: t }) : null
2184
2241
  );
2185
2242
  })
2186
2243
  ),
2187
2244
  h('div', { className: MC.addBlock },
2188
2245
  edit && edit.isNew
2189
- ? h('div', { className: MC.addCard }, h(ImageProviderForm, { provider: edit.provider, isNew: true, onSave: save, onClose: () => setEdit(null), t: t }))
2246
+ ? h('div', { className: MC.addCard }, h(ImageProviderForm, { provider: edit.provider, isNew: true, onSave: save, onClose: () => setEdit(null), sizeAuto: store.defaults.auto !== false, t: t }))
2190
2247
  : h('div', { className: MC.addActions },
2191
2248
  h('button', { type: 'button', className: MC.addButton, onClick: () => setEdit({ provider: { id: makeId(), name: '', baseUrl: '', key: '', apiKeyEnv: '', adapter: '', protocol: 'openai-images', optionalKey: false, models: [] }, isNew: true }) }, '+ ' + t('action.addProvider'))
2192
2249
  )
@@ -2218,6 +2275,23 @@ window.__ModuleLoader__.load({
2218
2275
  const triggerLabel = seatView.triggerLabel;
2219
2276
  const activeSpec = seatView.qualitySpec;
2220
2277
  const levels = qualityRailLevels(activeSpec);
2278
+ // 真正写进请求的提示词优化开关,不是 codex 的纯视觉 Fast。
2279
+ const promptOptimization = defaults.promptOptimization !== false;
2280
+ // The visual peak is always "Ultra", whatever the backend calls its top
2281
+ // stop (high/max/xhigh/...). The stored value and request are untouched.
2282
+ const topLevelValue = levels.length > 1 ? levels[levels.length - 1].value : null;
2283
+ const codexQualityLabel = (value) => (
2284
+ topLevelValue !== null && qualityValueFor(value, activeSpec) === topLevelValue
2285
+ ? 'Ultra'
2286
+ : qualityLabelFor(value, activeSpec, t)
2287
+ );
2288
+ // Ultra is a frontend skin: whatever id the backend uses for its top
2289
+ // stop, the label and its violet ink both use the codex peak bucket.
2290
+ const codexVisualValue = (value) => (
2291
+ topLevelValue !== null && qualityValueFor(value, activeSpec) === topLevelValue
2292
+ ? 'max'
2293
+ : value
2294
+ );
2221
2295
 
2222
2296
  function isDarkNow() {
2223
2297
  try {
@@ -2248,16 +2322,11 @@ window.__ModuleLoader__.load({
2248
2322
  const [menuPos, setMenuPos] = React.useState(null);
2249
2323
  const [liveFraction, setLiveFraction] = React.useState(null);
2250
2324
  const [hoveredDot, setHoveredDot] = React.useState(-1);
2251
- const [fast, setFastState] = React.useState(() => readCodexFast(props.sessionId));
2252
- const setFast = (next) => {
2253
- setFastState(next);
2254
- writeCodexFast(props.sessionId, next);
2255
- };
2256
- React.useEffect(() => {
2257
- setFastState(readCodexFast(props.sessionId));
2258
- }, [props.sessionId]);
2325
+ const [tipOn, setTipOn] = React.useState(false);
2259
2326
  const triggerRef = React.useRef(null);
2260
2327
  const popoverRef = React.useRef(null);
2328
+ const fastBtnRef = React.useRef(null);
2329
+ const tipRef = React.useRef(null);
2261
2330
  const railRef = React.useRef(null);
2262
2331
  const searchRef = React.useRef(null);
2263
2332
  const messageTimer = React.useRef(0);
@@ -2274,8 +2343,9 @@ window.__ModuleLoader__.load({
2274
2343
  // 动画和额度提示都跟「滑到最高档」走;Auto 不在最高档时不误报。
2275
2344
  const atTop = levels.length > 1 && displayIndex === levels.length - 1;
2276
2345
  const peak = atTop;
2277
- const qualityLabel = levels.length ? qualityLabelFor(value, activeSpec, t) : '';
2278
- const displayLabel = levels.length ? qualityLabelFor(displayed, activeSpec, t) : '';
2346
+ const qualityLabel = levels.length ? codexQualityLabel(value) : '';
2347
+ const displayLabel = levels.length ? codexQualityLabel(displayed) : '';
2348
+ const tipShown = tipOn && open && pane === 'quality';
2279
2349
  const sparkles = React.useMemo(() => buildCodexSparkles(22), []);
2280
2350
  const bloomMotes = React.useMemo(() => buildCodexBloom(18), []);
2281
2351
  const hasAnyModel = seatView.hasAnyModel;
@@ -2431,6 +2501,33 @@ window.__ModuleLoader__.load({
2431
2501
  if (messageTimer.current) clearTimeout(messageTimer.current);
2432
2502
  }, []);
2433
2503
 
2504
+ // Codex 的 Fast 浮层同款:fixed 定位,贴在星标按钮上方。工具提示不能
2505
+ // 放进弹层内部,弹层的 backdrop-filter 会成为 fixed 后代的包含块并裁剪它。
2506
+ function positionTip() {
2507
+ const tip = tipRef.current;
2508
+ const btn = fastBtnRef.current;
2509
+ if (!tip || !btn) return;
2510
+ const rect = btn.getBoundingClientRect();
2511
+ const tipWidth = tip.offsetWidth || 120;
2512
+ const tipHeight = tip.offsetHeight || 44;
2513
+ const left = Math.max(8, Math.min(rect.left + rect.width / 2 - tipWidth / 2, window.innerWidth - tipWidth - 8));
2514
+ tip.style.left = `${left}px`;
2515
+ tip.style.top = `${Math.max(8, rect.top - tipHeight - 7)}px`;
2516
+ }
2517
+ React.useLayoutEffect(() => {
2518
+ if (!tipShown) return undefined;
2519
+ positionTip();
2520
+ const settle = () => positionTip();
2521
+ window.addEventListener('resize', settle);
2522
+ document.addEventListener('scroll', settle, true);
2523
+ return () => {
2524
+ window.removeEventListener('resize', settle);
2525
+ document.removeEventListener('scroll', settle, true);
2526
+ };
2527
+ }, [tipShown]);
2528
+ React.useEffect(() => { if (!open) setTipOn(false); }, [open]);
2529
+ React.useEffect(() => { if (pane !== 'quality') setTipOn(false); }, [pane]);
2530
+
2434
2531
  const commitSide = (side, text) => {
2435
2532
  const digits = String(text || '').replace(/[^0-9]/g, '');
2436
2533
  const number = Number(digits);
@@ -2529,20 +2626,6 @@ window.__ModuleLoader__.load({
2529
2626
  : [];
2530
2627
  const page2Rows = providerModels.length;
2531
2628
  const page1Rows = (showAutoRow ? 1 : 0) + store.providers.length;
2532
- let desiredHeight = CODEX_QUALITY_HEIGHT;
2533
- if (pane === 'models') {
2534
- const M = CODEX_METRICS;
2535
- desiredHeight = isSettingsPage
2536
- ? M.pad + M.head + 2 * M.section + 4 * M.row + 2 * M.listPad
2537
- : (view === 2
2538
- ? M.pad + Math.max(44, M.head + M.search
2539
- + Math.min(page2Rows * M.model + M.listPad, M.listMax)
2540
- + (providerModels.length ? 0 : M.empty))
2541
- : M.pad + Math.max(44, M.section + page1Rows * M.row
2542
- + (store.providers.length ? 0 : M.empty)));
2543
- }
2544
- const roomAbove = menuPos ? Math.max(120, window.innerHeight - menuPos.bottom - CODEX_MARGIN) : desiredHeight;
2545
- const popoverHeight = Math.min(desiredHeight, roomAbove);
2546
2629
 
2547
2630
  const checkIcon = (on) => h('span', { className: 'cmes-ck' },
2548
2631
  on ? h('svg', {
@@ -2561,14 +2644,22 @@ window.__ModuleLoader__.load({
2561
2644
  className: 'cmes-chev', viewBox: '0 0 24 24', 'aria-hidden': true,
2562
2645
  fill: 'none', stroke: 'currentColor', strokeWidth: 1.7, strokeLinecap: 'round', strokeLinejoin: 'round'
2563
2646
  }, h('path', { d: 'm6 9 6 6 6-6' }));
2564
- const boltIcon = (cls, on) => h('svg', {
2565
- className: cls, viewBox: '0 0 24 24', 'aria-hidden': true,
2647
+ const starIcon = (cls, on) => h('svg', {
2648
+ className: (cls ? cls + ' ' : '') + 'cmes-star', viewBox: '0 0 24 24', 'aria-hidden': true,
2566
2649
  fill: on ? 'currentColor' : 'none', stroke: 'currentColor',
2567
- strokeWidth: on ? 0.7 : 1.5, strokeLinejoin: 'round',
2568
- style: { width: 15, height: 17 }
2569
- }, h('path', {
2570
- d: 'M14.4 2Q16 .2 15.8 2.5L15.1 8.5H20.5Q22 8.5 21 9.8L10.7 21.7Q9 23.4 9.2 21.2L10 14.2H4.2Q2.6 14.2 3.6 12.9L14.4 2Z'
2571
- }));
2650
+ strokeWidth: on ? 0.7 : 1.4, strokeLinejoin: 'round', strokeLinecap: 'round',
2651
+ style: { width: 16, height: 16, display: 'block', flex: 'none', margin: '0 auto' }
2652
+ },
2653
+ // Big centre sparkle plus the two small ones — the familiar AI mark.
2654
+ h('path', {
2655
+ d: 'M12 3.5c.85 5.1 2.45 6.7 7.55 7.55-5.1.85-6.7 2.45-7.55 7.55-.85-5.1-2.45-6.7-7.55-7.55 5.1-.85 6.7-2.45 7.55-7.55Z'
2656
+ }),
2657
+ h('path', {
2658
+ d: 'M19 1.5c.35 2.1 1.05 2.8 3.15 3.15-2.1.35-2.8 1.05-3.15 3.15-.35-2.1-1.05-2.8-3.15-3.15 2.1-.35 2.8-1.05 3.15-3.15Z'
2659
+ }),
2660
+ h('path', {
2661
+ d: 'M5 15.5c.35 2.1 1.05 2.8 3.15 3.15-2.1.35-2.8 1.05-3.15 3.15-.35-2.1-1.05-2.8-3.15-3.15 2.1-.35 2.8-1.05 3.15-3.15Z'
2662
+ }));
2572
2663
  // 其他设置工具用齿轮,避免和尺寸/全屏混淆。
2573
2664
  const sizeIcon = h('svg', {
2574
2665
  className: 'cmes-iconSmall', viewBox: '0 0 24 24', 'aria-hidden': true,
@@ -2587,15 +2678,16 @@ window.__ModuleLoader__.load({
2587
2678
  h('circle', { cx: 8.2, cy: 9.2, r: 1.4 }),
2588
2679
  h('path', { d: 'M4 17l5-4.6 3.2 3 3.8-4.2L20 17' }));
2589
2680
 
2681
+ const visualDisplay = codexVisualValue(displayed);
2590
2682
  const railColors = {
2591
- '--cmes-fill': codexFillFor(displayed, dark),
2592
- '--cmes-track': codexTrackFor(codexFillFor(displayed, dark), dark),
2593
- '--cmes-ink': codexInkFor(displayed, dark),
2683
+ '--cmes-fill': codexFillFor(visualDisplay, dark),
2684
+ '--cmes-track': codexTrackFor(codexFillFor(visualDisplay, dark), dark),
2685
+ '--cmes-ink': codexInkFor(visualDisplay, dark),
2594
2686
  '--cmes-dot': 'var(--dsw-alias-label-caption,#b6b6b8)',
2595
- '--cmes-mote': codexMixHex(codexFillFor(displayed, dark), '#ffffff', dark ? 0.30 : 0.42),
2687
+ '--cmes-mote': codexMixHex(codexFillFor(visualDisplay, dark), '#ffffff', dark ? 0.30 : 0.42),
2596
2688
  '--cmes-pos': String(fraction)
2597
2689
  };
2598
- const triggerStyle = { '--cmes-ink': codexInkFor(value, dark) };
2690
+ const triggerStyle = { '--cmes-ink': codexInkFor(codexVisualValue(value), dark) };
2599
2691
 
2600
2692
  const autoRow = h('button', {
2601
2693
  key: '__auto', type: 'button', className: 'cmes-row',
@@ -2640,22 +2732,54 @@ window.__ModuleLoader__.load({
2640
2732
  checkIcon(selected)
2641
2733
  );
2642
2734
  });
2643
- const settingsForm = h('div', { key: 'size-form', className: 'cmes-rows' },
2644
- h('div', { className: 'cmes-sec' }, t('seat.sizeTitle')),
2645
- h('div', { className: 'cmes-row', style: { cursor: 'default' } },
2646
- h('span', { className: 'cmes-rowName' }, t('seat.sizeAutoValue')),
2647
- h('input', {
2648
- type: 'checkbox', checked: !!defaults.auto, 'aria-label': t('seat.sizeAutoAria'),
2649
- style: { accentColor: 'var(--dsw-alias-state-business-primary, #3989f6)', width: 16, height: 16 },
2650
- onChange: (event) => saveDefaults({ auto: event.target.checked })
2651
- })
2652
- ),
2653
- h('div', { className: 'cmes-row', style: { cursor: 'default' } },
2735
+ // Codex 皮肤的这一页也按模型形态渲染:宽高 / 比例+档位 / 档位下拉 / 写进提示词。
2736
+ const pageSizeSpec = sizeSpecFor(activeProviderForPage ? activeProviderForPage.id : '', store.active.model);
2737
+ const pageControl = sizeControlOf(pageSizeSpec);
2738
+ const pageAspects = pageSizeSpec && Array.isArray(pageSizeSpec.aspects) ? pageSizeSpec.aspects : [];
2739
+ const pageTiers = pageSizeSpec && Array.isArray(pageSizeSpec.tiers) ? pageSizeSpec.tiers.map((tier) => String(tier.value)) : [];
2740
+ const pageCustom = !!(pageSizeSpec && pageSizeSpec.custom);
2741
+ const inputStyle = { width: 92, height: 26, borderRadius: 8, border: '1px solid var(--dsw-alias-border-l2)', background: 'var(--dsw-alias-bg-layer-1)', color: 'var(--dsw-alias-label-primary)', fontFamily: 'inherit', fontSize: 12, textAlign: 'right', padding: '0 8px', outline: 'none' };
2742
+ const codexSelect = (label, value, options, onPick) => h('div', { className: 'cmes-row', style: { cursor: 'default' } },
2743
+ h('span', { className: 'cmes-rowName' }, label),
2744
+ h('select', {
2745
+ 'aria-label': label, value: value, disabled: defaults.auto,
2746
+ style: Object.assign({}, inputStyle, { width: 110 }),
2747
+ onChange: (event) => onPick(String(event.target.value))
2748
+ }, options.map((option) => (typeof option === 'string'
2749
+ ? h('option', { key: option, value: option }, option)
2750
+ : h('option', { key: option.value, value: option.value }, option.label))))
2751
+ );
2752
+ // 严格模式紧跟自动尺寸:它管的是请求里的尺寸算不算数,与自动/固定无关。
2753
+ const codexRows = [h('div', { className: 'cmes-row', style: { cursor: 'default' } },
2754
+ h('span', { className: 'cmes-rowName', title: t('seat.sizeStrictHint') }, t('seat.sizeStrict')),
2755
+ h('input', {
2756
+ type: 'checkbox', checked: !!defaults.strict, 'aria-label': t('seat.sizeStrict'),
2757
+ title: t('seat.sizeStrictHint'),
2758
+ style: { accentColor: 'var(--dsw-alias-state-business-primary, #3989f6)', width: 16, height: 16 },
2759
+ onChange: (event) => saveDefaults({ strict: event.target.checked })
2760
+ })
2761
+ )];
2762
+ if (pageControl === 'aspect' && pageAspects.length) {
2763
+ codexRows.push(codexSelect(t('seat.sizeAspect'), defaults.aspect || pageAspects[0], pageAspects,
2764
+ (value) => saveDefaults({ aspect: value })));
2765
+ if (pageTiers.length) {
2766
+ codexRows.push(codexSelect(t('seat.sizeTier'), defaults.tier || pageTiers[0], pageTiers,
2767
+ (value) => saveDefaults({ tier: value })));
2768
+ }
2769
+ } else if (pageControl === 'preset') {
2770
+ const presetOptions = pageTiers.concat(pageCustom ? [{ value: '__custom', label: t('seat.sizeCustom') }] : []);
2771
+ codexRows.push(codexSelect(t('seat.sizePreset'),
2772
+ pageTiers.includes(String(defaults.preset)) ? String(defaults.preset) : (pageTiers[0] || '__custom'),
2773
+ presetOptions,
2774
+ (value) => { if (value !== '__custom') saveDefaults({ preset: value }); }));
2775
+ }
2776
+ if (pageControl === 'wh' || pageControl === 'prompt' || (pageControl === 'preset' && pageCustom)) {
2777
+ codexRows.push(h('div', { className: 'cmes-row', style: { cursor: 'default' } },
2654
2778
  h('span', { className: 'cmes-rowName' }, t('seat.width')),
2655
2779
  h('input', {
2656
2780
  type: 'text', inputMode: 'numeric', disabled: defaults.auto, 'aria-label': t('seat.width'),
2657
2781
  value: widthDraft || String(defaults.width),
2658
- style: { width: 92, height: 26, borderRadius: 8, border: '1px solid var(--dsw-alias-border-l2)', background: 'var(--dsw-alias-bg-layer-1)', color: 'var(--dsw-alias-label-primary)', fontFamily: 'inherit', fontSize: 12, textAlign: 'right', padding: '0 8px', outline: 'none' },
2782
+ style: inputStyle,
2659
2783
  onBlur: () => setWidthDraft(''),
2660
2784
  onChange: (event) => {
2661
2785
  const text = String(event.target.value).replace(/[^0-9]/g, '');
@@ -2663,13 +2787,13 @@ window.__ModuleLoader__.load({
2663
2787
  commitSide('width', text);
2664
2788
  }
2665
2789
  })
2666
- ),
2667
- h('div', { className: 'cmes-row', style: { cursor: 'default' } },
2790
+ ));
2791
+ codexRows.push(h('div', { className: 'cmes-row', style: { cursor: 'default' } },
2668
2792
  h('span', { className: 'cmes-rowName' }, t('seat.height')),
2669
2793
  h('input', {
2670
2794
  type: 'text', inputMode: 'numeric', disabled: defaults.auto, 'aria-label': t('seat.height'),
2671
2795
  value: heightDraft || String(defaults.height),
2672
- style: { width: 92, height: 26, borderRadius: 8, border: '1px solid var(--dsw-alias-border-l2)', background: 'var(--dsw-alias-bg-layer-1)', color: 'var(--dsw-alias-label-primary)', fontFamily: 'inherit', fontSize: 12, textAlign: 'right', padding: '0 8px', outline: 'none' },
2796
+ style: inputStyle,
2673
2797
  onBlur: () => setHeightDraft(''),
2674
2798
  onChange: (event) => {
2675
2799
  const text = String(event.target.value).replace(/[^0-9]/g, '');
@@ -2677,18 +2801,43 @@ window.__ModuleLoader__.load({
2677
2801
  commitSide('height', text);
2678
2802
  }
2679
2803
  })
2680
- ),
2681
- h('div', { className: 'cmes-sec' }, t('seat.promptSection')),
2804
+ ));
2805
+ }
2806
+ if (pageControl === 'prompt') {
2807
+ codexRows.push(h('div', { className: 'cmes-row', style: { cursor: 'default' } },
2808
+ h('span', { className: 'cmes-rowName', style: { opacity: 0.7 } }, t('seat.sizePromptHint'))));
2809
+ }
2810
+ if (pageSizeSpec && pageSizeSpec.hint) {
2811
+ const pageHintKey = 'seat.sizeHint.' + String(pageSizeSpec.hint);
2812
+ codexRows.push(h('div', { className: 'cmes-row', style: { cursor: 'default' } },
2813
+ h('span', { className: 'cmes-rowName', style: { opacity: 0.7 } }, t(pageHintKey))));
2814
+ }
2815
+ const settingsForm = h('div', { key: 'size-form', className: 'cmes-rows' },
2816
+ h('div', { className: 'cmes-sec' }, t('seat.sizeTitle')),
2682
2817
  h('div', { className: 'cmes-row', style: { cursor: 'default' } },
2683
- h('span', { className: 'cmes-rowName' }, t('seat.menuPromptOptimization')),
2818
+ h('span', { className: 'cmes-rowName' }, t('seat.sizeAutoValue')),
2684
2819
  h('input', {
2685
- type: 'checkbox', checked: defaults.promptOptimization !== false,
2686
- 'aria-label': t('seat.menuPromptOptimization'),
2820
+ type: 'checkbox', checked: !!defaults.auto, 'aria-label': t('seat.sizeAutoAria'),
2687
2821
  style: { accentColor: 'var(--dsw-alias-state-business-primary, #3989f6)', width: 16, height: 16 },
2688
- onChange: (event) => saveDefaults({ promptOptimization: event.target.checked })
2822
+ onChange: (event) => saveDefaults({ auto: event.target.checked })
2689
2823
  })
2690
- )
2824
+ ),
2825
+ ...codexRows
2691
2826
  );
2827
+ let desiredHeight = CODEX_QUALITY_HEIGHT;
2828
+ if (pane === 'models') {
2829
+ const M = CODEX_METRICS;
2830
+ desiredHeight = isSettingsPage
2831
+ ? M.pad + M.head + M.section + (1 + codexRows.length) * M.row + 2 * M.listPad
2832
+ : (view === 2
2833
+ ? M.pad + Math.max(44, M.head + M.search
2834
+ + Math.min(page2Rows * M.model + M.listPad, M.listMax)
2835
+ + (providerModels.length ? 0 : M.empty))
2836
+ : M.pad + Math.max(44, M.section + page1Rows * M.row
2837
+ + (store.providers.length ? 0 : M.empty)));
2838
+ }
2839
+ const roomAbove = menuPos ? Math.max(120, window.innerHeight - menuPos.bottom - CODEX_MARGIN) : desiredHeight;
2840
+ const popoverHeight = Math.min(desiredHeight, roomAbove);
2692
2841
  const page2Body = isSettingsPage
2693
2842
  ? settingsForm
2694
2843
  : [
@@ -2739,9 +2888,10 @@ window.__ModuleLoader__.load({
2739
2888
  inert: pane !== 'models' ? '' : undefined
2740
2889
  },
2741
2890
  h('div', { className: 'cmes-viewport' + (view === 2 ? ' view2' : '') },
2891
+ // 不要在这里写 transition:`.cmes-page` 的 .3s cubic-bezier(.32,.72,.28,1)
2892
+ // 由 codex 样式表提供;内联 ease 会让滑动比 codex 更快、还会抖。
2742
2893
  h('div', {
2743
2894
  className: 'cmes-page slot1',
2744
- style: { transition: 'transform .3s ease' },
2745
2895
  inert: view === 2 ? '' : undefined
2746
2896
  },
2747
2897
  h('div', { className: 'cmes-sec' }, t('seat.menuModel')),
@@ -2749,7 +2899,6 @@ window.__ModuleLoader__.load({
2749
2899
  ),
2750
2900
  h('div', {
2751
2901
  className: 'cmes-page slot2',
2752
- style: { transition: 'transform .3s ease' },
2753
2902
  inert: view === 2 ? undefined : ''
2754
2903
  },
2755
2904
  h('div', { className: 'cmes-head' },
@@ -2770,11 +2919,18 @@ window.__ModuleLoader__.load({
2770
2919
  inert: pane !== 'quality' ? '' : undefined
2771
2920
  },
2772
2921
  h('button', {
2773
- className: 'cmes-tool cmes-fast' + (fast ? ' active' : ''),
2774
- 'aria-label': t('seat.fast'),
2775
- 'aria-pressed': fast,
2776
- onClick: () => setFast(!fast)
2777
- }, boltIcon('', fast)),
2922
+ className: 'cmes-tool cmes-fast' + (promptOptimization ? ' active' : ''),
2923
+ ref: fastBtnRef,
2924
+ style: { display: 'flex', alignItems: 'center', justifyContent: 'center', padding: 0, lineHeight: 0 },
2925
+ 'aria-label': t('seat.menuPromptOptimization'),
2926
+ 'aria-describedby': 'mo-image-prompt-tip',
2927
+ 'aria-pressed': promptOptimization,
2928
+ onPointerEnter: () => setTipOn(true),
2929
+ onPointerLeave: () => setTipOn(false),
2930
+ onFocus: () => setTipOn(true),
2931
+ onBlur: () => setTipOn(false),
2932
+ onClick: () => saveDefaults({ promptOptimization: !promptOptimization })
2933
+ }, starIcon('', promptOptimization)),
2778
2934
  h('button', {
2779
2935
  className: 'cmes-modelLink', type: 'button',
2780
2936
  onClick: () => setPane('models'),
@@ -2842,13 +2998,16 @@ window.__ModuleLoader__.load({
2842
2998
  'cmes-popover',
2843
2999
  open ? '' : ' closed',
2844
3000
  peak ? ' peak' : '',
2845
- fast ? ' fast-mode' : '',
3001
+ promptOptimization ? ' fast-mode' : '',
2846
3002
  message ? ' message' : ''
2847
3003
  ].filter(Boolean).join(' ');
2848
3004
  const popoverStyle = {
2849
3005
  '--cmes-height': popoverHeight + 'px',
2850
3006
  '--cmes-left': (menuPos ? menuPos.left : 0) + 'px',
2851
3007
  '--cmes-bottom': (menuPos ? menuPos.bottom : 40) + 'px',
3008
+ // Heading and trigger share the same ink; at the top stop that is the
3009
+ // codex violet even when the backend calls the stop high/max/xhigh.
3010
+ '--cmes-ink': codexInkFor(visualDisplay, dark),
2852
3011
  // codex 样式没到位( CSP/加载时序挡住)时也要保证它脱离文档流。
2853
3012
  // 否则整块弹层会把输入区顶上去、页面底部多出一大片空白。
2854
3013
  position: 'fixed',
@@ -2887,7 +3046,7 @@ window.__ModuleLoader__.load({
2887
3046
  return h('div', { className: 'cmes-root', 'data-mo-image-seat': '' },
2888
3047
  h('button', {
2889
3048
  type: 'button', ref: triggerRef,
2890
- className: 'cmes-trigger' + (fast ? ' fast' : ''),
3049
+ className: 'cmes-trigger' + (promptOptimization ? ' fast' : ''),
2891
3050
  style: triggerStyle,
2892
3051
  'aria-label': qualityLabel ? t('seat.triggerAriaQuality', { model: triggerLabel, quality: qualityLabel }) : t('seat.triggerAria', { model: triggerLabel }),
2893
3052
  'aria-haspopup': 'dialog', 'aria-expanded': open,
@@ -2901,7 +3060,7 @@ window.__ModuleLoader__.load({
2901
3060
  setOpen(true);
2902
3061
  }
2903
3062
  },
2904
- fast ? boltIcon('cmes-bolt', true) : null,
3063
+ promptOptimization ? starIcon('cmes-bolt', true) : null,
2905
3064
  h('span', { className: 'cmes-compact' }, imageIcon),
2906
3065
  h('span', { className: 'cmes-caption' }, triggerLabel),
2907
3066
  qualityLabel ? h('span', { className: 'cmes-triggerEffort' }, qualityLabel) : null,
@@ -2909,16 +3068,28 @@ window.__ModuleLoader__.load({
2909
3068
  ),
2910
3069
  // 弹层必须挂到 body:输入区里任何 transform/filter/backdrop-filter 都会
2911
3070
  // 把 position:fixed 变成相对包含块,位置和裁剪都会错。
2912
- portalNode(h('section', {
2913
- ref: popoverRef, id: 'mo-image-codex-popover', className: popoverClasses, role: 'dialog',
2914
- 'data-mo-image-codex-popover': '',
2915
- 'aria-label': pane === 'models' ? t('seat.menuModel') : t('seat.menuQuality'),
2916
- 'aria-hidden': !open,
2917
- inert: !open ? '' : undefined,
2918
- style: popoverStyle
2919
- },
2920
- modelsPane,
2921
- qualityPane
3071
+ portalNode(h(React.Fragment, null,
3072
+ h('section', {
3073
+ ref: popoverRef, id: 'mo-image-codex-popover', className: popoverClasses, role: 'dialog',
3074
+ 'data-mo-image-codex-popover': '',
3075
+ 'aria-label': pane === 'models' ? t('seat.menuModel') : t('seat.menuQuality'),
3076
+ 'aria-hidden': !open,
3077
+ inert: !open ? '' : undefined,
3078
+ style: popoverStyle
3079
+ },
3080
+ modelsPane,
3081
+ qualityPane
3082
+ ),
3083
+ // Same two-line codex tooltip card as the Fast button, but this one
3084
+ // describes the real prompt-optimization switch. It stays outside the
3085
+ // popover: backdrop-filter would otherwise become its containing block.
3086
+ h('span', {
3087
+ role: 'tooltip', id: 'mo-image-prompt-tip',
3088
+ className: 'cmes-tip' + (tipShown ? ' show' : ''),
3089
+ ref: tipRef, 'aria-hidden': tipShown ? undefined : 'true'
3090
+ },
3091
+ h('span', { className: 'cmes-tipTitle' }, t('seat.menuPromptOptimization')),
3092
+ h('span', null, t('seat.promptOptimizationUsage')))
2922
3093
  ))
2923
3094
  );
2924
3095
  }
@@ -3123,7 +3294,7 @@ window.__ModuleLoader__.load({
3123
3294
  ];
3124
3295
  if (qualitySpec) homePanel.push(cellRow('quality', t('seat.menuQuality'), qualityLabel, () => setPanel('quality')));
3125
3296
  homePanel.push(
3126
- cellRow('size', t('seat.menuSize'), sizeLabelOf(defaults, t), () => setPanel('size')),
3297
+ cellRow('size', t('seat.menuSize'), sizeValueLabel(sizeSpecFor(active.providerId, active.model), defaults, t), () => setPanel('size')),
3127
3298
  cellRow('promptOptimization', t('seat.menuPromptOptimization'), defaults.promptOptimization === false ? t('seat.off') : t('seat.on'), () => setPanel('promptOptimization'))
3128
3299
  );
3129
3300
  // 尺寸面板里的行是静态表单,不要 cell 的悬停高光;
@@ -3144,6 +3315,58 @@ window.__ModuleLoader__.load({
3144
3315
  }
3145
3316
  })
3146
3317
  );
3318
+ // 尺寸面板按所选模型的形态渲染:宽高 / 比例+档位 / 档位下拉 / 写进提示词。
3319
+ const seatSizeSpec = sizeSpecFor(active.providerId, active.model);
3320
+ const seatControl = sizeControlOf(seatSizeSpec);
3321
+ const seatAspects = seatSizeSpec && Array.isArray(seatSizeSpec.aspects) ? seatSizeSpec.aspects : [];
3322
+ const seatTiers = seatSizeSpec && Array.isArray(seatSizeSpec.tiers) ? seatSizeSpec.tiers : [];
3323
+ const seatPresets = seatTiers.map((tier) => String(tier.value));
3324
+ const seatCustom = !!(seatSizeSpec && seatSizeSpec.custom);
3325
+ const selectRow = (key, label, value, options, onPick) => h('div', { key: key, className: plainRow },
3326
+ h('span', { className: MS.cellLabel }, label),
3327
+ h('select', {
3328
+ className: MS.cellValue, value: value, disabled: defaults.auto, 'aria-label': label,
3329
+ onChange: (event) => onPick(String(event.target.value))
3330
+ }, options.map((option) => (typeof option === 'string'
3331
+ ? h('option', { key: option, value: option }, option)
3332
+ : h('option', { key: option.value, value: option.value }, option.label))))
3333
+ );
3334
+ const presetInList = seatPresets.includes(String(defaults.preset || ''));
3335
+ const sizeRows = [];
3336
+ if (seatControl === 'aspect' && seatAspects.length) {
3337
+ sizeRows.push(selectRow('aspect', t('seat.sizeAspect'), defaults.aspect || seatAspects[0], seatAspects,
3338
+ (value) => saveDefaults({ aspect: value })));
3339
+ if (seatTiers.length) {
3340
+ sizeRows.push(selectRow('tier', t('seat.sizeTier'), defaults.tier || seatTiers[0].value, seatPresets,
3341
+ (value) => saveDefaults({ tier: value })));
3342
+ }
3343
+ } else if (seatControl === 'preset') {
3344
+ const presetOptions = seatPresets.concat(seatCustom ? [{ value: '__custom', label: t('seat.sizeCustom') }] : []);
3345
+ sizeRows.push(selectRow('preset', t('seat.sizePreset'),
3346
+ presetInList ? String(defaults.preset) : (seatPresets[0] || '__custom'), presetOptions,
3347
+ (value) => { if (value !== '__custom') saveDefaults({ preset: value }); }));
3348
+ if (seatCustom) {
3349
+ sizeRows.push(sideInput('width', t('seat.width'), defaults.width, defaults.width, IMAGE_MIN_SIDE, IMAGE_MAX_SIDE,
3350
+ (value) => saveDefaults({ width: value, preset: value + 'x' + defaults.height }), widthDraft, setWidthDraft, t('seat.width')));
3351
+ sizeRows.push(sideInput('height', t('seat.height'), defaults.height, defaults.height, IMAGE_MIN_SIDE, IMAGE_MAX_SIDE,
3352
+ (value) => saveDefaults({ height: value, preset: defaults.width + 'x' + value }), heightDraft, setHeightDraft, t('seat.height')));
3353
+ }
3354
+ } else {
3355
+ // wh / prompt:两个宽高输入框;prompt 另加一句说明。
3356
+ sizeRows.push(sideInput('width', t('seat.width'), defaults.width, defaults.width, IMAGE_MIN_SIDE, IMAGE_MAX_SIDE,
3357
+ (value) => saveDefaults({ width: value }), widthDraft, setWidthDraft, t('seat.width')));
3358
+ sizeRows.push(sideInput('height', t('seat.height'), defaults.height, defaults.height, IMAGE_MIN_SIDE, IMAGE_MAX_SIDE,
3359
+ (value) => saveDefaults({ height: value }), heightDraft, setHeightDraft, t('seat.height')));
3360
+ if (seatControl === 'prompt') {
3361
+ sizeRows.push(h('div', { key: 'promptHint', className: plainRow },
3362
+ h('span', { className: MS.cellLabel, style: { opacity: 0.7 } }, t('seat.sizePromptHint'))));
3363
+ }
3364
+ }
3365
+ const sizeHintKey = seatSizeSpec && seatSizeSpec.hint ? 'seat.sizeHint.' + String(seatSizeSpec.hint) : '';
3366
+ if (sizeHintKey) {
3367
+ sizeRows.push(h('div', { key: 'sizeHint', className: plainRow },
3368
+ h('span', { className: MS.cellLabel, style: { opacity: 0.7 } }, t(sizeHintKey))));
3369
+ }
3147
3370
  const sizePanel = [
3148
3371
  h('div', { key: 'size', className: MS.groups + ' scrollable', role: 'menu', 'aria-label': t('seat.menuSize') },
3149
3372
  h('div', { key: 'auto', className: plainRow },
@@ -3156,11 +3379,17 @@ window.__ModuleLoader__.load({
3156
3379
  })
3157
3380
  )
3158
3381
  ),
3159
- // 宽 = width,高 = height;一级菜单同样按「宽 × 高」显示
3160
- sideInput('width', t('seat.width'), defaults.width, defaults.width, IMAGE_MIN_SIDE, IMAGE_MAX_SIDE,
3161
- (value) => saveDefaults({ width: value }), widthDraft, setWidthDraft, t('seat.width')),
3162
- sideInput('height', t('seat.height'), defaults.height, defaults.height, IMAGE_MIN_SIDE, IMAGE_MAX_SIDE,
3163
- (value) => saveDefaults({ height: value }), heightDraft, setHeightDraft, t('seat.height'))
3382
+ // 严格模式紧跟自动尺寸:它管的是请求里的尺寸算不算数,与自动/固定无关。
3383
+ h('div', { key: 'strict', className: plainRow },
3384
+ h('span', { className: MS.cellLabel, title: t('seat.sizeStrictHint') }, t('seat.sizeStrict')),
3385
+ h('label', { className: MS.cellValue, title: t('seat.sizeStrictHint') },
3386
+ h('input', {
3387
+ type: 'checkbox', checked: !!defaults.strict, 'aria-label': t('seat.sizeStrict'),
3388
+ onChange: (event) => saveDefaults({ strict: event.target.checked })
3389
+ })
3390
+ )
3391
+ ),
3392
+ ...sizeRows
3164
3393
  )
3165
3394
  ];
3166
3395
  // Auto 行固定在第一行(搜索框下面):只有它被选中时,对话模型才能挑模型。
@@ -3403,7 +3632,7 @@ window.__ModuleLoader__.load({
3403
3632
  "seat.menuQuality": "质量",
3404
3633
  "seat.menuSize": "尺寸",
3405
3634
  "seat.menuPromptOptimization": "提示词优化",
3406
- "seat.fast": "快速预览",
3635
+ "seat.promptOptimizationUsage": "用量更多",
3407
3636
  "seat.notSelected": "未选择",
3408
3637
  "seat.on": "开",
3409
3638
  "seat.off": "关",
@@ -3421,7 +3650,6 @@ window.__ModuleLoader__.load({
3421
3650
  "seat.triggerAriaQuality": "生图模型:{model},质量 {quality}",
3422
3651
  "seat.settingsAria": "生图设置",
3423
3652
  "seat.moreSettings": "其他设置",
3424
- "seat.promptSection": "提示词",
3425
3653
  "seat.qualityUnsupported": "此模型未提供质量档位",
3426
3654
  "seat.qualityWarning": "更快消耗使用额度",
3427
3655
  "seat.levelsCount": "{count} 档",
@@ -3539,6 +3767,19 @@ window.__ModuleLoader__.load({
3539
3767
  "param.denoise.desc": "图生图时保留原图的程度;1 表示完全重绘",
3540
3768
  "param.batch_size.desc": "一次生成的图片数量,越大越占显存",
3541
3769
  "param.guidance.desc": "蒸馏模型的引导系数,通常固定在 1 附近",
3770
+ "form.a1111ParamsHint": "勾选后对话模型可以通过 params 覆盖这些参数;不勾选就沿用 WebUI 里的设置",
3771
+ "form.a1111ColType": "类型",
3772
+ "seat.sizeAspect": "比例",
3773
+ "seat.sizeTier": "档位",
3774
+ "seat.sizePreset": "尺寸",
3775
+ "seat.sizeCustom": "自定义",
3776
+ "seat.sizeStrict": "严格",
3777
+ "seat.sizeStrictHint": "成品尺寸一定等于设置值;会话里没指定尺寸时不生效",
3778
+ "seat.sizePromptHint": "该模型不接收尺寸参数;尺寸会写进提示词",
3779
+ "seat.sizeHint.ratioOnly": "分辨率由模型按比例决定",
3780
+ "seat.sizeHint.fixedPixels": "分辨率由平台固定:core 1.5MP,sd3/ultra 1MP",
3781
+ "seat.sizeHint.noSizeField": "该模型不接收尺寸参数",
3782
+ "seat.sizeHint.modelDecides": "不传尺寸时由模型自选",
3542
3783
  },
3543
3784
  "en": {
3544
3785
  "nav": "Image models",
@@ -3618,7 +3859,7 @@ window.__ModuleLoader__.load({
3618
3859
  "seat.menuQuality": "Quality",
3619
3860
  "seat.menuSize": "Size",
3620
3861
  "seat.menuPromptOptimization": "Prompt optimization",
3621
- "seat.fast": "Fast preview",
3862
+ "seat.promptOptimizationUsage": "Uses more quota",
3622
3863
  "seat.notSelected": "Not selected",
3623
3864
  "seat.on": "On",
3624
3865
  "seat.off": "Off",
@@ -3636,7 +3877,6 @@ window.__ModuleLoader__.load({
3636
3877
  "seat.triggerAriaQuality": "Image model: {model}, quality {quality}",
3637
3878
  "seat.settingsAria": "Image settings",
3638
3879
  "seat.moreSettings": "More settings",
3639
- "seat.promptSection": "Prompt",
3640
3880
  "seat.qualityUnsupported": "This model has no quality levels",
3641
3881
  "seat.qualityWarning": "Consumes usage quota faster",
3642
3882
  "seat.levelsCount": "{count} levels",
@@ -3754,6 +3994,19 @@ window.__ModuleLoader__.load({
3754
3994
  "param.denoise.desc": "How much of the source image is kept in image-to-image; 1 redraws it completely",
3755
3995
  "param.batch_size.desc": "Images generated per run; larger values use more VRAM",
3756
3996
  "param.guidance.desc": "Guidance scale for distilled models, usually close to 1",
3997
+ "form.a1111ParamsHint": "Checked parameters can be overridden through params; unchecked ones follow the WebUI settings",
3998
+ "form.a1111ColType": "Type",
3999
+ "seat.sizeAspect": "Ratio",
4000
+ "seat.sizeTier": "Tier",
4001
+ "seat.sizePreset": "Size",
4002
+ "seat.sizeCustom": "Custom",
4003
+ "seat.sizeStrict": "Strict",
4004
+ "seat.sizeStrictHint": "The result is forced to the configured size; no effect when the request carries no size",
4005
+ "seat.sizePromptHint": "This model takes no size field; the size is written into the prompt",
4006
+ "seat.sizeHint.ratioOnly": "Resolution follows the ratio",
4007
+ "seat.sizeHint.fixedPixels": "Resolution is fixed by the platform: core 1.5MP, sd3/ultra 1MP",
4008
+ "seat.sizeHint.noSizeField": "This model takes no size field",
4009
+ "seat.sizeHint.modelDecides": "The model picks when no size is sent",
3757
4010
  },
3758
4011
  "ja": {
3759
4012
  "nav": "画像生成モデル",
@@ -3833,7 +4086,7 @@ window.__ModuleLoader__.load({
3833
4086
  "seat.menuQuality": "画質",
3834
4087
  "seat.menuSize": "サイズ",
3835
4088
  "seat.menuPromptOptimization": "プロンプト最適化",
3836
- "seat.fast": "高速プレビュー",
4089
+ "seat.promptOptimizationUsage": "使用量が増えます",
3837
4090
  "seat.notSelected": "未選択",
3838
4091
  "seat.on": "オン",
3839
4092
  "seat.off": "オフ",
@@ -3851,7 +4104,6 @@ window.__ModuleLoader__.load({
3851
4104
  "seat.triggerAriaQuality": "画像生成モデル:{model}、画質 {quality}",
3852
4105
  "seat.settingsAria": "画像生成設定",
3853
4106
  "seat.moreSettings": "その他の設定",
3854
- "seat.promptSection": "プロンプト",
3855
4107
  "seat.qualityUnsupported": "このモデルには画質レベルがありません",
3856
4108
  "seat.qualityWarning": "使用量を早く消費します",
3857
4109
  "seat.levelsCount": "{count} 段階",
@@ -3969,6 +4221,19 @@ window.__ModuleLoader__.load({
3969
4221
  "param.denoise.desc": "画像から画像で元画像を残す度合い。1 は完全な再描画",
3970
4222
  "param.batch_size.desc": "一度に生成する枚数。大きいほど VRAM を使う",
3971
4223
  "param.guidance.desc": "蒸留モデルのガイダンス係数。通常は 1 付近",
4224
+ "form.a1111ParamsHint": "チェックした項目だけ params で上書きできます。チェックしない項目は WebUI の設定に従います",
4225
+ "form.a1111ColType": "種類",
4226
+ "seat.sizeAspect": "比率",
4227
+ "seat.sizeTier": "解像度",
4228
+ "seat.sizePreset": "サイズ",
4229
+ "seat.sizeCustom": "カスタム",
4230
+ "seat.sizeStrict": "厳密",
4231
+ "seat.sizeStrictHint": "出力サイズを設定値に揃えます。指定がない場合は無効です",
4232
+ "seat.sizePromptHint": "このモデルはサイズ指定を受け取らないためプロンプトに書き込みます",
4233
+ "seat.sizeHint.ratioOnly": "解像度は比率に応じて決まります",
4234
+ "seat.sizeHint.fixedPixels": "解像度は固定です:core 1.5MP、sd3/ultra 1MP",
4235
+ "seat.sizeHint.noSizeField": "このモデルはサイズ指定を受け取りません",
4236
+ "seat.sizeHint.modelDecides": "未指定ならモデルが選びます",
3972
4237
  },
3973
4238
  "es": {
3974
4239
  "nav": "Modelos de imagen",
@@ -4048,7 +4313,7 @@ window.__ModuleLoader__.load({
4048
4313
  "seat.menuQuality": "Calidad",
4049
4314
  "seat.menuSize": "Tamaño",
4050
4315
  "seat.menuPromptOptimization": "Optimización de prompts",
4051
- "seat.fast": "Vista rápida",
4316
+ "seat.promptOptimizationUsage": "Usa más cuota",
4052
4317
  "seat.notSelected": "Sin seleccionar",
4053
4318
  "seat.on": "Activado",
4054
4319
  "seat.off": "Desactivado",
@@ -4066,7 +4331,6 @@ window.__ModuleLoader__.load({
4066
4331
  "seat.triggerAriaQuality": "Modelo de imagen: {model}, calidad {quality}",
4067
4332
  "seat.settingsAria": "Ajustes de imagen",
4068
4333
  "seat.moreSettings": "Más ajustes",
4069
- "seat.promptSection": "Prompt",
4070
4334
  "seat.qualityUnsupported": "Este modelo no ofrece niveles de calidad",
4071
4335
  "seat.qualityWarning": "Consume la cuota más rápido",
4072
4336
  "seat.levelsCount": "{count} niveles",
@@ -4184,6 +4448,19 @@ window.__ModuleLoader__.load({
4184
4448
  "param.denoise.desc": "Cuánto de la imagen original se conserva; 1 la redibuja por completo",
4185
4449
  "param.batch_size.desc": "Imágenes por ejecución; valores mayores usan más VRAM",
4186
4450
  "param.guidance.desc": "Escala de guía para modelos destilados, normalmente cerca de 1",
4451
+ "form.a1111ParamsHint": "Los parámetros marcados se pueden sobrescribir con params; los demás siguen la configuración del WebUI",
4452
+ "form.a1111ColType": "Tipo",
4453
+ "seat.sizeAspect": "Proporción",
4454
+ "seat.sizeTier": "Nivel",
4455
+ "seat.sizePreset": "Tamaño",
4456
+ "seat.sizeCustom": "Personalizado",
4457
+ "seat.sizeStrict": "Estricto",
4458
+ "seat.sizeStrictHint": "El resultado se ajusta al tamaño configurado; sin tamaño no aplica",
4459
+ "seat.sizePromptHint": "Este modelo no acepta tamaño; se escribe en el prompt",
4460
+ "seat.sizeHint.ratioOnly": "La resolución depende de la proporción",
4461
+ "seat.sizeHint.fixedPixels": "La resolución la fija la plataforma: core 1.5MP, sd3/ultra 1MP",
4462
+ "seat.sizeHint.noSizeField": "Este modelo no acepta tamaño",
4463
+ "seat.sizeHint.modelDecides": "Si no se envía tamaño, lo elige el modelo",
4187
4464
  },
4188
4465
  "fr": {
4189
4466
  "nav": "Modèles d'image",
@@ -4263,7 +4540,7 @@ window.__ModuleLoader__.load({
4263
4540
  "seat.menuQuality": "Qualité",
4264
4541
  "seat.menuSize": "Taille",
4265
4542
  "seat.menuPromptOptimization": "Optimisation du prompt",
4266
- "seat.fast": "Aperçu rapide",
4543
+ "seat.promptOptimizationUsage": "Consomme plus de quota",
4267
4544
  "seat.notSelected": "Non sélectionné",
4268
4545
  "seat.on": "Activé",
4269
4546
  "seat.off": "Désactivé",
@@ -4281,7 +4558,6 @@ window.__ModuleLoader__.load({
4281
4558
  "seat.triggerAriaQuality": "Modèle d'image : {model}, qualité {quality}",
4282
4559
  "seat.settingsAria": "Paramètres d'image",
4283
4560
  "seat.moreSettings": "Autres réglages",
4284
- "seat.promptSection": "Prompt",
4285
4561
  "seat.qualityUnsupported": "Ce modèle n'expose pas de niveaux de qualité",
4286
4562
  "seat.qualityWarning": "Consomme le quota plus vite",
4287
4563
  "seat.levelsCount": "{count} niveaux",
@@ -4399,6 +4675,19 @@ window.__ModuleLoader__.load({
4399
4675
  "param.denoise.desc": "Part de l’image d’origine conservée ; 1 la redessine entièrement",
4400
4676
  "param.batch_size.desc": "Nombre d’images par exécution ; plus grand consomme plus de VRAM",
4401
4677
  "param.guidance.desc": "Échelle de guidage des modèles distillés, généralement proche de 1",
4678
+ "form.a1111ParamsHint": "Les paramètres cochés peuvent être remplacés via params ; les autres suivent les réglages du WebUI",
4679
+ "form.a1111ColType": "Type",
4680
+ "seat.sizeAspect": "Ratio",
4681
+ "seat.sizeTier": "Palier",
4682
+ "seat.sizePreset": "Taille",
4683
+ "seat.sizeCustom": "Personnalisé",
4684
+ "seat.sizeStrict": "Strict",
4685
+ "seat.sizeStrictHint": "La taille finale est forcée; sans taille demandée cela ne s applique pas",
4686
+ "seat.sizePromptHint": "Ce modèle n accepte pas de taille ; elle est écrite dans le prompt",
4687
+ "seat.sizeHint.ratioOnly": "La résolution suit le ratio",
4688
+ "seat.sizeHint.fixedPixels": "La résolution est fixe : core 1.5MP, sd3/ultra 1MP",
4689
+ "seat.sizeHint.noSizeField": "Ce modèle n accepte pas de taille",
4690
+ "seat.sizeHint.modelDecides": "Sans taille, le modèle choisit",
4402
4691
  },
4403
4692
  "de": {
4404
4693
  "nav": "Bildmodelle",
@@ -4478,7 +4767,7 @@ window.__ModuleLoader__.load({
4478
4767
  "seat.menuQuality": "Qualität",
4479
4768
  "seat.menuSize": "Größe",
4480
4769
  "seat.menuPromptOptimization": "Prompt-Optimierung",
4481
- "seat.fast": "Schnellvorschau",
4770
+ "seat.promptOptimizationUsage": "Verbraucht mehr Kontingent",
4482
4771
  "seat.notSelected": "Nicht ausgewählt",
4483
4772
  "seat.on": "Ein",
4484
4773
  "seat.off": "Aus",
@@ -4496,7 +4785,6 @@ window.__ModuleLoader__.load({
4496
4785
  "seat.triggerAriaQuality": "Bildmodell: {model}, Qualität {quality}",
4497
4786
  "seat.settingsAria": "Bildeinstellungen",
4498
4787
  "seat.moreSettings": "Weitere Einstellungen",
4499
- "seat.promptSection": "Prompt",
4500
4788
  "seat.qualityUnsupported": "Dieses Modell bietet keine Qualitätsstufen",
4501
4789
  "seat.qualityWarning": "Verbraucht das Kontingent schneller",
4502
4790
  "seat.levelsCount": "{count} Stufen",
@@ -4614,6 +4902,19 @@ window.__ModuleLoader__.load({
4614
4902
  "param.denoise.desc": "Wie viel vom Ausgangsbild erhalten bleibt; 1 zeichnet komplett neu",
4615
4903
  "param.batch_size.desc": "Bilder pro Lauf; größere Werte brauchen mehr VRAM",
4616
4904
  "param.guidance.desc": "Führungsskala für distillierte Modelle, meist nahe 1",
4905
+ "form.a1111ParamsHint": "Angehakte Parameter lassen sich über params überschreiben; die übrigen folgen den WebUI-Einstellungen",
4906
+ "form.a1111ColType": "Typ",
4907
+ "seat.sizeAspect": "Seitenverhältnis",
4908
+ "seat.sizeTier": "Stufe",
4909
+ "seat.sizePreset": "Größe",
4910
+ "seat.sizeCustom": "Benutzerdefiniert",
4911
+ "seat.sizeStrict": "Strikt",
4912
+ "seat.sizeStrictHint": "Die Ausgabegröße wird erzwungen; ohne Größe im Request wirkungslos",
4913
+ "seat.sizePromptHint": "Dieses Modell nimmt keine Größe an; sie wird in den Prompt geschrieben",
4914
+ "seat.sizeHint.ratioOnly": "Die Auflösung folgt dem Seitenverhältnis",
4915
+ "seat.sizeHint.fixedPixels": "Die Auflösung ist fest: core 1.5MP, sd3/ultra 1MP",
4916
+ "seat.sizeHint.noSizeField": "Dieses Modell nimmt keine Größe an",
4917
+ "seat.sizeHint.modelDecides": "Ohne Größe wählt das Modell",
4617
4918
  },
4618
4919
  "ru": {
4619
4920
  "nav": "Модели изображений",
@@ -4693,7 +4994,7 @@ window.__ModuleLoader__.load({
4693
4994
  "seat.menuQuality": "Качество",
4694
4995
  "seat.menuSize": "Размер",
4695
4996
  "seat.menuPromptOptimization": "Оптимизация промпта",
4696
- "seat.fast": "Быстрый просмотр",
4997
+ "seat.promptOptimizationUsage": "Расходует больше квоты",
4697
4998
  "seat.notSelected": "Не выбрано",
4698
4999
  "seat.on": "Вкл.",
4699
5000
  "seat.off": "Выкл.",
@@ -4711,7 +5012,6 @@ window.__ModuleLoader__.load({
4711
5012
  "seat.triggerAriaQuality": "Модель изображений: {model}, качество {quality}",
4712
5013
  "seat.settingsAria": "Настройки изображений",
4713
5014
  "seat.moreSettings": "Другие настройки",
4714
- "seat.promptSection": "Промпт",
4715
5015
  "seat.qualityUnsupported": "У этой модели нет уровней качества",
4716
5016
  "seat.qualityWarning": "Быстрее расходует квоту",
4717
5017
  "seat.levelsCount": "{count} уровней",
@@ -4829,6 +5129,19 @@ window.__ModuleLoader__.load({
4829
5129
  "param.denoise.desc": "Доля исходного изображения, которая сохраняется; 1 — полная перерисовка",
4830
5130
  "param.batch_size.desc": "Сколько изображений за запуск; больше — больше видеопамяти",
4831
5131
  "param.guidance.desc": "Коэффициент наведения для дистиллированных моделей, обычно около 1",
5132
+ "form.a1111ParamsHint": "Отмеченные параметры можно переопределить через params; остальные берутся из настроек WebUI",
5133
+ "form.a1111ColType": "Тип",
5134
+ "seat.sizeAspect": "Пропорции",
5135
+ "seat.sizeTier": "Уровень",
5136
+ "seat.sizePreset": "Размер",
5137
+ "seat.sizeCustom": "Свой",
5138
+ "seat.sizeStrict": "Строго",
5139
+ "seat.sizeStrictHint": "Размер результата принудительно задаётся; без размера в запросе не действует",
5140
+ "seat.sizePromptHint": "Модель не принимает размер; он добавляется в промпт",
5141
+ "seat.sizeHint.ratioOnly": "Разрешение зависит от пропорций",
5142
+ "seat.sizeHint.fixedPixels": "Разрешение задаёт платформа: core 1.5MP, sd3/ultra 1MP",
5143
+ "seat.sizeHint.noSizeField": "Модель не принимает размер",
5144
+ "seat.sizeHint.modelDecides": "Без размера выбирает модель",
4832
5145
  },
4833
5146
  "pt": {
4834
5147
  "nav": "Modelos de imagem",
@@ -4908,7 +5221,7 @@ window.__ModuleLoader__.load({
4908
5221
  "seat.menuQuality": "Qualidade",
4909
5222
  "seat.menuSize": "Tamanho",
4910
5223
  "seat.menuPromptOptimization": "Otimização de prompt",
4911
- "seat.fast": "Prévia rápida",
5224
+ "seat.promptOptimizationUsage": "Usa mais cota",
4912
5225
  "seat.notSelected": "Não selecionado",
4913
5226
  "seat.on": "Ativado",
4914
5227
  "seat.off": "Desativado",
@@ -4926,7 +5239,6 @@ window.__ModuleLoader__.load({
4926
5239
  "seat.triggerAriaQuality": "Modelo de imagem: {model}, qualidade {quality}",
4927
5240
  "seat.settingsAria": "Configurações de imagem",
4928
5241
  "seat.moreSettings": "Mais ajustes",
4929
- "seat.promptSection": "Prompt",
4930
5242
  "seat.qualityUnsupported": "Este modelo não oferece níveis de qualidade",
4931
5243
  "seat.qualityWarning": "Consome a cota mais rápido",
4932
5244
  "seat.levelsCount": "{count} níveis",
@@ -5044,6 +5356,19 @@ window.__ModuleLoader__.load({
5044
5356
  "param.denoise.desc": "Quanto da imagem original é mantido; 1 redesenha por completo",
5045
5357
  "param.batch_size.desc": "Imagens por execução; valores maiores usam mais VRAM",
5046
5358
  "param.guidance.desc": "Escala de orientação para modelos destilados, normalmente perto de 1",
5359
+ "form.a1111ParamsHint": "Os parâmetros marcados podem ser substituídos via params; os demais seguem as configurações do WebUI",
5360
+ "form.a1111ColType": "Tipo",
5361
+ "seat.sizeAspect": "Proporção",
5362
+ "seat.sizeTier": "Nível",
5363
+ "seat.sizePreset": "Tamanho",
5364
+ "seat.sizeCustom": "Personalizado",
5365
+ "seat.sizeStrict": "Estrito",
5366
+ "seat.sizeStrictHint": "O resultado é forçado ao tamanho configurado; sem tamanho no pedido não se aplica",
5367
+ "seat.sizePromptHint": "Este modelo não aceita tamanho; ele vai no prompt",
5368
+ "seat.sizeHint.ratioOnly": "A resolução segue a proporção",
5369
+ "seat.sizeHint.fixedPixels": "A resolução é fixa: core 1.5MP, sd3/ultra 1MP",
5370
+ "seat.sizeHint.noSizeField": "Este modelo não aceita tamanho",
5371
+ "seat.sizeHint.modelDecides": "Sem tamanho, o modelo escolhe",
5047
5372
  },
5048
5373
  };
5049
5374
  // END GENERATED LOCALES
@@ -5226,6 +5551,9 @@ window.__ModuleLoader__.load({
5226
5551
  postUpdateAction: postUpdateAction,
5227
5552
  qualityRailLevels: qualityRailLevels,
5228
5553
  qualityBucketOf: qualityBucketOf,
5554
+ sizeSpecFor: sizeSpecFor,
5555
+ sizeValueLabel: sizeValueLabel,
5556
+ sizeControlOf: sizeControlOf,
5229
5557
  codexSkinProbe: codexSkinProbe,
5230
5558
  deriveSeatView: deriveSeatView,
5231
5559
  detectSeatSkinFromMarkers: detectSeatSkinFromMarkers,