MCPcopy Index your code
hub / github.com/easydiffusion/easydiffusion / load_model

Function load_model

ui/easydiffusion/backends/webui_common.py:122–135  ·  view source on GitHub ↗
(context, model_type, **kwargs)

Source from the content-addressed store, hash-verified

120
121
122def load_model(context, model_type, **kwargs):
123 from easydiffusion.app import ROOT_DIR, getConfig
124
125 config = getConfig()
126 models_dir = config.get("models_dir", os.path.join(ROOT_DIR, "models"))
127
128 model_path = context.model_paths[model_type]
129
130 if model_type == "stable-diffusion":
131 base_dir = os.path.join(models_dir, model_type)
132 model_path = os.path.relpath(model_path, base_dir)
133
134 # print(f"load model: {model_type=} {model_path=} {curr_models=}")
135 curr_models[model_type] = model_path
136
137
138def unload_model(context, model_type, **kwargs):

Callers

nothing calls this directly

Calls 2

getConfigFunction · 0.90
getMethod · 0.80

Tested by

no test coverage detected