mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-07-11 01:47:11 +08:00
Remove empty spaces
This commit is contained in:
parent
bfc2f177e8
commit
0edc48af99
@ -266,7 +266,7 @@ class ModelPatcher:
|
|||||||
|
|
||||||
def lowvram_patch_counter(self):
|
def lowvram_patch_counter(self):
|
||||||
return self.model.lowvram_patch_counter
|
return self.model.lowvram_patch_counter
|
||||||
|
|
||||||
def clone(self):
|
def clone(self):
|
||||||
n = self.__class__(self.model, self.load_device, self.offload_device, self.size, weight_inplace_update=self.weight_inplace_update)
|
n = self.__class__(self.model, self.load_device, self.offload_device, self.size, weight_inplace_update=self.weight_inplace_update)
|
||||||
n.patches = {}
|
n.patches = {}
|
||||||
|
@ -989,18 +989,18 @@ def load_state_dict_guess_config(sd, output_vae=True, output_clip=True, output_c
|
|||||||
def load_diffusion_model_state_dict(sd, model_options={}):
|
def load_diffusion_model_state_dict(sd, model_options={}):
|
||||||
"""
|
"""
|
||||||
Loads a UNet diffusion model from a state dictionary, supporting both diffusers and regular formats.
|
Loads a UNet diffusion model from a state dictionary, supporting both diffusers and regular formats.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
sd (dict): State dictionary containing model weights and configuration
|
sd (dict): State dictionary containing model weights and configuration
|
||||||
model_options (dict, optional): Additional options for model loading. Supports:
|
model_options (dict, optional): Additional options for model loading. Supports:
|
||||||
- dtype: Override model data type
|
- dtype: Override model data type
|
||||||
- custom_operations: Custom model operations
|
- custom_operations: Custom model operations
|
||||||
- fp8_optimizations: Enable FP8 optimizations
|
- fp8_optimizations: Enable FP8 optimizations
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
ModelPatcher: A wrapped model instance that handles device management and weight loading.
|
ModelPatcher: A wrapped model instance that handles device management and weight loading.
|
||||||
Returns None if the model configuration cannot be detected.
|
Returns None if the model configuration cannot be detected.
|
||||||
|
|
||||||
The function:
|
The function:
|
||||||
1. Detects and handles different model formats (regular, diffusers, mmdit)
|
1. Detects and handles different model formats (regular, diffusers, mmdit)
|
||||||
2. Configures model dtype based on parameters and device capabilities
|
2. Configures model dtype based on parameters and device capabilities
|
||||||
|
@ -399,23 +399,23 @@ def get_save_image_path(filename_prefix: str, output_dir: str, image_width=0, im
|
|||||||
|
|
||||||
def get_input_subfolders() -> list[str]:
|
def get_input_subfolders() -> list[str]:
|
||||||
"""Returns a list of all subfolder paths in the input directory, recursively.
|
"""Returns a list of all subfolder paths in the input directory, recursively.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
List of folder paths relative to the input directory, excluding the root directory
|
List of folder paths relative to the input directory, excluding the root directory
|
||||||
"""
|
"""
|
||||||
input_dir = get_input_directory()
|
input_dir = get_input_directory()
|
||||||
folders = []
|
folders = []
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if not os.path.exists(input_dir):
|
if not os.path.exists(input_dir):
|
||||||
return []
|
return []
|
||||||
|
|
||||||
for root, dirs, _ in os.walk(input_dir):
|
for root, dirs, _ in os.walk(input_dir):
|
||||||
rel_path = os.path.relpath(root, input_dir)
|
rel_path = os.path.relpath(root, input_dir)
|
||||||
if rel_path != ".": # Only include non-root directories
|
if rel_path != ".": # Only include non-root directories
|
||||||
# Normalize path separators to forward slashes
|
# Normalize path separators to forward slashes
|
||||||
folders.append(rel_path.replace(os.sep, '/'))
|
folders.append(rel_path.replace(os.sep, '/'))
|
||||||
|
|
||||||
return sorted(folders)
|
return sorted(folders)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
return []
|
return []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user