Skip to content

Commit

Permalink
Fix perpneg not working on SDXL.
Browse files Browse the repository at this point in the history
  • Loading branch information
comfyanonymous committed Dec 16, 2023
1 parent 172984d commit 574efd3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion comfy_extras/nodes_perpneg.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ def cfg_function(args):
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
Expand Down

0 comments on commit 574efd3

Please sign in to comment.