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
edf3ad5a
Commit
edf3ad5a
authored
Aug 30, 2023
by
AUTOMATIC1111
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
go back to single path for filenames in extra networks metadata dialog
parent
4aaae3dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
12 deletions
+9
-12
modules/ui_extra_networks_user_metadata.py
modules/ui_extra_networks_user_metadata.py
+9
-12
No files found.
modules/ui_extra_networks_user_metadata.py
View file @
edf3ad5a
...
...
@@ -2,22 +2,13 @@ import datetime
import
html
import
json
import
os.path
from
pathlib
import
Path
import
gradio
as
gr
from
modules
import
generation_parameters_copypaste
,
images
,
sysinfo
,
errors
from
modules
import
generation_parameters_copypaste
,
images
,
sysinfo
,
errors
,
ui_extra_networks
from
modules.paths_internal
import
models_path
def
exclude_root_path
(
root_path
,
path
):
path_object
=
Path
(
path
)
if
path_object
.
is_relative_to
(
root_path
):
path_object
=
path_object
.
relative_to
(
root_path
)
return
path_object
.
as_posix
()
class
UserMetadataEditor
:
def
__init__
(
self
,
ui
,
tabname
,
page
):
...
...
@@ -99,6 +90,13 @@ class UserMetadataEditor:
return
preview
def
relative_path
(
self
,
path
):
for
parent_path
in
self
.
page
.
allowed_directories_for_previews
():
if
ui_extra_networks
.
path_is_parent
(
parent_path
,
path
):
return
os
.
path
.
relpath
(
path
,
parent_path
)
return
os
.
path
.
basename
(
path
)
def
get_metadata_table
(
self
,
name
):
item
=
self
.
page
.
items
.
get
(
name
,
{})
try
:
...
...
@@ -107,8 +105,7 @@ class UserMetadataEditor:
stats
=
os
.
stat
(
filename
)
params
=
[
(
'Filename: '
,
os
.
path
.
basename
(
filename
)),
(
'Path: '
,
exclude_root_path
(
models_path
,
filename
)),
(
'Filename: '
,
self
.
relative_path
(
filename
)),
(
'File size: '
,
sysinfo
.
pretty_bytes
(
stats
.
st_size
)),
(
'Hash: '
,
shorthash
),
(
'Modified: '
,
datetime
.
datetime
.
fromtimestamp
(
stats
.
st_mtime
)
.
strftime
(
'
%
Y-
%
m-
%
d
%
H:
%
M'
)),
...
...
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