mirror of
https://github.com/vladmandic/automatic
synced 2026-09-20 01:31:13 +02:00
Add an opts override for DirectML.
This commit is contained in:
Submodule extensions-builtin/sd-extension-system-info updated: fcdd10c795...b30e324552
@@ -3,6 +3,7 @@ import torch
|
||||
import torch_directml # pylint: disable=import-error
|
||||
import modules.dml.hijack
|
||||
import modules.dml.amp as amp
|
||||
from modules.dml.opts import override_opts
|
||||
|
||||
from .optimizer.unknown import UnknownOptimizer
|
||||
|
||||
@@ -43,6 +44,8 @@ class DirectML():
|
||||
DirectML._is_autocast_enabled = enabled
|
||||
|
||||
|
||||
# Alternative of torch.cuda for DirectML.
|
||||
DirectML.amp = amp
|
||||
# Alternative of torch.cuda for DirectML.
|
||||
torch.dml = DirectML
|
||||
|
||||
override_opts()
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
from modules import shared
|
||||
|
||||
def override_opts():
|
||||
if shared.cmd_opts.backend.lower() == "diffusers":
|
||||
shared.opts.diffusers_generator_device = "cpu" # DirectML does not support torch.Generator API.
|
||||
Reference in New Issue
Block a user