mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-25 05:40:15 +08:00
Merge branch 'comfyanonymous:master' into master
This commit is contained in:
commit
9a7b512852
@ -130,10 +130,21 @@ class ModelFileManager:
|
|||||||
|
|
||||||
for file_name in filenames:
|
for file_name in filenames:
|
||||||
try:
|
try:
|
||||||
relative_path = os.path.relpath(os.path.join(dirpath, file_name), directory)
|
full_path = os.path.join(dirpath, file_name)
|
||||||
result.append(relative_path)
|
relative_path = os.path.relpath(full_path, directory)
|
||||||
except:
|
|
||||||
logging.warning(f"Warning: Unable to access {file_name}. Skipping this file.")
|
# Get file metadata
|
||||||
|
file_info = {
|
||||||
|
"name": relative_path,
|
||||||
|
"pathIndex": pathIndex,
|
||||||
|
"modified": os.path.getmtime(full_path), # Add modification time
|
||||||
|
"created": os.path.getctime(full_path), # Add creation time
|
||||||
|
"size": os.path.getsize(full_path) # Add file size
|
||||||
|
}
|
||||||
|
result.append(file_info)
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
logging.warning(f"Warning: Unable to access {file_name}. Error: {e}. Skipping this file.")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
for d in subdirs:
|
for d in subdirs:
|
||||||
@ -144,7 +155,7 @@ class ModelFileManager:
|
|||||||
logging.warning(f"Warning: Unable to access {path}. Skipping this path.")
|
logging.warning(f"Warning: Unable to access {path}. Skipping this path.")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
return [{"name": f, "pathIndex": pathIndex} for f in result], dirs, time.perf_counter()
|
return result, dirs, time.perf_counter()
|
||||||
|
|
||||||
def get_model_previews(self, filepath: str) -> list[str | BytesIO]:
|
def get_model_previews(self, filepath: str) -> list[str | BytesIO]:
|
||||||
dirname = os.path.dirname(filepath)
|
dirname = os.path.dirname(filepath)
|
||||||
|
|||||||
@ -20,13 +20,15 @@ class FileInfo(TypedDict):
|
|||||||
path: str
|
path: str
|
||||||
size: int
|
size: int
|
||||||
modified: int
|
modified: int
|
||||||
|
created: int
|
||||||
|
|
||||||
|
|
||||||
def get_file_info(path: str, relative_to: str) -> FileInfo:
|
def get_file_info(path: str, relative_to: str) -> FileInfo:
|
||||||
return {
|
return {
|
||||||
"path": os.path.relpath(path, relative_to).replace(os.sep, '/'),
|
"path": os.path.relpath(path, relative_to).replace(os.sep, '/'),
|
||||||
"size": os.path.getsize(path),
|
"size": os.path.getsize(path),
|
||||||
"modified": os.path.getmtime(path)
|
"modified": os.path.getmtime(path),
|
||||||
|
"created": os.path.getctime(path)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
# This file is automatically generated by the build process when version is
|
# This file is automatically generated by the build process when version is
|
||||||
# updated in pyproject.toml.
|
# updated in pyproject.toml.
|
||||||
__version__ = "0.3.47"
|
__version__ = "0.3.48"
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "ComfyUI"
|
name = "ComfyUI"
|
||||||
version = "0.3.47"
|
version = "0.3.48"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
license = { file = "LICENSE" }
|
license = { file = "LICENSE" }
|
||||||
requires-python = ">=3.9"
|
requires-python = ">=3.9"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user