mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-06-10 13:32:08 +08:00
tidy
This commit is contained in:
parent
9da6aca0d0
commit
7f7b3f1695
@ -153,11 +153,11 @@ def download_release_asset_zip(release: Release, destination_path: str) -> None:
|
|||||||
class FrontendManager:
|
class FrontendManager:
|
||||||
"""
|
"""
|
||||||
A class to manage ComfyUI frontend versions and installations.
|
A class to manage ComfyUI frontend versions and installations.
|
||||||
|
|
||||||
This class handles the initialization and management of different frontend versions,
|
This class handles the initialization and management of different frontend versions,
|
||||||
including the default frontend from the pip package and custom frontend versions
|
including the default frontend from the pip package and custom frontend versions
|
||||||
from GitHub repositories.
|
from GitHub repositories.
|
||||||
|
|
||||||
Attributes:
|
Attributes:
|
||||||
CUSTOM_FRONTENDS_ROOT (str): The root directory where custom frontend versions are stored.
|
CUSTOM_FRONTENDS_ROOT (str): The root directory where custom frontend versions are stored.
|
||||||
"""
|
"""
|
||||||
@ -168,10 +168,10 @@ class FrontendManager:
|
|||||||
def default_frontend_path(cls) -> str:
|
def default_frontend_path(cls) -> str:
|
||||||
"""
|
"""
|
||||||
Get the path to the default frontend installation from the pip package.
|
Get the path to the default frontend installation from the pip package.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
str: The path to the default frontend static files.
|
str: The path to the default frontend static files.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
SystemExit: If the comfyui-frontend-package is not installed.
|
SystemExit: If the comfyui-frontend-package is not installed.
|
||||||
"""
|
"""
|
||||||
@ -197,10 +197,10 @@ comfyui-frontend-package is not installed.
|
|||||||
def templates_path(cls) -> str:
|
def templates_path(cls) -> str:
|
||||||
"""
|
"""
|
||||||
Get the path to the workflow templates.
|
Get the path to the workflow templates.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
str: The path to the workflow templates directory.
|
str: The path to the workflow templates directory.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
SystemExit: If the comfyui-workflow-templates package is not installed.
|
SystemExit: If the comfyui-workflow-templates package is not installed.
|
||||||
"""
|
"""
|
||||||
@ -240,16 +240,16 @@ comfyui-workflow-templates is not installed.
|
|||||||
def parse_version_string(cls, value: str) -> tuple[str, str, str]:
|
def parse_version_string(cls, value: str) -> tuple[str, str, str]:
|
||||||
"""
|
"""
|
||||||
Parse a version string into its components.
|
Parse a version string into its components.
|
||||||
|
|
||||||
The version string should be in the format: 'owner/repo@version'
|
The version string should be in the format: 'owner/repo@version'
|
||||||
where version can be either a semantic version (v1.2.3) or 'latest'.
|
where version can be either a semantic version (v1.2.3) or 'latest'.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
value (str): The version string to parse.
|
value (str): The version string to parse.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
tuple[str, str, str]: A tuple containing (owner, repo, version).
|
tuple[str, str, str]: A tuple containing (owner, repo, version).
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
argparse.ArgumentTypeError: If the version string is invalid.
|
argparse.ArgumentTypeError: If the version string is invalid.
|
||||||
"""
|
"""
|
||||||
@ -266,18 +266,18 @@ comfyui-workflow-templates is not installed.
|
|||||||
) -> str:
|
) -> str:
|
||||||
"""
|
"""
|
||||||
Initialize a frontend version without error handling.
|
Initialize a frontend version without error handling.
|
||||||
|
|
||||||
This method attempts to initialize a specific frontend version, either from
|
This method attempts to initialize a specific frontend version, either from
|
||||||
the default pip package or from a custom GitHub repository. It will download
|
the default pip package or from a custom GitHub repository. It will download
|
||||||
and extract the frontend files if necessary.
|
and extract the frontend files if necessary.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
version_string (str): The version string specifying which frontend to use.
|
version_string (str): The version string specifying which frontend to use.
|
||||||
provider (FrontEndProvider, optional): The provider to use for custom frontends.
|
provider (FrontEndProvider, optional): The provider to use for custom frontends.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
str: The path to the initialized frontend.
|
str: The path to the initialized frontend.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
Exception: If there is an error during initialization (e.g., network timeout,
|
Exception: If there is an error during initialization (e.g., network timeout,
|
||||||
invalid URL, or missing assets).
|
invalid URL, or missing assets).
|
||||||
@ -333,13 +333,13 @@ comfyui-workflow-templates is not installed.
|
|||||||
def init_frontend(cls, version_string: str) -> str:
|
def init_frontend(cls, version_string: str) -> str:
|
||||||
"""
|
"""
|
||||||
Initialize a frontend version with error handling.
|
Initialize a frontend version with error handling.
|
||||||
|
|
||||||
This is the main method to initialize a frontend version. It wraps init_frontend_unsafe
|
This is the main method to initialize a frontend version. It wraps init_frontend_unsafe
|
||||||
with error handling, falling back to the default frontend if initialization fails.
|
with error handling, falling back to the default frontend if initialization fails.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
version_string (str): The version string specifying which frontend to use.
|
version_string (str): The version string specifying which frontend to use.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
str: The path to the initialized frontend. If initialization fails,
|
str: The path to the initialized frontend. If initialization fails,
|
||||||
returns the path to the default frontend.
|
returns the path to the default frontend.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user