mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-03-10 07:29:50 +00:00
Update legacy_preprocessor_loader.py
This commit is contained in:
@@ -1,10 +1,30 @@
|
||||
from modules_forge.shared import Preprocessor, PreprocessorParameter, preprocessor_dir, load_file_from_url, add_preprocessor
|
||||
|
||||
# This is a python script to convert all old preprocessors to new format.
|
||||
# However, the old preprocessors are not very memory effective
|
||||
# and eventually we should move all old preprocessors to new format
|
||||
# and eventually we should move all old preprocessors to new format manually
|
||||
# see also the forge_preprocessor_normalbae/scripts/preprocessor_normalbae for
|
||||
# how to make better implementation of preprocessors.
|
||||
# No newer preprocessors should be written in this legacy way.
|
||||
|
||||
from legacy_preprocessors.preprocessor_meta import cn_preprocessor_modules, cn_preprocessor_unloadable
|
||||
|
||||
|
||||
class LegacyPreprocessor(Preprocessor):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
legacy_call_function = None
|
||||
legacy_unload_function = None
|
||||
return
|
||||
|
||||
|
||||
legacy_preprocessors = {}
|
||||
|
||||
for k, v in cn_preprocessor_modules.items():
|
||||
p = LegacyPreprocessor()
|
||||
p.name = k
|
||||
p.legacy_call_function = v
|
||||
legacy_preprocessors[k] = p
|
||||
|
||||
|
||||
a = 0
|
||||
|
||||
Reference in New Issue
Block a user