Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
S
stable-diffusion-webui
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
stable-diffusion-webui
Commits
51e3dc9c
Commit
51e3dc9c
authored
Oct 21, 2022
by
timntorres
Committed by
AUTOMATIC1111
Oct 21, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sanitize hypernet name input.
parent
3e12b529
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
ui.py
modules/hypernetworks/ui.py
+3
-0
No files found.
modules/hypernetworks/ui.py
View file @
51e3dc9c
...
@@ -11,6 +11,9 @@ from modules.hypernetworks import hypernetwork
...
@@ -11,6 +11,9 @@ from modules.hypernetworks import hypernetwork
def
create_hypernetwork
(
name
,
enable_sizes
,
overwrite_old
,
layer_structure
=
None
,
add_layer_norm
=
False
,
activation_func
=
None
):
def
create_hypernetwork
(
name
,
enable_sizes
,
overwrite_old
,
layer_structure
=
None
,
add_layer_norm
=
False
,
activation_func
=
None
):
# Remove illegal characters from name.
name
=
""
.
join
(
x
for
x
in
name
if
(
x
.
isalnum
()
or
x
in
"._- "
))
fn
=
os
.
path
.
join
(
shared
.
cmd_opts
.
hypernetwork_dir
,
f
"{name}.pt"
)
fn
=
os
.
path
.
join
(
shared
.
cmd_opts
.
hypernetwork_dir
,
f
"{name}.pt"
)
if
not
overwrite_old
:
if
not
overwrite_old
:
assert
not
os
.
path
.
exists
(
fn
),
f
"file {fn} already exists"
assert
not
os
.
path
.
exists
(
fn
),
f
"file {fn} already exists"
...
...
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