mirror of
https://github.com/Sygil-Dev/sygil-webui.git
synced 2024-12-15 22:42:14 +03:00
Respect CLI parameters (#179)
the CLI parameters ckpt and config now work if required - the paths were hardcoded.
This commit is contained in:
parent
33890563d2
commit
ee571eaced
6
webui.py
6
webui.py
@ -301,7 +301,7 @@ def try_loading_RealESRGAN(model_name: str):
|
|||||||
try_loading_RealESRGAN('RealESRGAN_x4plus')
|
try_loading_RealESRGAN('RealESRGAN_x4plus')
|
||||||
|
|
||||||
if opt.optimized:
|
if opt.optimized:
|
||||||
sd = load_sd_from_config("models/ldm/stable-diffusion-v1/model.ckpt")
|
sd = load_sd_from_config(opt.ckpt)
|
||||||
li, lo = [], []
|
li, lo = [], []
|
||||||
for key, v_ in sd.items():
|
for key, v_ in sd.items():
|
||||||
sp = key.split('.')
|
sp = key.split('.')
|
||||||
@ -337,8 +337,8 @@ if opt.optimized:
|
|||||||
model = model if opt.no_half else model.half()
|
model = model if opt.no_half else model.half()
|
||||||
modelCS = modelCS if opt.no_half else modelCS.half()
|
modelCS = modelCS if opt.no_half else modelCS.half()
|
||||||
else:
|
else:
|
||||||
config = OmegaConf.load("configs/stable-diffusion/v1-inference.yaml")
|
config = OmegaConf.load(opt.config)
|
||||||
model = load_model_from_config(config, "models/ldm/stable-diffusion-v1/model.ckpt")
|
model = load_model_from_config(config, opt.ckpt)
|
||||||
|
|
||||||
device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
|
device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
|
||||||
model = (model if opt.no_half else model.half()).to(device)
|
model = (model if opt.no_half else model.half()).to(device)
|
||||||
|
Loading…
Reference in New Issue
Block a user