From f1cd2dfa9984f6047b0a2af966983777b11111d2 Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Wed, 23 Oct 2024 14:57:47 -0400 Subject: [PATCH] fix k-diffusion Signed-off-by: Vladimir Mandic --- modules/sd_samplers_kdiffusion.py | 9 +++++---- modules/ui_sections.py | 2 +- wiki | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/sd_samplers_kdiffusion.py b/modules/sd_samplers_kdiffusion.py index 392842449..f885c8869 100644 --- a/modules/sd_samplers_kdiffusion.py +++ b/modules/sd_samplers_kdiffusion.py @@ -4,17 +4,18 @@ from collections import deque import torch from modules import prompt_parser -from modules import devices +from modules import devices, errors from modules import sd_samplers_common import modules.shared as shared from modules.script_callbacks import CFGDenoiserParams, cfg_denoiser_callback from modules.script_callbacks import CFGDenoisedParams, cfg_denoised_callback from modules.script_callbacks import AfterCFGCallbackParams, cfg_after_cfg_callback from modules.script_callbacks import ExtraNoiseParams, extra_noise_callback - +from installer import install # deal with k-diffusion imports k_sampling = None +install('clean-fid') try: import k_diffusion # pylint: disable=wrong-import-order k_sampling = k_diffusion.sampling @@ -25,8 +26,8 @@ import importlib k_diffusion = importlib.import_module('modules.k-diffusion.k_diffusion') k_sampling = k_diffusion.sampling -except Exception: - pass +except Exception as e: + errors.display(e, 'k-diffusion') if k_sampling is None: shared.log.info(f'Path search: {sys.path}') shared.log.error("Module not found: k-diffusion") diff --git a/modules/ui_sections.py b/modules/ui_sections.py index a38037392..391b5c609 100644 --- a/modules/ui_sections.py +++ b/modules/ui_sections.py @@ -270,7 +270,7 @@ def set_sampler_preset(preset): sampler_options = gr.CheckboxGroup(label='Sampler options', elem_id=f"{tabname}_sampler_options", choices=options, value=values, type='value') with gr.Row(elem_classes=['flex-break']): shared.opts.data['schedulers_sigma'] = shared.opts.data.get('schedulers_sigma', 'default') - sampler_algo = gr.Radio(label='Sigma algorithm', elem_id=f"{tabname}_sigma_algo", choices=['default', 'karras', 'exponential', 'polyexponential'], value=shared.opts.data.schedulers_sigma, type='value') + sampler_algo = gr.Dropdown(label='Sigma algorithm', elem_id=f"{tabname}_sigma_algo", choices=['default', 'karras', 'exponential', 'polyexponential'], value=shared.opts.schedulers_sigma, type='value') sampler_options.change(fn=set_sampler_original_options, inputs=[sampler_options, sampler_algo], outputs=[]) sampler_algo.change(fn=set_sampler_original_options, inputs=[sampler_options, sampler_algo], outputs=[]) diff --git a/wiki b/wiki index 862a9ef5d..53def8203 160000 --- a/wiki +++ b/wiki @@ -1 +1 @@ -Subproject commit 862a9ef5de7dec16a8c10f90e2af26b60fc744f2 +Subproject commit 53def8203b6799cbd659327c1af6aa5af9cb9a70