mirror of
https://github.com/vladmandic/automatic
synced 2026-09-10 23:08:43 +02:00
move initialization of onnx pipelines & create onnx folder automatically
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import os
|
||||
from typing import Any, Dict, Optional
|
||||
import torch
|
||||
import diffusers
|
||||
@@ -142,9 +143,14 @@ def initialize():
|
||||
return
|
||||
|
||||
from modules import devices
|
||||
from modules.paths import models_path
|
||||
from . import pipelines
|
||||
from .execution_providers import ExecutionProvider, TORCH_DEVICE_TO_EP
|
||||
|
||||
onnx_dir = os.path.join(models_path, "ONNX")
|
||||
if not os.path.isdir(onnx_dir):
|
||||
os.mkdir(onnx_dir)
|
||||
|
||||
if devices.backend == "rocm":
|
||||
TORCH_DEVICE_TO_EP["cuda"] = ExecutionProvider.ROCm
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ from rich.console import Console
|
||||
from modules import errors, shared_items, shared_state, cmd_args, theme
|
||||
from modules.paths import models_path, script_path, data_path, sd_configs_path, sd_default_config, sd_model_file, default_sd_model_file, extensions_dir, extensions_builtin_dir # pylint: disable=W0611
|
||||
from modules.dml import memory_providers, default_memory_provider, directml_do_hijack
|
||||
from modules.onnx_impl import initialize as initialize_onnx
|
||||
from modules.onnx_impl.execution_providers import available_execution_providers, get_default_execution_provider
|
||||
import modules.interrogate
|
||||
import modules.memmon
|
||||
@@ -906,6 +907,7 @@ mem_mon = modules.memmon.MemUsageMonitor("MemMon", devices.device)
|
||||
max_workers = 4
|
||||
if devices.backend == "directml":
|
||||
directml_do_hijack()
|
||||
initialize_onnx()
|
||||
|
||||
|
||||
class TotalTQDM: # compatibility with previous global-tqdm
|
||||
|
||||
@@ -27,9 +27,6 @@ def list_crossattention():
|
||||
def get_pipelines():
|
||||
import diffusers
|
||||
from installer import log
|
||||
from modules.onnx_impl import initialize as initialize_onnx_pipelines
|
||||
|
||||
initialize_onnx_pipelines()
|
||||
|
||||
pipelines = { # note: not all pipelines can be used manually as they require prior pipeline next to decoder pipeline
|
||||
'Autodetect': None,
|
||||
|
||||
Reference in New Issue
Block a user