mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-04-29 10:41:25 +00:00
Update forge_freeu.py
This commit is contained in:
@@ -16,7 +16,7 @@ def Fourier_filter(x, threshold, scale):
|
|||||||
return x_filtered.to(x.dtype)
|
return x_filtered.to(x.dtype)
|
||||||
|
|
||||||
|
|
||||||
def freeu_v2(model, b1, b2, s1, s2):
|
def set_freeu_v2_patch(model, b1, b2, s1, s2):
|
||||||
model_channels = model.model.model_config.unet_config["model_channels"]
|
model_channels = model.model.model_config.unet_config["model_channels"]
|
||||||
scale_dict = {model_channels * 4: (b1, s1), model_channels * 2: (b2, s2)}
|
scale_dict = {model_channels * 4: (b1, s1), model_channels * 2: (b2, s2)}
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ class FreeUForForge(scripts.Script):
|
|||||||
|
|
||||||
unet = p.sd_model.forge_objects.unet
|
unet = p.sd_model.forge_objects.unet
|
||||||
|
|
||||||
unet = freeu_v2(unet, freeu_b1, freeu_b2, freeu_s1, freeu_s2)
|
unet = set_freeu_v2_patch(unet, freeu_b1, freeu_b2, freeu_s1, freeu_s2)
|
||||||
|
|
||||||
p.sd_model.forge_objects.unet = unet
|
p.sd_model.forge_objects.unet = unet
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user