mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-17 00:43:48 +08:00
Revert CFG 1 optimization
This commit is contained in:
parent
1664f191a5
commit
9a53594029
@ -53,11 +53,7 @@ class EpsilonScaling:
|
|||||||
# Clone the model patcher to avoid modifying the original model in place
|
# Clone the model patcher to avoid modifying the original model in place
|
||||||
model_clone = model.clone()
|
model_clone = model.clone()
|
||||||
|
|
||||||
# Apply the patch using set_model_sampler_post_cfg_function.
|
model_clone.set_model_sampler_post_cfg_function(epsilon_scaling_function)
|
||||||
# disable_cfg1_optimization=True is crucial. This patch needs the outputs of both the
|
|
||||||
# conditional and unconditional models to correctly calculate the guided noise, even when
|
|
||||||
# the CFG scale is 1.0. Disabling the optimization ensures both are always computed.
|
|
||||||
model_clone.set_model_sampler_post_cfg_function(epsilon_scaling_function, disable_cfg1_optimization=True)
|
|
||||||
|
|
||||||
return (model_clone,)
|
return (model_clone,)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user