From d6d4ca573abfe3edfa62077f0fb40002c4974035 Mon Sep 17 00:00:00 2001 From: 622aa39c1f9b166ab1a38c05 <622aa39c1f9b166ab1a38c05@devide> Date: Wed, 5 Jul 2023 07:23:00 +0000 Subject: [PATCH] Wed Jul 5 07:23:00 UTC 2023 inscode --- src/App.vue | 38 ++++++++++++++++++++++++++++++-------- src/js/sd.js | 4 ++-- 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/src/App.vue b/src/App.vue index 94894a7..c3218ac 100644 --- a/src/App.vue +++ b/src/App.vue @@ -52,8 +52,8 @@
-
- {{ item.message }} +
+
@@ -85,10 +85,18 @@
-
+
+ + + + + + + + +
-
- +
+
* @@ -155,6 +166,7 @@ export default { user_img: "", robot_img: "", user_call_name: "xxx", + width: 512, // api_url: 'https://inscode-ide.node.inscode.run:8000/v1', // index_url: 'http://127.0.0.1:8000/search', // index_name: 'datasea', @@ -175,6 +187,9 @@ export default { height: 512, steps: 20, sampler: 'DPM++ SDE Karras', + showMoreSetting: false, + default_prompt: '1girl, (ulzzang-6500:0.7), kpop idol, yae miko, detached sleeves, bare shoulders, pink hair, long hair, cleavage,japanese clothes,breast,best quality, (painting:1.5), (hair ornament:1.35), jewelry, purple eyes, earrings, breasts, torii, cherry blossoms, lantern light, depth of field, detailed face, face focus, ribbon_trim, (looking at viewer:1.25), nontraditional miko, shiny skin, long sleeves, smile, thick lips, game cg, east asian architecture, (blurry background:1.2), sitting, upper body ,', + negative_prompt: 'bright lantern, brightness, (nipples:1.2), pussy, EasyNegative, (worst quality:2), (low quality:2), (normal quality:2), lowres, normal quality, ((monochrome)), ((grayscale)), skin spots, acnes, skin blemishes, age spot, glans,extra fingers, fewer fingers, strange fingers, bad hand, bare thighs,hand,bad finger', } }, methods: { @@ -270,16 +285,23 @@ export default { "user": "AI", "message": '', img: null, viewMode: 'image' } const query = this.prompt + const negative_prompt = this.negative_prompt const _this = this const messages = this.message - messages.push({ "user": "User", "message": this.prompt }) + messages.push({ "user": "User", "message": 'prompt:
' + this.prompt + (negative_prompt ? '
' + 'negative_prompt:
' + negative_prompt : '') }) messages.push(currentMsg) this.loading = true - this.prompt = '' + // this.prompt = '' this.scrollBottom() - SDApi.draw(this.config, query).then(res => { + const config = JSON.parse(JSON.stringify(this.config)) + config.width = this.width + config.height = this.height + config.steps = this.steps + config.sampler = this.sampler + + SDApi.draw(config, query, negative_prompt).then(res => { _this.loading = false _this.saveHistory() diff --git a/src/js/sd.js b/src/js/sd.js index 2bbc8a1..64e4fa0 100644 --- a/src/js/sd.js +++ b/src/js/sd.js @@ -1,13 +1,13 @@ import axios from "axios"; export default { - draw (config, prompt) { + draw (config, prompt, negative_prompt) { return new Promise(function(resolve,rejcet){ const data = { prompt: prompt, steps: config?.steps??20, - negative_prompt: config?.negative_prompt??'nsfw bright lantern, brightness, (nipples:1.2), pussy, EasyNegative, (worst quality:2), (low quality:2), (normal quality:2), lowres, normal quality, ((monochrome)), ((grayscale)), skin spots, acnes, skin blemishes, age spot, glans,extra fingers, fewer fingers, strange fingers, bad hand, bare thighs,hand,bad finger', + negative_prompt: negative_prompt??'nsfw', width: config?.width??512, height: config?.height??512, cfg_scale: config?.cfg_scale??6, -- GitLab