wolverinn
commited on
Commit
·
99ab15d
1
Parent(s):
e516e30
fix import
Browse files- handler.py +2 -3
- modules/ui_extra_networks_checkpoints.py +38 -38
handler.py
CHANGED
|
@@ -13,8 +13,7 @@ from packaging import version
|
|
| 13 |
import logging
|
| 14 |
logging.getLogger("xformers").addFilter(lambda record: 'A matching Triton is not available' not in record.getMessage())
|
| 15 |
|
| 16 |
-
from modules import
|
| 17 |
-
from modules import extra_networks_hypernet, ui_extra_networks_hypernets, ui_extra_networks_textual_inversion
|
| 18 |
from modules.call_queue import wrap_queued_call, queue_lock, wrap_gradio_gpu_call
|
| 19 |
|
| 20 |
import torch
|
|
@@ -24,7 +23,7 @@ if ".dev" in torch.__version__ or "+git" in torch.__version__:
|
|
| 24 |
torch.__long_version__ = torch.__version__
|
| 25 |
torch.__version__ = re.search(r'[\d.]+[\d]', torch.__version__).group(0)
|
| 26 |
|
| 27 |
-
from modules import shared, devices,
|
| 28 |
import modules.codeformer_model as codeformer
|
| 29 |
import modules.face_restoration
|
| 30 |
import modules.gfpgan_model as gfpgan
|
|
|
|
| 13 |
import logging
|
| 14 |
logging.getLogger("xformers").addFilter(lambda record: 'A matching Triton is not available' not in record.getMessage())
|
| 15 |
|
| 16 |
+
from modules import errors
|
|
|
|
| 17 |
from modules.call_queue import wrap_queued_call, queue_lock, wrap_gradio_gpu_call
|
| 18 |
|
| 19 |
import torch
|
|
|
|
| 23 |
torch.__long_version__ = torch.__version__
|
| 24 |
torch.__version__ = re.search(r'[\d.]+[\d]', torch.__version__).group(0)
|
| 25 |
|
| 26 |
+
from modules import shared, devices, ui_tempdir
|
| 27 |
import modules.codeformer_model as codeformer
|
| 28 |
import modules.face_restoration
|
| 29 |
import modules.gfpgan_model as gfpgan
|
modules/ui_extra_networks_checkpoints.py
CHANGED
|
@@ -1,39 +1,39 @@
|
|
| 1 |
-
import html
|
| 2 |
-
import json
|
| 3 |
-
import os
|
| 4 |
-
import urllib.parse
|
| 5 |
-
|
| 6 |
-
from modules import shared, ui_extra_networks, sd_models
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
class ExtraNetworksPageCheckpoints(ui_extra_networks.ExtraNetworksPage):
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
|
|
|
|
| 1 |
+
# import html
|
| 2 |
+
# import json
|
| 3 |
+
# import os
|
| 4 |
+
# import urllib.parse
|
| 5 |
+
|
| 6 |
+
# from modules import shared, ui_extra_networks, sd_models
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
# class ExtraNetworksPageCheckpoints(ui_extra_networks.ExtraNetworksPage):
|
| 10 |
+
# def __init__(self):
|
| 11 |
+
# super().__init__('Checkpoints')
|
| 12 |
+
|
| 13 |
+
# def refresh(self):
|
| 14 |
+
# shared.refresh_checkpoints()
|
| 15 |
+
|
| 16 |
+
# def list_items(self):
|
| 17 |
+
# checkpoint: sd_models.CheckpointInfo
|
| 18 |
+
# for name, checkpoint in sd_models.checkpoints_list.items():
|
| 19 |
+
# path, ext = os.path.splitext(checkpoint.filename)
|
| 20 |
+
# previews = [path + ".png", path + ".preview.png"]
|
| 21 |
+
|
| 22 |
+
# preview = None
|
| 23 |
+
# for file in previews:
|
| 24 |
+
# if os.path.isfile(file):
|
| 25 |
+
# preview = self.link_preview(file)
|
| 26 |
+
# break
|
| 27 |
+
|
| 28 |
+
# yield {
|
| 29 |
+
# "name": checkpoint.name_for_extra,
|
| 30 |
+
# "filename": path,
|
| 31 |
+
# "preview": preview,
|
| 32 |
+
# "search_term": self.search_terms_from_path(checkpoint.filename) + " " + (checkpoint.sha256 or ""),
|
| 33 |
+
# "onclick": '"' + html.escape(f"""return selectCheckpoint({json.dumps(name)})""") + '"',
|
| 34 |
+
# "local_preview": path + ".png",
|
| 35 |
+
# }
|
| 36 |
+
|
| 37 |
+
# def allowed_directories_for_previews(self):
|
| 38 |
+
# return [v for v in [shared.cmd_opts.ckpt_dir, sd_models.model_path] if v is not None]
|
| 39 |
|