Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
m0_46799696
免费的AI作图
提交
d6d4ca57
免
免费的AI作图
项目概览
m0_46799696
/
免费的AI作图
与 Fork 源项目一致
Fork自
冯丙见 / AI绘图
通知
1
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
免
免费的AI作图
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
d6d4ca57
编写于
7月 05, 2023
作者:
6
622aa39c1f9b166ab1a38c05
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Wed Jul 5 07:23:00 UTC 2023 inscode
上级
ddd84422
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
32 addition
and
10 deletion
+32
-10
src/App.vue
src/App.vue
+30
-8
src/js/sd.js
src/js/sd.js
+2
-2
未找到文件。
src/App.vue
浏览文件 @
d6d4ca57
...
...
@@ -52,8 +52,8 @@
<div
class=
"flex flex-row-reverse"
>
<t-image
class=
"rounded-lg"
v-if=
"config.user_img"
:src=
"config.user_img"
fit=
"cover"
:style=
"
{ width: '40px', height: '40px' }">
</t-image>
<div
class=
"bg-green-400 text-gray-700 p-4 mx-2 w-fit max-w-2xl 2xl:max-w-4xl rounded-lg cursor-pointer"
@
click=
"copyAsPrompt(item.message)"
>
{{
item
.
message
}}
<div
class=
"bg-green-400 text-gray-700 p-4 mx-2 w-fit max-w-2xl 2xl:max-w-4xl rounded-lg cursor-pointer"
@
click=
"copyAsPrompt(item.message)"
v-html=
"item.message"
>
</div>
</div>
...
...
@@ -85,10 +85,18 @@
</div>
</div>
<div
class=
"w-full absolute bottom-0 bg-slate-100 h-22 py-2 px-2 rounded flex flex-col"
>
<div
class=
"w-full absolute bottom-0 bg-slate-100 h-22 py-2 px-2 rounded flex flex-col
text-sm
"
>
<div
class=
"w-full h-10 flex"
>
<input
v-model=
"prompt"
class=
"flex-auto ring-0 outline-0 pl-2 bg-slate-200 h-10"
v-on:keyup.enter=
"query"
placeholder=
"提示词"
/>
<svg
xmlns=
"http://www.w3.org/2000/svg"
fill=
"none"
viewBox=
"0 0 24 24"
stroke-width=
"1.5"
stroke=
"currentColor"
@
click=
"showMoreSetting=!showMoreSetting"
class=
"w-6 mx-2 ml-4 mt-2 h-6 flex-none text-cyan-800 font-bold hover:text-cyan-600 cursor-pointer"
>
<path
stroke-linecap=
"round"
stroke-linejoin=
"round"
d=
"M10.343 3.94c.09-.542.56-.94 1.11-.94h1.093c.55 0 1.02.398 1.11.94l.149.894c.07.424.384.764.78.93.398.164.855.142 1.205-.108l.737-.527a1.125 1.125 0 011.45.12l.773.774c.39.389.44 1.002.12 1.45l-.527.737c-.25.35-.272.806-.107 1.204.165.397.505.71.93.78l.893.15c.543.09.94.56.94 1.109v1.094c0 .55-.397 1.02-.94 1.11l-.893.149c-.425.07-.765.383-.93.78-.165.398-.143.854.107 1.204l.527.738c.32.447.269 1.06-.12 1.45l-.774.773a1.125 1.125 0 01-1.449.12l-.738-.527c-.35-.25-.806-.272-1.203-.107-.397.165-.71.505-.781.929l-.149.894c-.09.542-.56.94-1.11.94h-1.094c-.55 0-1.019-.398-1.11-.94l-.148-.894c-.071-.424-.384-.764-.781-.93-.398-.164-.854-.142-1.204.108l-.738.527c-.447.32-1.06.269-1.45-.12l-.773-.774a1.125 1.125 0 01-.12-1.45l.527-.737c.25-.35.273-.806.108-1.204-.165-.397-.505-.71-.93-.78l-.894-.15c-.542-.09-.94-.56-.94-1.109v-1.094c0-.55.398-1.02.94-1.11l.894-.149c.424-.07.765-.383.93-.78.165-.398.143-.854-.107-1.204l-.527-.738a1.125 1.125 0 01.12-1.45l.773-.773a1.125 1.125 0 011.45-.12l.737.527c.35.25.807.272 1.204.107.397-.165.71-.505.78-.929l.15-.894z"
/>
<path
stroke-linecap=
"round"
stroke-linejoin=
"round"
d=
"M15 12a3 3 0 11-6 0 3 3 0 016 0z"
/>
</svg>
<svg
xmlns=
"http://www.w3.org/2000/svg"
fill=
"none"
viewBox=
"0 0 24 24"
stroke-width=
"1.5"
stroke=
"currentColor"
class=
"w-6 mx-2 ml-4 mt-2 h-6 flex-none text-cyan-800 font-bold hover:text-cyan-600 cursor-pointer"
...
...
@@ -96,9 +104,12 @@
<path
stroke-linecap=
"round"
stroke-linejoin=
"round"
d=
"M6 12L3.269 3.126A59.768 59.768 0 0121.485 12 59.77 59.77 0 013.27 20.876L5.999 12zm0 0h7.5"
/>
</svg>
</div>
<div
class=
"w-full h-10 mt-2
pr-12 flex gap-2
"
>
<input
v-model=
"prompt"
class=
"flex-auto ring-0 outline-0 pl-2 bg-slate-200 h-10"
v-on:keyup.enter=
"query"
placeholder=
"逆向提示词"
/>
<div
class=
"w-full h-10 mt-2
flex gap-2"
v-if=
"showMoreSetting
"
>
<input
v-model=
"
negative_
prompt"
class=
"flex-auto ring-0 outline-0 pl-2 bg-slate-200 h-10"
v-on:keyup.enter=
"query"
placeholder=
"逆向提示词"
/>
<div
class=
"flex-none w-40 ring-0 outline-0 pl-2 h-10 flex justify-between"
>
<input
v-model=
"width"
class=
"ring-0 outline-0 pl-2 bg-slate-200 h-10 w-16"
placeholder=
"width"
/>
<span
class=
"h-10 leading-10"
>
*
</span>
...
...
@@ -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 <lora:YaeMiko_Test:0.45>,<lora:mix4:0.5>
'
,
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: <br/>
'
+
this
.
prompt
+
(
negative_prompt
?
'
<br/>
'
+
'
negative_prompt: </br>
'
+
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
()
...
...
src/js/sd.js
浏览文件 @
d6d4ca57
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
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录