mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-04-29 18:51:31 +00:00
Update forge_perturbed_attention.py
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
import gradio as gr
|
import gradio as gr
|
||||||
import ldm_patched.modules.samplers
|
|
||||||
|
|
||||||
from modules import scripts
|
from modules import scripts
|
||||||
from backend.patcher.base import set_model_options_patch_replace
|
from backend.patcher.base import set_model_options_patch_replace
|
||||||
|
from backend.sampling.sampling_function import calc_cond_uncond_batch
|
||||||
|
|
||||||
|
|
||||||
class PerturbedAttentionGuidanceForForge(scripts.Script):
|
class PerturbedAttentionGuidanceForForge(scripts.Script):
|
||||||
@@ -41,7 +41,7 @@ class PerturbedAttentionGuidanceForForge(scripts.Script):
|
|||||||
if scale == 0:
|
if scale == 0:
|
||||||
return denoised
|
return denoised
|
||||||
|
|
||||||
degraded, _ = ldm_patched.modules.samplers.calc_cond_uncond_batch(model, cond, None, x, sigma, new_options)
|
degraded, _ = calc_cond_uncond_batch(model, cond, None, x, sigma, new_options)
|
||||||
|
|
||||||
return denoised + (cond_denoised - degraded) * scale
|
return denoised + (cond_denoised - degraded) * scale
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user