mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 17:24:32 +02:00
fix tomed error
This commit is contained in:
Submodule extensions-builtin/sd-webui-agent-scheduler updated: e8d02c7e11...310bb4eace
@@ -18,7 +18,6 @@ class ScriptPostprocessingForMainUI(scripts.Script):
|
||||
|
||||
def postprocess_image(self, p, script_pp, *args): # pylint: disable=arguments-differ
|
||||
args_dict = dict(zip(self.postprocessing_controls, args))
|
||||
|
||||
pp = scripts_postprocessing.PostprocessedImage(script_pp.image)
|
||||
pp.info = {}
|
||||
self.script.process(pp, **args_dict)
|
||||
@@ -34,5 +33,4 @@ def create_auto_preprocessing_script_data():
|
||||
continue
|
||||
constructor = lambda s=script: ScriptPostprocessingForMainUI(s.script_class()) # pylint: disable=unnecessary-lambda-assignment
|
||||
res.append(scripts.ScriptClassData(script_class=constructor, path=script.path, basedir=script.basedir, module=script.module))
|
||||
|
||||
return res
|
||||
|
||||
@@ -1105,14 +1105,12 @@ def unload_model_weights(op='model'):
|
||||
devices.torch_gc(force=True)
|
||||
|
||||
|
||||
def apply_token_merging(sd_model, token_merging_ratio):
|
||||
def apply_token_merging(sd_model, token_merging_ratio=0):
|
||||
current_token_merging_ratio = getattr(sd_model, 'applied_token_merged_ratio', 0)
|
||||
# shared.log.debug(f'Appplying token merging: current={current_token_merging_ratio} target={token_merging_ratio}')
|
||||
if current_token_merging_ratio == token_merging_ratio:
|
||||
if token_merging_ratio is None or current_token_merging_ratio == token_merging_ratio:
|
||||
return
|
||||
if current_token_merging_ratio > 0:
|
||||
tomesd.remove_patch(sd_model)
|
||||
|
||||
if token_merging_ratio > 0:
|
||||
tomesd.apply_patch(
|
||||
sd_model,
|
||||
|
||||
@@ -15,6 +15,7 @@ from modules import timer, errors, paths # pylint: disable=unused-import
|
||||
startup_timer = timer.Timer()
|
||||
local_url = None
|
||||
|
||||
logging.getLogger("DeepSpeed").disabled = True
|
||||
import torch # pylint: disable=C0411
|
||||
try:
|
||||
import intel_extension_for_pytorch as ipex # pylint: disable=import-error, unused-import
|
||||
|
||||
Reference in New Issue
Block a user