mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
prevent crashes due to uninitialized free_gpu_mem
This commit is contained in:
parent
f3050fefce
commit
2154dd2349
@ -174,7 +174,8 @@ class Generate:
|
|||||||
config = None,
|
config = None,
|
||||||
gfpgan=None,
|
gfpgan=None,
|
||||||
codeformer=None,
|
codeformer=None,
|
||||||
esrgan=None
|
esrgan=None,
|
||||||
|
free_gpu_mem=False,
|
||||||
):
|
):
|
||||||
models = OmegaConf.load(conf)
|
models = OmegaConf.load(conf)
|
||||||
mconfig = models[model]
|
mconfig = models[model]
|
||||||
@ -201,6 +202,7 @@ class Generate:
|
|||||||
self.gfpgan = gfpgan
|
self.gfpgan = gfpgan
|
||||||
self.codeformer = codeformer
|
self.codeformer = codeformer
|
||||||
self.esrgan = esrgan
|
self.esrgan = esrgan
|
||||||
|
self.free_gpu_mem = free_gpu_mem
|
||||||
|
|
||||||
# Note that in previous versions, there was an option to pass the
|
# Note that in previous versions, there was an option to pass the
|
||||||
# device to Generate(). However the device was then ignored, so
|
# device to Generate(). However the device was then ignored, so
|
||||||
|
@ -75,7 +75,8 @@ def main():
|
|||||||
precision = opt.precision,
|
precision = opt.precision,
|
||||||
gfpgan=gfpgan,
|
gfpgan=gfpgan,
|
||||||
codeformer=codeformer,
|
codeformer=codeformer,
|
||||||
esrgan=esrgan
|
esrgan=esrgan,
|
||||||
|
free_gpu_mem=opt.free_gpu_mem,
|
||||||
)
|
)
|
||||||
except (FileNotFoundError, IOError, KeyError) as e:
|
except (FileNotFoundError, IOError, KeyError) as e:
|
||||||
print(f'{e}. Aborting.')
|
print(f'{e}. Aborting.')
|
||||||
@ -104,8 +105,6 @@ def main():
|
|||||||
|
|
||||||
# preload the model
|
# preload the model
|
||||||
gen.load_model()
|
gen.load_model()
|
||||||
#set additional option
|
|
||||||
gen.free_gpu_mem = opt.free_gpu_mem
|
|
||||||
|
|
||||||
# web server loops forever
|
# web server loops forever
|
||||||
if opt.web or opt.gui:
|
if opt.web or opt.gui:
|
||||||
|
Loading…
Reference in New Issue
Block a user