Skip to content

Commit b43916a

Browse files
authored
Fix fresca's input and output (Comfy-Org#8871)
1 parent 7bc7dd2 commit b43916a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

comfy_extras/nodes_fresca.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,11 @@ def INPUT_TYPES(s):
7171
DESCRIPTION = "Applies frequency-dependent scaling to the guidance"
7272
def patch(self, model, scale_low, scale_high, freq_cutoff):
7373
def custom_cfg_function(args):
74-
cond = args["conds_out"][0]
75-
uncond = args["conds_out"][1]
74+
conds_out = args["conds_out"]
75+
if len(conds_out) <= 1 or None in args["conds"][:2]:
76+
return conds_out
77+
cond = conds_out[0]
78+
uncond = conds_out[1]
7679

7780
guidance = cond - uncond
7881
filtered_guidance = Fourier_filter(
@@ -83,7 +86,7 @@ def custom_cfg_function(args):
8386
)
8487
filtered_cond = filtered_guidance + uncond
8588

86-
return [filtered_cond, uncond]
89+
return [filtered_cond, uncond] + conds_out[2:]
8790

8891
m = model.clone()
8992
m.set_model_sampler_pre_cfg_function(custom_cfg_function)

0 commit comments

Comments
 (0)