Fix perpneg not working on SDXL.

This commit is contained in:
comfyanonymous 2023-12-16 02:30:16 -05:00
parent 172984db01
commit 574efd3782
1 changed files with 2 additions and 1 deletions

View File

@ -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