Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
Stable Diffusion Webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
novelai-storage
Stable Diffusion Webui
Commits
073c0ebb
Commit
073c0ebb
authored
Aug 04, 2023
by
AUTOMATIC1111
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add gradio version warning
parent
362789a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
34 deletions
+57
-34
modules/errors.py
modules/errors.py
+50
-0
webui.py
webui.py
+7
-34
No files found.
modules/errors.py
View file @
073c0ebb
...
...
@@ -84,3 +84,53 @@ def run(code, task):
code
()
except
Exception
as
e
:
display
(
task
,
e
)
def
check_versions
():
from
packaging
import
version
from
modules
import
shared
import
torch
import
gradio
expected_torch_version
=
"2.0.0"
expected_xformers_version
=
"0.0.20"
expected_gradio_version
=
"3.39.0"
if
version
.
parse
(
torch
.
__version__
)
<
version
.
parse
(
expected_torch_version
):
print_error_explanation
(
f
"""
You are running torch {torch.__version__}.
The program is tested to work with torch {expected_torch_version}.
To reinstall the desired version, run with commandline flag --reinstall-torch.
Beware that this will cause a lot of large files to be downloaded, as well as
there are reports of issues with training tab on the latest version.
Use --skip-version-check commandline argument to disable this check.
"""
.
strip
())
if
shared
.
xformers_available
:
import
xformers
if
version
.
parse
(
xformers
.
__version__
)
<
version
.
parse
(
expected_xformers_version
):
print_error_explanation
(
f
"""
You are running xformers {xformers.__version__}.
The program is tested to work with xformers {expected_xformers_version}.
To reinstall the desired version, run with commandline flag --reinstall-xformers.
Use --skip-version-check commandline argument to disable this check.
"""
.
strip
())
if
gradio
.
__version__
!=
expected_gradio_version
:
print_error_explanation
(
f
"""
You are running gradio {gradio.__version__}.
The program is designed to work with gradio {expected_gradio_version}.
Using a different version of gradio is extremely likely to break the program.
Reasons why you have the mismatched gradio version can be:
- you use --skip-install flag.
- you use webui.py to start the program instead of launch.py.
- an extension installs the incompatible gradio version.
Use --skip-version-check commandline argument to disable this check.
"""
.
strip
())
webui.py
View file @
073c0ebb
...
...
@@ -14,7 +14,6 @@ from typing import Iterable
from
fastapi
import
FastAPI
from
fastapi.middleware.cors
import
CORSMiddleware
from
fastapi.middleware.gzip
import
GZipMiddleware
from
packaging
import
version
import
logging
...
...
@@ -50,6 +49,7 @@ startup_timer.record("setup paths")
import
ldm.modules.encoders.modules
# noqa: F401
startup_timer
.
record
(
"import ldm"
)
from
modules
import
extra_networks
from
modules.call_queue
import
wrap_gradio_gpu_call
,
wrap_queued_call
,
queue_lock
# noqa: F401
...
...
@@ -58,9 +58,14 @@ if ".dev" in torch.__version__ or "+git" in torch.__version__:
torch
.
__long_version__
=
torch
.
__version__
torch
.
__version__
=
re
.
search
(
r'[\d.]+[\d]'
,
torch
.
__version__
)
.
group
(
0
)
from
modules
import
shared
if
not
shared
.
cmd_opts
.
skip_version_check
:
errors
.
check_versions
()
import
modules.codeformer_model
as
codeformer
import
modules.gfpgan_model
as
gfpgan
from
modules
import
s
hared
,
s
d_samplers
,
upscaler
,
extensions
,
localization
,
ui_tempdir
,
ui_extra_networks
,
config_states
from
modules
import
sd_samplers
,
upscaler
,
extensions
,
localization
,
ui_tempdir
,
ui_extra_networks
,
config_states
import
modules.face_restoration
import
modules.img2img
...
...
@@ -130,37 +135,6 @@ def fix_asyncio_event_loop_policy():
asyncio
.
set_event_loop_policy
(
AnyThreadEventLoopPolicy
())
def
check_versions
():
if
shared
.
cmd_opts
.
skip_version_check
:
return
expected_torch_version
=
"2.0.0"
if
version
.
parse
(
torch
.
__version__
)
<
version
.
parse
(
expected_torch_version
):
errors
.
print_error_explanation
(
f
"""
You are running torch {torch.__version__}.
The program is tested to work with torch {expected_torch_version}.
To reinstall the desired version, run with commandline flag --reinstall-torch.
Beware that this will cause a lot of large files to be downloaded, as well as
there are reports of issues with training tab on the latest version.
Use --skip-version-check commandline argument to disable this check.
"""
.
strip
())
expected_xformers_version
=
"0.0.20"
if
shared
.
xformers_available
:
import
xformers
if
version
.
parse
(
xformers
.
__version__
)
<
version
.
parse
(
expected_xformers_version
):
errors
.
print_error_explanation
(
f
"""
You are running xformers {xformers.__version__}.
The program is tested to work with xformers {expected_xformers_version}.
To reinstall the desired version, run with commandline flag --reinstall-xformers.
Use --skip-version-check commandline argument to disable this check.
"""
.
strip
())
def
restore_config_state_file
():
config_state_file
=
shared
.
opts
.
restore_config_state_file
if
config_state_file
==
""
:
...
...
@@ -248,7 +222,6 @@ def initialize():
fix_asyncio_event_loop_policy
()
validate_tls_options
()
configure_sigint_handler
()
check_versions
()
modelloader
.
cleanup_models
()
configure_opts_onchange
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment