Skip to content
GitLab
菜单
为什么选择 GitLab
定价
联系销售
探索
为什么选择 GitLab
定价
联系销售
探索
登录
获取免费试用
主导航
搜索或转到…
项目
S
Stable Diffusion Webui
管理
动态
成员
代码
仓库
分支
提交
标签
仓库图
比较修订版本
部署
模型注册表
分析
模型实验
帮助
帮助
支持
GitLab 文档
比较 GitLab 各版本
社区论坛
为极狐GitLab 提交贡献
提交反馈
隐私声明
快捷键
?
新增功能
4
代码片段
群组
项目
显示更多面包屑
Hunter0726
Stable Diffusion Webui
提交
3c207ca6
提交
3c207ca6
编辑于
2 years ago
作者:
AUTOMATIC
浏览文件
操作
下载
补丁
差异文件
add needed imports fr new code in copypaste.py
上级
45ca67f3
No related branches found
分支 包含提交
No related tags found
标签 包含提交
无相关合并请求
变更
2
隐藏空白变更内容
行内
左右并排
显示
2 个更改的文件
modules/generation_parameters_copypaste.py
+9
-0
9 个添加, 0 个删除
modules/generation_parameters_copypaste.py
modules/ui.py
+0
-7
0 个添加, 7 个删除
modules/ui.py
有
9 个添加
和
7 个删除
modules/generation_parameters_copypaste.py
+
9
−
0
浏览文件 @
3c207ca6
import
base64
import
io
import
os
import
re
import
gradio
as
gr
...
...
@@ -14,6 +16,7 @@ type_of_gr_update = type(gr.update())
paste_fields
=
{}
bind_list
=
[]
def
quote
(
text
):
if
'
,
'
not
in
str
(
text
):
return
text
...
...
@@ -23,6 +26,7 @@ def quote(text):
text
=
text
.
replace
(
'"'
,
'
\\
"'
)
return
f
'"
{
text
}
"'
def
image_from_url_text
(
filedata
):
if
type
(
filedata
)
==
dict
and
filedata
[
"
is_file
"
]:
filename
=
filedata
[
"
name
"
]
...
...
@@ -45,19 +49,23 @@ def image_from_url_text(filedata):
image
=
Image
.
open
(
io
.
BytesIO
(
filedata
))
return
image
def
add_paste_fields
(
tabname
,
init_img
,
fields
):
paste_fields
[
tabname
]
=
{
"
init_img
"
:
init_img
,
"
fields
"
:
fields
}
def
create_buttons
(
tabs_list
):
buttons
=
{}
for
tab
in
tabs_list
:
buttons
[
tab
]
=
gr
.
Button
(
f
"
Send to
{
tab
}
"
)
return
buttons
#if send_generate_info is a tab name, mean generate_info comes from the params fields of the tab
def
bind_buttons
(
buttons
,
send_image
,
send_generate_info
):
bind_list
.
append
([
buttons
,
send_image
,
send_generate_info
])
def
run_bind
():
for
buttons
,
send_image
,
send_generate_info
in
bind_list
:
for
tab
in
buttons
:
...
...
@@ -98,6 +106,7 @@ def run_bind():
outputs
=
None
,
)
def
parse_generation_parameters
(
x
:
str
):
"""
parses generation parameters string, the one you see in text field under the picture in UI:
```
...
...
此差异已折叠。
点击以展开。
modules/ui.py
+
0
−
7
浏览文件 @
3c207ca6
import
base64
import
html
import
io
import
json
import
math
import
mimetypes
...
...
@@ -18,13 +16,8 @@ import gradio as gr
import
gradio.routes
import
gradio.utils
import
numpy
as
np
import
piexif
import
torch
from
PIL
import
Image
,
PngImagePlugin
import
gradio
as
gr
import
gradio.utils
import
gradio.routes
from
modules
import
sd_hijack
,
sd_models
,
localization
,
script_callbacks
from
modules.paths
import
script_path
...
...
此差异已折叠。
点击以展开。
预览
0%
加载中
请重试
或
添加新附件
.
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
保存评论
取消
想要评论请
注册
或
登录