diff --git a/src/App.vue b/src/App.vue
index 3bdc0cf116d84ce6cf031100c124ca25f75bfecb..f39fe72f3b61b8e91884257444ac162b77400300 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -23,14 +23,14 @@
-
+
{{ item.label }}
-
+
@@ -192,7 +192,7 @@ export default {
{ label: '公共服务器', value: 'common' },
{ label: '私有服务器', value: 'private' },
],
- sdServerUrl: 'https://gpu-pod64a4ff02b54fe048c07abc40-6006.node.inscode.run/sdapi/v1/txt2img',
+ sdServerUrl: '',
loading: false,
maxHistory: 200,
speaking: false, // 是否正在输出语音
@@ -313,7 +313,11 @@ export default {
const negative_prompt = this.negative_prompt
const _this = this
const messages = this.message
- messages.push({ "user": "User", "message": 'prompt:
' + this.prompt + (negative_prompt ? '
' + 'negative_prompt: ' + negative_prompt : '') })
+ const content = 'prompt:
' +
+ this.prompt +
+ (negative_prompt ? '
' + 'negative_prompt: ' + negative_prompt : '') + '
' +
+ 'width: ' + this.width + ' height: ' + this.height + '
steps: ' + this.steps +'
sampler: ' + this.sampler
+ messages.push({ "user": "User", "message": content })
messages.push(currentMsg)
@@ -473,13 +477,12 @@ export default {
copyAsPrompt (message) {
this.prompt = message
},
- handleServerTypeChange (type) {
+ handleSDServerTypeChange (type) {
if (type === 'common') {
this.sdServerUrl = this.config.common_sd_api
}
-
- console.info(123)
+ this.saveConfig()
},
recoverConfig () {
const config = localStorage.getItem('ai-config')
@@ -488,18 +491,25 @@ export default {
this.config = configJSON
this.sdServerType = configJSON.sdServerType
this.sdServerUrl = configJSON.sdServerUrl
+ this.sdServerType = configJSON.sdServerType??'common'
+
+ const data = Config.getData().data
+ this.name = data.name
+ document.title = this.name
} else {
this.getAppInfo()
this.sdServerUrl = this.config.common_sd_api
+ this.sdServerType = 'common'
}
},
saveConfig () {
-
+
const config = JSON.parse(JSON.stringify(this.config))
config.sdServerType = this.sdServerType
config.sdServerUrl = this.sdServerUrl
+ config.sdServerType = this.sdServerType
localStorage.setItem('ai-config', JSON.stringify(config))
}
},
diff --git a/src/js/config.js b/src/js/config.js
index 0127adb0814d6fc7b2c1c25cbd5cb7a9d7d55d03..440f40c4a1aec951f793773a6203bb33cf679aa6 100644
--- a/src/js/config.js
+++ b/src/js/config.js
@@ -4,7 +4,7 @@ export default {
"code": 200,
"data": {
"id": 128897,
- "name": "小羊驼",
+ "name": "AI绘图",
"create_time": 1684920670901,
"app": "llm_rep",
"resource_type": "app",