Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

display file metadata path , ss_output_name #12838

Merged
merged 3 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions extensions-builtin/Lora/ui_edit_user_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def get_metadata_table(self, name):
metadata = item.get("metadata") or {}

keys = {
'ss_output_name': "Output name:",
'ss_sd_model_name': "Model:",
'ss_clip_skip': "Clip skip:",
'ss_network_module': "Kohya module:",
Expand Down
11 changes: 11 additions & 0 deletions modules/ui_extra_networks_user_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,20 @@
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.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:
Expand Down Expand Up @@ -98,6 +108,7 @@ def get_metadata_table(self, name):
stats = os.stat(filename)
params = [
('Filename: ', os.path.basename(filename)),
('Path: ', exclude_root_path(models_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')),
Expand Down