add more developer debug tools (#603)

* add more developer debug tools

* add more developer debug tools
This commit is contained in:
lllyasviel
2023-10-09 12:09:51 -07:00
committed by GitHub
parent fc35888757
commit 05d92ca50b
6 changed files with 57 additions and 16 deletions
+8
View File
@@ -20,6 +20,7 @@ import comfy.samplers
from comfy.sd import load_checkpoint_guess_config
from nodes import VAEDecode, EmptyLatentImage, VAEEncode, VAEEncodeTiled, VAEDecodeTiled, VAEEncodeForInpaint, \
ControlNetApplyAdvanced
from comfy_extras.nodes_freelunch import FreeU
from comfy.sample import prepare_mask
from modules.patch import patched_sampler_cfg_function, patched_model_function_wrapper
from comfy.lora import model_lora_keys_unet, model_lora_keys_clip, load_lora
@@ -32,6 +33,7 @@ opVAEDecodeTiled = VAEDecodeTiled()
opVAEEncodeTiled = VAEEncodeTiled()
opVAEEncodeForInpaint = VAEEncodeForInpaint()
opControlNetApplyAdvanced = ControlNetApplyAdvanced()
opFreeU = FreeU()
class StableDiffusionModel:
@@ -42,6 +44,12 @@ class StableDiffusionModel:
self.clip_vision = clip_vision
@torch.no_grad()
@torch.inference_mode()
def apply_freeu(model, b1, b2, s1, s2):
return opFreeU.patch(model=model, b1=b1, b2=b2, s1=s1, s2=s2)[0]
@torch.no_grad()
@torch.inference_mode()
def load_controlnet(ckpt_filename):