Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Overbill1683
Stable Diffusion Webui
提交
e526f6b3
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,发现更多精彩内容 >>
未验证
提交
e526f6b3
编写于
11月 02, 2022
作者:
A
AUTOMATIC1111
提交者:
GitHub
11月 02, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #3970 from evshiron/fix/progress-api
fix broken progress api and current image compatibility
上级
90530424
51e0a839
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
2 deletion
+14
-2
modules/api/api.py
modules/api/api.py
+11
-2
modules/shared.py
modules/shared.py
+3
-0
未找到文件。
modules/api/api.py
浏览文件 @
e526f6b3
...
...
@@ -5,10 +5,9 @@ import uvicorn
from
gradio.processing_utils
import
decode_base64_to_file
,
decode_base64_to_image
from
fastapi
import
APIRouter
,
Depends
,
HTTPException
import
modules.shared
as
shared
from
modules
import
devices
from
modules.api.models
import
*
from
modules.processing
import
StableDiffusionProcessingTxt2Img
,
StableDiffusionProcessingImg2Img
,
process_images
from
modules.sd_samplers
import
all_samplers
from
modules.sd_samplers
import
all_samplers
,
sample_to_image
,
samples_to_image_grid
from
modules.extras
import
run_extras
,
run_pnginfo
...
...
@@ -179,6 +178,16 @@ class Api:
progress
=
min
(
progress
,
1
)
# copy from check_progress_call of ui.py
if
shared
.
parallel_processing_allowed
:
if
shared
.
state
.
sampling_step
-
shared
.
state
.
current_image_sampling_step
>=
shared
.
opts
.
show_progress_every_n_steps
and
shared
.
state
.
current_latent
is
not
None
:
if
shared
.
opts
.
show_progress_grid
:
shared
.
state
.
current_image
=
samples_to_image_grid
(
shared
.
state
.
current_latent
)
else
:
shared
.
state
.
current_image
=
sample_to_image
(
shared
.
state
.
current_latent
)
shared
.
state
.
current_image_sampling_step
=
shared
.
state
.
sampling_step
current_image
=
None
if
shared
.
state
.
current_image
and
not
req
.
skip_current_image
:
current_image
=
encode_pil_to_base64
(
shared
.
state
.
current_image
)
...
...
modules/shared.py
浏览文件 @
e526f6b3
...
...
@@ -4,6 +4,7 @@ import json
import
os
import
sys
from
collections
import
OrderedDict
import
time
import
gradio
as
gr
import
tqdm
...
...
@@ -135,6 +136,7 @@ class State:
current_image
=
None
current_image_sampling_step
=
0
textinfo
=
None
time_start
=
None
need_restart
=
False
def
skip
(
self
):
...
...
@@ -172,6 +174,7 @@ class State:
self
.
skipped
=
False
self
.
interrupted
=
False
self
.
textinfo
=
None
self
.
time_start
=
time
.
time
()
devices
.
torch_gc
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录