From 096bcbca56aad6466cc375c25ab847f043d3ef71 Mon Sep 17 00:00:00 2001 From: zyc404 Date: Thu, 12 Oct 2023 17:18:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0bing=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E7=BB=98=E5=9B=BE=E5=9B=BE=E7=89=87=E5=A4=A7=E5=B0=8F?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/chat.js | 4 ++-- resources/view/setting_view.json | 12 ++++++++++++ utils/config.js | 2 ++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/apps/chat.js b/apps/chat.js index e5ebf42..5a666c8 100644 --- a/apps/chat.js +++ b/apps/chat.js @@ -1672,8 +1672,8 @@ export class chatgpt extends plugin { headers: {'content-type': 'application/json'}, body: JSON.stringify({ prompt: response.details.imageTag, - width: 512, - height: 512, + width: Config.bingDrawWidth || 512, + height: Config.bingDrawHeight || 512, sampler_index: Config.bingDrawSampler || 'DPM++ 2M SDE' }) } diff --git a/resources/view/setting_view.json b/resources/view/setting_view.json index 73b8f20..83ac167 100644 --- a/resources/view/setting_view.json +++ b/resources/view/setting_view.json @@ -647,6 +647,18 @@ "type": "text", "label": "第三方绘图采样方法", "data": "bingDrawSampler" + }, + { + "type": "number", + "label": "第三方绘图宽度", + "placeholder": "图片宽度", + "data": "bingDrawWidth" + }, + { + "type": "bingDrawWidth", + "label": "第三方绘图高度", + "placeholder": "图片高度", + "data": "bingDrawHeight" } ] }, diff --git a/utils/config.js b/utils/config.js index ada1295..d0f7707 100644 --- a/utils/config.js +++ b/utils/config.js @@ -98,6 +98,8 @@ const defaultConfig = { enforceMaster: false, bingDrawApi: '', bingDrawSampler: '', + bingDrawWidth: 512, + bingDrawHeight: 512, serverPort: 3321, serverHost: '', viewHost: '',