remove: 移除 image-01-live 模型及相关代码
This commit is contained in:
41
ui.js
41
ui.js
@@ -31,10 +31,6 @@ const nPlus = $('nPlus');
|
||||
const seedInput = $('seedInput');
|
||||
const widthInput = $('widthInput');
|
||||
const heightInput = $('heightInput');
|
||||
const styleGroup = $('styleGroup');
|
||||
const styleType = $('styleType');
|
||||
const styleWeight = $('styleWeight');
|
||||
const weightHint = $('weightHint');
|
||||
const promptOptimizer= $('promptOptimizer');
|
||||
const watermark = $('watermark');
|
||||
const settingsModal = $('settingsModal');
|
||||
@@ -46,30 +42,6 @@ const apiKeyInput = $('apiKeyInput');
|
||||
const toggleKey = $('toggleKey');
|
||||
const baseUrlInput = $('baseUrlInput');
|
||||
|
||||
// ── Model tabs ─────────────────────────────────────────────────
|
||||
|
||||
document.querySelectorAll('.model-tab').forEach(tab => {
|
||||
tab.addEventListener('click', () => {
|
||||
const model = tab.dataset.model;
|
||||
setModel(model);
|
||||
});
|
||||
});
|
||||
|
||||
function setModel(model) {
|
||||
currentModel = model;
|
||||
document.querySelectorAll('.model-tab').forEach(t =>
|
||||
t.classList.toggle('active', t.dataset.model === model)
|
||||
);
|
||||
|
||||
const isLive = model === 'image-01-live';
|
||||
styleGroup.style.display = isLive ? '' : 'none';
|
||||
|
||||
// 21:9 only for image-01
|
||||
const opt21_9 = aspectRatio.querySelector('option[value="21:9"]');
|
||||
if (opt21_9) opt21_9.disabled = isLive;
|
||||
if (isLive && aspectRatio.value === '21:9') aspectRatio.value = '16:9';
|
||||
}
|
||||
|
||||
// ── Stepper (n) ────────────────────────────────────────────────
|
||||
|
||||
nMinus.addEventListener('click', () => {
|
||||
@@ -82,12 +54,6 @@ nPlus.addEventListener('click', () => {
|
||||
if (v <= 9) nInput.value = v;
|
||||
});
|
||||
|
||||
// ── Weight slider ──────────────────────────────────────────────
|
||||
|
||||
styleWeight.addEventListener('input', () => {
|
||||
weightHint.textContent = (styleWeight.value / 10).toFixed(1);
|
||||
});
|
||||
|
||||
// ── Helpers ────────────────────────────────────────────────────
|
||||
|
||||
function setLoading(on) {
|
||||
@@ -135,13 +101,6 @@ function buildPayload() {
|
||||
if (promptOptimizer.checked) payload.prompt_optimizer = true;
|
||||
if (watermark.checked) payload.aigc_watermark = true;
|
||||
|
||||
if (currentModel === 'image-01-live') {
|
||||
payload.style = {
|
||||
style_type: styleType.value,
|
||||
style_weight: parseFloat((styleWeight.value / 10).toFixed(1)),
|
||||
};
|
||||
}
|
||||
|
||||
return payload;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user