mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 17:24:32 +02:00
Merge pull request #3210 from Iaotle/patch-1
Fix torch version check for rollback VAE
This commit is contained in:
@@ -293,7 +293,7 @@ check [ChangeLog](CHANGELOG.md) for when feature was first introduced as it will
|
||||
### Sponsors
|
||||
|
||||
<div align="center">
|
||||
<!-- sponsors --><a href="https://github.com/Tillerz"><img src="https://github.com/Tillerz.png" width="60px" alt="Tillerz" /></a><a href="https://github.com/allangrant"><img src="https://github.com/allangrant.png" width="60px" alt="Allan Grant" /></a><a href="https://github.com/BrentOzar"><img src="https://github.com/BrentOzar.png" width="60px" alt="Brent Ozar" /></a><a href="https://github.com/inktomi"><img src="https://github.com/inktomi.png" width="60px" alt="Matthew Runo" /></a><a href="https://github.com/4joeknight4"><img src="https://github.com/4joeknight4.png" width="60px" alt="" /></a><a href="https://github.com/SaladTechnologies"><img src="https://github.com/SaladTechnologies.png" width="60px" alt="Salad Technologies" /></a><a href="https://github.com/mantzaris"><img src="https://github.com/mantzaris.png" width="60px" alt="a.v.mantzaris" /></a><a href="https://github.com/CurseWave"><img src="https://github.com/CurseWave.png" width="60px" alt="" /></a><!-- sponsors -->
|
||||
<!-- sponsors --><a href="https://github.com/allangrant"><img src="https://github.com/allangrant.png" width="60px" alt="Allan Grant" /></a><a href="https://github.com/BrentOzar"><img src="https://github.com/BrentOzar.png" width="60px" alt="Brent Ozar" /></a><a href="https://github.com/inktomi"><img src="https://github.com/inktomi.png" width="60px" alt="Matthew Runo" /></a><a href="https://github.com/4joeknight4"><img src="https://github.com/4joeknight4.png" width="60px" alt="" /></a><a href="https://github.com/SaladTechnologies"><img src="https://github.com/SaladTechnologies.png" width="60px" alt="Salad Technologies" /></a><a href="https://github.com/mantzaris"><img src="https://github.com/mantzaris.png" width="60px" alt="a.v.mantzaris" /></a><a href="https://github.com/CurseWave"><img src="https://github.com/CurseWave.png" width="60px" alt="" /></a><a href="https://github.com/freeload101"><img src="https://github.com/freeload101.png" width="60px" alt="Robert McCurdy" /></a><!-- sponsors -->
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
@@ -60,17 +60,16 @@ fastapi_args = {
|
||||
}
|
||||
|
||||
import modules.sd_hijack
|
||||
from packaging.version import Version
|
||||
timer.startup.record("ldm")
|
||||
|
||||
modules.loader.initialized = True
|
||||
|
||||
|
||||
def check_rollback_vae():
|
||||
if shared.cmd_opts.rollback_vae:
|
||||
if not torch.cuda.is_available():
|
||||
log.error("Rollback VAE functionality requires compatible GPU")
|
||||
shared.cmd_opts.rollback_vae = False
|
||||
elif not torch.__version__.startswith('2.1'):
|
||||
elif not Version(torch.__version__) >= Version("2.1"):
|
||||
log.error("Rollback VAE functionality requires Torch 2.1 or higher")
|
||||
shared.cmd_opts.rollback_vae = False
|
||||
elif 0 < torch.cuda.get_device_capability()[0] < 8:
|
||||
@@ -78,6 +77,7 @@ def check_rollback_vae():
|
||||
shared.cmd_opts.rollback_vae = False
|
||||
|
||||
|
||||
|
||||
def initialize():
|
||||
log.debug('Initializing')
|
||||
check_rollback_vae()
|
||||
|
||||
Reference in New Issue
Block a user