mirror of
https://github.com/lllyasviel/Fooocus.git
synced 2026-08-16 13:13:16 +02:00
1.0.45 (#313)
* Reworked SAG, removed unnecessary patch * Reworked anisotropic filters for faster compute. * Replaced with guided anisotropic filter for less distribution.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user