From 574efd3782c022fd00f55745d784207f6d318b15 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Sat, 16 Dec 2023 02:30:16 -0500 Subject: [PATCH] Fix perpneg not working on SDXL. --- comfy_extras/nodes_perpneg.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/comfy_extras/nodes_perpneg.py b/comfy_extras/nodes_perpneg.py index 0c5ccb77..45e4d418 100644 --- a/comfy_extras/nodes_perpneg.py +++ b/comfy_extras/nodes_perpneg.py @@ -29,8 +29,9 @@ class PerpNeg: x = args["input"] sigma = args["sigma"] model_options = args["model_options"] + nocond_processed = comfy.samplers.encode_model_conds(model.extra_conds, nocond, x, x.device, "negative") - (noise_pred_nocond, _) = comfy.samplers.calc_cond_uncond_batch(model, nocond, None, x, sigma, model_options) + (noise_pred_nocond, _) = comfy.samplers.calc_cond_uncond_batch(model, nocond_processed, None, x, sigma, model_options) pos = noise_pred_pos - noise_pred_nocond neg = noise_pred_neg - noise_pred_nocond