From 0edc48af993a443512ae5161e72fa81c446f9fcd Mon Sep 17 00:00:00 2001 From: Yoland Yan <4950057+yoland68@users.noreply.github.com> Date: Sun, 2 Mar 2025 12:37:48 -0800 Subject: [PATCH] Remove empty spaces --- comfy/model_patcher.py | 2 +- comfy/sd.py | 6 +++--- folder_paths.py | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/comfy/model_patcher.py b/comfy/model_patcher.py index 58923051..b1d6d439 100644 --- a/comfy/model_patcher.py +++ b/comfy/model_patcher.py @@ -266,7 +266,7 @@ class ModelPatcher: def lowvram_patch_counter(self): return self.model.lowvram_patch_counter - + def clone(self): n = self.__class__(self.model, self.load_device, self.offload_device, self.size, weight_inplace_update=self.weight_inplace_update) n.patches = {} diff --git a/comfy/sd.py b/comfy/sd.py index decc71f3..0e27ee53 100644 --- a/comfy/sd.py +++ b/comfy/sd.py @@ -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={}): """ Loads a UNet diffusion model from a state dictionary, supporting both diffusers and regular formats. - + Args: sd (dict): State dictionary containing model weights and configuration model_options (dict, optional): Additional options for model loading. Supports: - dtype: Override model data type - custom_operations: Custom model operations - fp8_optimizations: Enable FP8 optimizations - + Returns: ModelPatcher: A wrapped model instance that handles device management and weight loading. Returns None if the model configuration cannot be detected. - + The function: 1. Detects and handles different model formats (regular, diffusers, mmdit) 2. Configures model dtype based on parameters and device capabilities diff --git a/folder_paths.py b/folder_paths.py index 915bead5..eb992fce 100644 --- a/folder_paths.py +++ b/folder_paths.py @@ -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]: """Returns a list of all subfolder paths in the input directory, recursively. - + Returns: List of folder paths relative to the input directory, excluding the root directory """ input_dir = get_input_directory() folders = [] - + try: if not os.path.exists(input_dir): return [] - + for root, dirs, _ in os.walk(input_dir): rel_path = os.path.relpath(root, input_dir) if rel_path != ".": # Only include non-root directories # Normalize path separators to forward slashes folders.append(rel_path.replace(os.sep, '/')) - + return sorted(folders) except FileNotFoundError: return []