From 80723178ee23b94eaed139b7f9fd6f9c60a2c3fc Mon Sep 17 00:00:00 2001 From: ClownsharkBatwing Date: Sun, 15 Dec 2024 20:44:42 -0500 Subject: [PATCH 1/2] Add files via upload --- conditioning.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conditioning.py b/conditioning.py index 7d29b2a..2bb5909 100644 --- a/conditioning.py +++ b/conditioning.py @@ -579,7 +579,6 @@ class FluxRegionalConditioning: @classmethod def INPUT_TYPES(s): return {"required": { - "conditioning_regional": ("CONDITIONING_REGIONAL",), "mask_weight": ("FLOAT", {"default": 1.0, "min": -10000.0, "max": 10000.0, "step": 0.01}), "start_percent": ("FLOAT", {"default": 0, "min": 0.0, "max": 1.0, "step": 0.01}), "end_percent": ("FLOAT", {"default": 0.5, "min": 0.0, "max": 1.0, "step": 0.01}), @@ -587,6 +586,7 @@ def INPUT_TYPES(s): }, "optional": { "conditioning": ("CONDITIONING",), + "conditioning_regional": ("CONDITIONING_REGIONAL",), "mask_weights": ("SIGMAS", ), }} From b7d0cf90e5a5e05b8fa0a180e33d541d9176aade Mon Sep 17 00:00:00 2001 From: ClownsharkBatwing Date: Sun, 15 Dec 2024 20:54:22 -0500 Subject: [PATCH 2/2] Add files via upload Fixed SharkSampler and ClownsharKSampler so that no connected conditioning is needed with Flux. It will generated zeroed out conditioning automatically for you. --- models.py | 1 + samplers.py | 35 ++++++++++++++++++++++++----------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/models.py b/models.py index 5fa92b1..41f5479 100644 --- a/models.py +++ b/models.py @@ -37,6 +37,7 @@ def main(self, model): m = model.clone() m.model.diffusion_model.__class__ = ReFlux + m.model.diffusion_model.threshold_inv = False for i, block in enumerate(m.model.diffusion_model.double_blocks): block.__class__ = DoubleStreamBlock diff --git a/samplers.py b/samplers.py index ed68373..067fc43 100644 --- a/samplers.py +++ b/samplers.py @@ -133,17 +133,30 @@ def main(self, model, cfg, sampler_mode, scheduler, steps, denoise=1.0, denoise_ latent = latent_image latent_image_dtype = latent_image['samples'].dtype - if positive is None: - positive = [[ - torch.zeros((1, 154, 4096)), - {'pooled_output': torch.zeros((1, 2048))} - ]] - - if negative is None: - negative = [[ - torch.zeros((1, 154, 4096)), - {'pooled_output': torch.zeros((1, 2048))} - ]] + if isinstance(model.model.model_config, comfy.supported_models.Flux) or isinstance(model.model.model_config, comfy.supported_models.FluxSchnell): + if positive is None: + positive = [[ + torch.zeros((1, 256, 4096)), + {'pooled_output': torch.zeros((1, 768))} + ]] + + if negative is None: + negative = [[ + torch.zeros((1, 256, 4096)), + {'pooled_output': torch.zeros((1, 768))} + ]] + else: + if positive is None: + positive = [[ + torch.zeros((1, 154, 4096)), + {'pooled_output': torch.zeros((1, 2048))} + ]] + + if negative is None: + negative = [[ + torch.zeros((1, 154, 4096)), + {'pooled_output': torch.zeros((1, 2048))} + ]] if denoise_alt < 0: d_noise = denoise_alt = -denoise_alt