Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Overbill1683
Stable Diffusion Webui
提交
3ec5ce94
S
Stable Diffusion Webui
项目概览
Overbill1683
/
Stable Diffusion Webui
10 个月 前同步成功
通知
1746
Star
81
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
分析
仓库
DevOps
项目成员
Pages
S
Stable Diffusion Webui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Pages
分析
分析
仓库分析
DevOps
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
提交
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
3ec5ce94
编写于
8月 22, 2023
作者:
A
AUTOMATIC1111
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add type annotations for extra fields of shared.sd_model
上级
016554e4
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
33 addition
and
3 deletion
+33
-3
modules/sd_models_types.py
modules/sd_models_types.py
+31
-0
modules/shared.py
modules/shared.py
+2
-3
未找到文件。
modules/sd_models_types.py
0 → 100644
浏览文件 @
3ec5ce94
from
ldm.models.diffusion.ddpm
import
LatentDiffusion
from
typing
import
TYPE_CHECKING
if
TYPE_CHECKING
:
from
modules.sd_models
import
CheckpointInfo
class
WebuiSdModel
(
LatentDiffusion
):
"""This class is not actually instantinated, but its fields are created and fieeld by webui"""
lowvram
:
bool
"""True if lowvram/medvram optimizations are enabled -- see modules.lowvram for more info"""
sd_model_hash
:
str
"""short hash, 10 first characters of SHA1 hash of the model file; may be None if --no-hashing flag is used"""
sd_model_checkpoint
:
str
"""path to the file on disk that model weights were obtained from"""
sd_checkpoint_info
:
'CheckpointInfo'
"""structure with additional information about the file with model's weights"""
is_sdxl
:
bool
"""True if the model's architecture is SDXL"""
is_sd2
:
bool
"""True if the model's architecture is SD 2.x"""
is_sd1
:
bool
"""True if the model's architecture is SD 1.x"""
modules/shared.py
浏览文件 @
3ec5ce94
...
...
@@ -2,9 +2,8 @@ import sys
import
gradio
as
gr
from
modules
import
shared_cmd_options
,
shared_gradio_themes
,
options
,
shared_items
from
modules
import
shared_cmd_options
,
shared_gradio_themes
,
options
,
shared_items
,
sd_models_types
from
modules.paths_internal
import
models_path
,
script_path
,
data_path
,
sd_configs_path
,
sd_default_config
,
sd_model_file
,
default_sd_model_file
,
extensions_dir
,
extensions_builtin_dir
# noqa: F401
from
ldm.models.diffusion.ddpm
import
LatentDiffusion
from
modules
import
util
cmd_opts
=
shared_cmd_options
.
cmd_opts
...
...
@@ -40,7 +39,7 @@ options_templates = None
opts
=
None
restricted_opts
=
None
sd_model
:
LatentDiffusion
=
None
sd_model
:
sd_models_types
.
WebuiSdModel
=
None
settings_components
=
None
"""assinged from ui.py, a mapping on setting names to gradio components repsponsible for those settings"""
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录