sd_hijack.model_hijack.embedding_db.load_textual_inversion_embeddings(force_reload=True)# Reload embeddings after model load as they may or may not fit the model
print(f"Unloading model {len(model_data.loaded_sd_models)} over the limit of {shared.opts.sd_checkpoints_limit}: {loaded_model.sd_checkpoint_info.title}")
model_data.loaded_sd_models.pop()
send_model_to_trash(loaded_model)
timer.record("send model to trash")
ifshared.opts.sd_checkpoints_keep_in_cpu:
send_model_to_cpu(sd_model)
timer.record("send model to cpu")
ifalready_loadedisnotNone:
send_model_to_device(already_loaded)
timer.record("send model to device")
model_data.set_sd_model(already_loaded)
print(f"Using already loaded model {already_loaded.sd_checkpoint_info.title}: done in {timer.summary()}")
"print_hypernet_extra":OptionInfo(False,"Print extra hypernetwork information to console."),
"list_hidden_files":OptionInfo(True,"Load models/files in hidden directories").info("directory is hidden if its name starts with \".\""),
"disable_mmap_load_safetensors":OptionInfo(False,"Disable memmapping for loading .safetensors files.").info("fixes very slow loading speed in some cases"),
"hide_ldm_prints":OptionInfo(True,"Prevent Stability-AI's ldm/sgm modules from printing noise to console."),
"sd_checkpoint_cache":OptionInfo(0,"Checkpoints to cache in RAM",gr.Slider,{"minimum":0,"maximum":10,"step":1}),
"sd_checkpoints_limit":OptionInfo(1,"Maximum number of checkpoints loaded at the same time",gr.Slider,{"minimum":1,"maximum":10,"step":1}),
"sd_checkpoints_keep_in_cpu":OptionInfo(True,"Only keep one model on device").info("will keep models other than the currently used one in RAM rather than VRAM"),
"sd_checkpoint_cache":OptionInfo(0,"Checkpoints to cache in RAM",gr.Slider,{"minimum":0,"maximum":10,"step":1}).info("obsolete; set to 0 and use the two settings above instead"),
"sd_vae_checkpoint_cache":OptionInfo(0,"VAE Checkpoints to cache in RAM",gr.Slider,{"minimum":0,"maximum":10,"step":1}),
"sd_vae":OptionInfo("Automatic","SD VAE",gr.Dropdown,lambda:{"choices":shared_items.sd_vae_items()},refresh=shared_items.refresh_vae_list).info("choose VAE model: Automatic = use one with same filename as checkpoint; None = use VAE from checkpoint"),
"sd_vae_as_default":OptionInfo(True,"Ignore selected VAE for stable diffusion checkpoints that have their own .vae.pt next to them"),