Skip to content

Commit

Permalink
Update nodes.py
Browse files Browse the repository at this point in the history
Small fix to allow uncond to be dropped when using CFGLimiterGuidance from pamparamm/ComfyUI-ppm
  • Loading branch information
MythicalChu authored Nov 29, 2024
1 parent 8c8c51a commit cbbe571
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def patch(
guidance_sigma_start: float = 5.42,
guidance_sigma_end: float = 0.28,
print_data = False,
extras=[],
):
momentum_buffer = MomentumBuffer(momentum)
extras = [momentum_buffer, momentum, adaptive_momentum]
Expand Down Expand Up @@ -127,7 +128,8 @@ def apg_function(args):
return normalized_guidance(cond, uncond, cond_scale, momentum_buffer, eta, norm_threshold)

m = model.clone()
m.set_model_sampler_cfg_function(apg_function, extras)
m.set_model_sampler_cfg_function(apg_function, extras==extras)
m.model_options["disable_cfg1_optimization"] = False

return (m,)

Expand Down

1 comment on commit cbbe571

@catboxanon
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the double equals for extras==extras intentional here...?

Please sign in to comment.