dlss initial stable

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2026-09-09 12:47:34 +02:00
parent f51d56ad97
commit 1cdcdb21b5
14 changed files with 1787 additions and 6 deletions
+11 -3
View File
@@ -356,8 +356,14 @@ def process_samples(p: StableDiffusionProcessing, samples):
pp = scripts_manager.PostprocessImageArgs(image)
p.scripts.postprocess_image(p, pp)
if pp.image is not None:
image = pp.image
if isinstance(pp.image, list) and len(pp.image) > 0: # post process image can return original+processed
for i, img in enumerate(pp.image):
if i+1 < len(pp.image):
out_images.append(img)
out_infotexts.append(f"Postprocess image {i+1}")
image = pp.image[-1]
else:
image = pp.image
grading_params = processing_grading.GradingParams(
brightness=getattr(p, 'grading_brightness', 0.0),
contrast=getattr(p, 'grading_contrast', 0.0),
@@ -609,7 +615,9 @@ def process_images_inner(p: StableDiffusionProcessing) -> Processed:
audio=audio,
)
if p.scripts is not None and isinstance(p.scripts, scripts_manager.ScriptRunner) and not (shared.state.interrupted or shared.state.skipped):
p.scripts.postprocess(p, results)
_results = p.scripts.postprocess(p, results)
if _results is not None:
results = _results
timer.process.record('post')
p.ops = list(set(p.ops))
t3 = time.time()
+5 -1
View File
@@ -743,15 +743,19 @@ class ScriptRunner:
def postprocess(self, p: StableDiffusionProcessing, processed):
s = ScriptSummary('postprocess')
_processed = processed
for script in self.alwayson_scripts:
try:
args = resolve_script_args(script, p.script_args, p.per_script_args)
if args is not None:
script.postprocess(p, processed, *args)
result = script.postprocess(p, _processed, *args)
if result is not None: # allow postprocessing script to optionally modify results
_processed = result
except Exception as e:
errors.display(e, f'Running script postprocess: {script.filename}')
s.record(script.title())
s.report()
return _processed
def postprocess_batch(self, p: StableDiffusionProcessing, images, **kwargs):
s = ScriptSummary('postprocess-batch')
+1
View File
@@ -499,6 +499,7 @@ def create_settings(cmd_opts):
"openvino_cache_path": OptionInfo('cache', "Folder for OpenVINO cache", folder=True),
"onnx_cached_models_path": OptionInfo(os.path.join(paths.models_path, 'ONNX', 'cache'), "Folder for ONNX cached models", folder=True),
"onnx_temp_dir": OptionInfo(os.path.join(paths.models_path, 'ONNX', 'temp'), "Folder for ONNX conversion", folder=True),
"dlss_pkg_path": OptionInfo('', "Folder with DLSS package", gr.Textbox, { "visible": False}),
}))
# --- Image Options ---
+1 -1
View File
@@ -23,13 +23,13 @@ sort = '⇕'
detect = '📐'
folder = '📂'
random = '🎲️'
reuse = '♻️'
info = '' # noqa
reset = '🔄'
upload = '⬆️'
loading = ''
reuse = '⬅️'
search = '🔍'
tools = '🛠'
preview = '🖼️'
image = '🖌️'
resize = ''