Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ranting8323
Auto Photoshop StableDiffusion Plugin
提交
662d2f1e
A
Auto Photoshop StableDiffusion Plugin
项目概览
Ranting8323
/
Auto Photoshop StableDiffusion Plugin
10 个月 前同步成功
通知
141
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
分析
仓库
DevOps
项目成员
Pages
A
Auto Photoshop StableDiffusion Plugin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Pages
分析
分析
仓库分析
DevOps
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
提交
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
662d2f1e
编写于
9月 14, 2023
作者:
A
Abdullah Alfaraj
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add textural inversion menu
上级
df868ddb
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
27 addition
and
1 deletion
+27
-1
typescripts/sd_tab/sd_tab.tsx
typescripts/sd_tab/sd_tab.tsx
+12
-0
typescripts/sd_tab/util.ts
typescripts/sd_tab/util.ts
+14
-0
typescripts/viewer/viewer.tsx
typescripts/viewer/viewer.tsx
+1
-1
未找到文件。
typescripts/sd_tab/sd_tab.tsx
浏览文件 @
662d2f1e
...
...
@@ -284,6 +284,18 @@ class SDTab extends React.Component<{}> {
})
}
}
></
SpMenu
>
<
SpMenu
title
=
"use textual inversion in your prompt"
style
=
{
{
...
styles
.
spMenu
}
}
items
=
{
helper_store
.
data
.
embeddings
}
label_item
=
"Select Textual Inversion"
onChange
=
{
(
id
:
any
,
value
:
any
)
=>
{
const
prompt
=
multiPrompts
.
getPrompt
().
positive
multiPrompts
.
setPrompt
({
positive
:
`
${
prompt
}
${
value
.
item
}
`
,
})
}
}
></
SpMenu
>
<
sp
-
checkbox
title
=
"use {keyword} form the prompts library"
...
...
typescripts/sd_tab/util.ts
浏览文件 @
662d2f1e
...
...
@@ -174,6 +174,7 @@ export const helper_store = new AStore({
b_show_sampler
:
false
,
//false when off, true when on,
models
:
[]
as
any
[],
loras
:
[]
as
any
[],
embeddings
:
[]
as
any
[],
sampler_list
:
[]
as
any
[],
hr_upscaler_list
:
[]
as
string
[],
previous_width
:
512
,
...
...
@@ -366,6 +367,7 @@ export async function refreshUI() {
await
refreshModels
()
helper_store
.
data
.
loras
=
await
requestLoraModels
()
helper_store
.
data
.
embeddings
=
await
requestEmbeddings
()
await
refreshExtraUpscalers
()
await
setInpaintMaskWeight
(
1.0
)
//set the inpaint conditional mask to 1 when the on plugin start
...
...
@@ -433,6 +435,18 @@ export async function requestLoraModels() {
return
lora_models
}
export
async
function
requestEmbeddings
()
{
try
{
const
full_url
=
`
${
g_sd_url
}
/sdapi/v1/embeddings`
let
results
=
(
await
requestGet
(
full_url
))
||
{}
let
embeddings
=
Object
.
keys
(
results
?.
loaded
||
{})
return
embeddings
}
catch
(
e
)
{
console
.
error
(
e
)
return
[]
}
}
export
function
getLoraModelPrompt
(
lora_model_name
:
string
)
{
return
`<lora:
${
lora_model_name
}
:1>`
}
...
...
typescripts/viewer/viewer.tsx
浏览文件 @
662d2f1e
...
...
@@ -499,7 +499,7 @@ const Viewer = observer(() => {
title
=
"expand the Photoshop masking by x pixels"
>
<
sp
-
label
slot
=
"label"
>
{
Locale
(
'
Expand by
'
)
}
{
Locale
(
'
Expand by
'
)
}
{
'
'
}
</
sp
-
label
>
<
sp
-
label
slot
=
"label"
>
{
mask_store
.
data
.
expand_by
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录