From 24dc581dc3c3bfb12d4a2910609425b4b295d731 Mon Sep 17 00:00:00 2001 From: lky <32677614+lyksdu@users.noreply.github.com> Date: Wed, 27 Nov 2024 04:34:19 +0800 Subject: [PATCH 1/2] fix multi add makedirs error (#5786) try to start multiple comfyui server at the same time, and this got error --- app/user_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/user_manager.py b/app/user_manager.py index bb6217995..e863b93dd 100644 --- a/app/user_manager.py +++ b/app/user_manager.py @@ -36,7 +36,7 @@ class UserManager(): self.settings = AppSettings(self) if not os.path.exists(user_directory): - os.mkdir(user_directory) + os.makedirs(user_directory, exist_ok=True) if not args.multi_user: print("****** User settings have been changed to be stored on the server instead of browser storage. ******") print("****** For multi-user setups add the --multi-user CLI argument to enable multiple user profiles. ******") From 497db6212faea643d3aac1253ccfa23834109881 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Tue, 26 Nov 2024 17:51:40 -0500 Subject: [PATCH 2/2] Alternative fix for #5767 --- comfy/model_base.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/comfy/model_base.py b/comfy/model_base.py index 3c385cda9..c305014a4 100644 --- a/comfy/model_base.py +++ b/comfy/model_base.py @@ -712,7 +712,13 @@ class Flux(BaseModel): super().__init__(model_config, model_type, device=device, unet_model=comfy.ldm.flux.model.Flux) def concat_cond(self, **kwargs): - num_channels = self.diffusion_model.img_in.weight.shape[1] // (self.diffusion_model.patch_size * self.diffusion_model.patch_size) + try: + #Handle Flux control loras dynamically changing the img_in weight. + num_channels = self.diffusion_model.img_in.weight.shape[1] // (self.diffusion_model.patch_size * self.diffusion_model.patch_size) + except: + #Some cases like tensorrt might not have the weights accessible + num_channels = self.model_config.unet_config["in_channels"] + out_channels = self.model_config.unet_config["out_channels"] if num_channels <= out_channels: