Fri Jul 7 08:01:01 UTC 2023 inscode

上级 c64e1cdd
......@@ -23,14 +23,14 @@
<t-form labelAlign="top">
<t-form-item label="StableDiffusion服务器类型" name="sdServerType">
<t-select v-model="sdServerType" @change="handleSDServerTypeChange">
<t-select v-model="sdServerType" @change="handleSDServerTypeChange" class="bg-gray-200" style="background: #ccc;font-size:12px;">
<t-option v-for="(item, index) in sdServerTypeOptions" :key="index" :value="item.value" :label="item.label">
{{ item.label }}
</t-option>
</t-select>
</t-form-item>
<t-form-item label="服务器地址" name="sdServerUrl">
<t-textarea placeholder="请输入内容" v-model="sdServerUrl" :autosize="true"/>
<t-textarea placeholder="请输入内容" v-model="sdServerUrl" :autosize="true" @change="saveConfig"/>
</t-form-item>
</t-form>
<t-card class="bg-orange-100 mt-8 text-gray-600 text-sm" v-if="sdServerType === 'common'">
......@@ -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: <br/>' + this.prompt + (negative_prompt ? '<br/>' + 'negative_prompt: </br>' + negative_prompt : '') })
const content = 'prompt: <br/>' +
this.prompt +
(negative_prompt ? '<br/><br/>' + 'negative_prompt: </br>' + negative_prompt : '') + '<br/><br/>' +
'width: ' + this.width + ' height: ' + this.height + '<br/>steps: ' + this.steps +'<br/>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))
}
},
......
......@@ -4,7 +4,7 @@ export default {
"code": 200,
"data": {
"id": 128897,
"name": "小羊驼",
"name": "AI绘图",
"create_time": 1684920670901,
"app": "llm_rep",
"resource_type": "app",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册