1
mirror of https://github.com/comfyanonymous/ComfyUI.git synced 2025-08-02 23:14:49 +08:00

Add block replace transformer_options to flux.

This commit is contained in:
comfyanonymous
2024-11-12 08:00:00 -05:00
parent a72d152b0c
commit 8ebf2d8831
2 changed files with 29 additions and 6 deletions

View File

@@ -128,6 +128,9 @@ class SkipLayerGuidanceSD3:
sigma_start = model_sampling.percent_to_sigma(start_percent)
sigma_end = model_sampling.percent_to_sigma(end_percent)
layers = re.findall(r'\d+', layers)
layers = [int(i) for i in layers]
def post_cfg_function(args):
model = args["model"]
cond_pred = args["cond_denoised"]
@@ -147,8 +150,6 @@ class SkipLayerGuidanceSD3:
cfg_result = cfg_result + (cond_pred - slg) * scale
return cfg_result
layers = re.findall(r'\d+', layers)
layers = [int(i) for i in layers]
m = model.clone()
m.set_model_sampler_post_cfg_function(post_cfg_function)