Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Overbill1683
Stable Diffusion Webui
提交
618c59b0
S
Stable Diffusion Webui
项目概览
Overbill1683
/
Stable Diffusion Webui
10 个月 前同步成功
通知
1748
Star
81
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
分析
仓库
DevOps
项目成员
Pages
S
Stable Diffusion Webui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Pages
分析
分析
仓库分析
DevOps
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
提交
体验新版 GitCode,发现更多精彩内容 >>
提交
618c59b0
编写于
5月 21, 2023
作者:
A
Aarni Koskela
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add option to disable prompt token counters
上级
5ed970b9
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
9 addition
and
0 deletion
+9
-0
javascript/token-counters.js
javascript/token-counters.js
+8
-0
modules/shared.py
modules/shared.py
+1
-0
未找到文件。
javascript/token-counters.js
浏览文件 @
618c59b0
...
...
@@ -21,6 +21,9 @@ function update_img2img_tokens(...args) {
}
function
update_token_counter
(
button_id
)
{
if
(
opts
.
disable_token_counters
)
{
return
;
}
if
(
promptTokenCountTimeouts
[
button_id
])
{
clearTimeout
(
promptTokenCountTimeouts
[
button_id
]);
}
...
...
@@ -54,6 +57,11 @@ function setupTokenCounting(id, id_counter, id_button) {
var
counter
=
gradioApp
().
getElementById
(
id_counter
);
var
textarea
=
gradioApp
().
querySelector
(
`#
${
id
}
> label > textarea`
);
if
(
opts
.
disable_token_counters
)
{
counter
.
style
.
display
=
"
none
"
;
return
;
}
if
(
counter
.
parentElement
==
prompt
.
parentElement
)
{
return
;
}
...
...
modules/shared.py
浏览文件 @
618c59b0
...
...
@@ -487,6 +487,7 @@ options_templates.update(options_section(('ui', "User interface"), {
"ui_reorder"
:
OptionInfo
(
", "
.
join
(
ui_reorder_categories
),
"txt2img/img2img UI item order"
).
needs_restart
(),
"hires_fix_show_sampler"
:
OptionInfo
(
False
,
"Hires fix: show hires sampler selection"
).
needs_restart
(),
"hires_fix_show_prompts"
:
OptionInfo
(
False
,
"Hires fix: show hires prompt and negative prompt"
).
needs_restart
(),
"disable_token_counters"
:
OptionInfo
(
False
,
"Disable prompt token counters"
).
needs_restart
(),
}))
options_templates
.
update
(
options_section
((
'infotext'
,
"Infotext"
),
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录