diff --git a/README.md b/README.md index 849899f..787c245 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # 图片生成器 -MiniMax 文生图工具,基于 `image-01` / `image-01-live` 模型。 +MiniMax 文生图工具,基于 `image-01` 模型。 **访问:** `http://域名或IP:8195` @@ -93,15 +93,14 @@ image-generator/ | 参数 | 默认 | 说明 | |------|------|------| -| `model` | `image-01` | `image-01` / `image-01-live` | +| `model` | `image-01` | 模型,目前仅支持 `image-01` | | `prompt` | 必填 | 图片描述,最多 1500 字符 | | `aspect_ratio` | `16:9` | `1:1` `16:9` `4:3` `3:2` `2:3` `3:4` `9:16` `21:9` | | `response_format` | `url` | `url`(24h有效)或 `base64` | | `n` | `1` | 数量 1-9 | | `seed` | 随机 | 整数,用于复现 | | `width` / `height` | — | 自定义分辨率 512-2048(8的倍数) | -| `style.style_type` | — | 画风:漫画/元气/中世纪/水彩(仅 live) | -| `style.style_weight` | 0.8 | 画风权重 0.1-1.0(仅 live) | + ### 常见错误 diff --git a/app.js b/app.js index b2b49d0..6b817c2 100644 --- a/app.js +++ b/app.js @@ -55,7 +55,7 @@ app.post('/api/generate', async (req, res) => { if (!prompt || typeof prompt !== 'string' || !prompt.trim()) { return res.status(400).json({ error: '请输入图片描述' }); } - if (model !== 'image-01' && model !== 'image-01-live') { + if (model !== 'image-01') { return res.status(400).json({ error: 'model 参数无效' }); } @@ -78,15 +78,6 @@ app.post('/api/generate', async (req, res) => { if (prompt_optimizer) payload.prompt_optimizer = true; if (aigc_watermark) payload.aigc_watermark = true; - // style only for image-01-live - if (model === 'image-01-live' && style) { - const { style_type, style_weight } = style; - if (style_type) { - payload.style = { style_type }; - if (style_weight != null) payload.style.style_weight = style_weight; - } - } - const baseUrl = cfg.baseUrl || 'https://api.minimaxi.com'; const endpoint = `${baseUrl}/v1/image_generation`; diff --git a/index.html b/index.html index 5bd0141..b09c4d6 100644 --- a/index.html +++ b/index.html @@ -36,17 +36,7 @@
- -
- - -
+
@@ -127,18 +117,7 @@

同时设置宽高时优先于比例

- - +
diff --git a/ui.js b/ui.js index b97e5fd..276a975 100644 --- a/ui.js +++ b/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; }