mirror of
https://github.com/lllyasviel/Fooocus.git
synced 2026-08-16 13:13:16 +02:00
support embeddings (#675)
This commit is contained in:
+2
-1
@@ -24,6 +24,7 @@ from fcbh_extras.nodes_freelunch import FreeU
|
||||
from fcbh.sample import prepare_mask
|
||||
from modules.patch import patched_sampler_cfg_function, patched_model_function_wrapper
|
||||
from fcbh.lora import model_lora_keys_unet, model_lora_keys_clip, load_lora
|
||||
from modules.path import embeddings_path
|
||||
|
||||
|
||||
opEmptyLatentImage = EmptyLatentImage()
|
||||
@@ -66,7 +67,7 @@ def apply_controlnet(positive, negative, control_net, image, strength, start_per
|
||||
@torch.no_grad()
|
||||
@torch.inference_mode()
|
||||
def load_model(ckpt_filename):
|
||||
unet, clip, vae, clip_vision = load_checkpoint_guess_config(ckpt_filename)
|
||||
unet, clip, vae, clip_vision = load_checkpoint_guess_config(ckpt_filename, embedding_directory=embeddings_path)
|
||||
unet.model_options['sampler_cfg_function'] = patched_sampler_cfg_function
|
||||
unet.model_options['model_function_wrapper'] = patched_model_function_wrapper
|
||||
return StableDiffusionModel(unet=unet, clip=clip, vae=vae, clip_vision=clip_vision)
|
||||
|
||||
@@ -49,6 +49,7 @@ def get_dir_or_set_default(key, default_value):
|
||||
|
||||
modelfile_path = get_dir_or_set_default('modelfile_path', '../models/checkpoints/')
|
||||
lorafile_path = get_dir_or_set_default('lorafile_path', '../models/loras/')
|
||||
embeddings_path = get_dir_or_set_default('embeddings_path', '../models/embeddings/')
|
||||
vae_approx_path = get_dir_or_set_default('vae_approx_path', '../models/vae_approx/')
|
||||
upscale_models_path = get_dir_or_set_default('upscale_models_path', '../models/upscale_models/')
|
||||
inpaint_models_path = get_dir_or_set_default('inpaint_models_path', '../models/inpaint/')
|
||||
|
||||
Reference in New Issue
Block a user