Skip to content

Commit

Permalink
Merge branch 'ClownsharkBatwing:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
drozbay authored Dec 16, 2024
2 parents 9f3fef9 + b7d0cf9 commit f87bd82
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 12 deletions.
2 changes: 1 addition & 1 deletion conditioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,14 +579,14 @@ 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}),
"mask_type": (["differential","gradient",], {"default": "differential"}),
},
"optional": {
"conditioning": ("CONDITIONING",),
"conditioning_regional": ("CONDITIONING_REGIONAL",),
"mask_weights": ("SIGMAS", ),
}}

Expand Down
1 change: 1 addition & 0 deletions models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
35 changes: 24 additions & 11 deletions samplers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f87bd82

Please sign in to comment.