* Reworked SAG, removed unnecessary patch
* Reworked anisotropic filters for faster compute.
* Replaced with guided anisotropic filter for less distribution.
This commit is contained in:
lllyasviel
2023-09-02 06:00:20 -07:00
committed by GitHub
parent 7538b4d17b
commit 09e0d1cb3a
6 changed files with 61 additions and 345 deletions
+10
View File
@@ -4,6 +4,7 @@ import torch
import modules.path
from comfy.model_base import SDXL, SDXLRefiner
from modules.patch import cfg_patched
xl_base: core.StableDiffusionModel = None
@@ -123,6 +124,15 @@ def process(positive_prompt, negative_prompt, steps, switch, width, height, imag
global positive_conditions_cache, negative_conditions_cache, \
positive_conditions_refiner_cache, negative_conditions_refiner_cache
if xl_base is not None:
xl_base.unet.model_options['sampler_cfg_function'] = cfg_patched
if xl_base_patched is not None:
xl_base_patched.unet.model_options['sampler_cfg_function'] = cfg_patched
if xl_refiner is not None:
xl_refiner.unet.model_options['sampler_cfg_function'] = cfg_patched
positive_conditions = core.encode_prompt_condition(clip=xl_base_patched.clip, prompt=positive_prompt) if positive_conditions_cache is None else positive_conditions_cache
negative_conditions = core.encode_prompt_condition(clip=xl_base_patched.clip, prompt=negative_prompt) if negative_conditions_cache is None else negative_conditions_cache