aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--javascript/extensions.js2
-rw-r--r--javascript/notification.js2
-rw-r--r--modules/launch_utils.py19
-rw-r--r--modules/script_callbacks.py7
-rw-r--r--modules/sd_samplers_kdiffusion.py8
-rw-r--r--modules/sd_samplers_timesteps.py2
-rw-r--r--modules/shared_options.py1
-rw-r--r--modules/ui_extensions.py8
-rw-r--r--modules/ui_settings.py2
-rw-r--r--scripts/xyz_grid.py1
-rw-r--r--style.css17
11 files changed, 39 insertions, 30 deletions
diff --git a/javascript/extensions.js b/javascript/extensions.js
index 1f7254c5..312131b7 100644
--- a/javascript/extensions.js
+++ b/javascript/extensions.js
@@ -33,7 +33,7 @@ function extensions_check() {
var id = randomId();
- requestProgress(id, gradioApp().getElementById('extensions_installed_top'), null, function() {
+ requestProgress(id, gradioApp().getElementById('extensions_installed_html'), null, function() {
});
diff --git a/javascript/notification.js b/javascript/notification.js
index 76c5715d..6d799561 100644
--- a/javascript/notification.js
+++ b/javascript/notification.js
@@ -15,7 +15,7 @@ onAfterUiUpdate(function() {
}
}
- const galleryPreviews = gradioApp().querySelectorAll('div[id^="tab_"][style*="display: block"] div[id$="_results"] .thumbnail-item > img');
+ const galleryPreviews = gradioApp().querySelectorAll('div[id^="tab_"] div[id$="_results"] .thumbnail-item > img');
if (galleryPreviews == null) return;
diff --git a/modules/launch_utils.py b/modules/launch_utils.py
index 7e4d5a61..05488fe6 100644
--- a/modules/launch_utils.py
+++ b/modules/launch_utils.py
@@ -228,7 +228,9 @@ def run_extension_installer(extension_dir):
env = os.environ.copy()
env['PYTHONPATH'] = f"{os.path.abspath('.')}{os.pathsep}{env.get('PYTHONPATH', '')}"
- print(run(f'"{python}" "{path_installer}"', errdesc=f"Error running install.py for extension {extension_dir}", custom_env=env))
+ stdout = run(f'"{python}" "{path_installer}"', errdesc=f"Error running install.py for extension {extension_dir}", custom_env=env).strip()
+ if stdout:
+ print(stdout)
except Exception as e:
errors.report(str(e))
@@ -366,17 +368,7 @@ def prepare_environment():
startup_timer.record("install open_clip")
if (not is_installed("xformers") or args.reinstall_xformers) and args.xformers:
- if platform.system() == "Windows":
- if platform.python_version().startswith("3.10"):
- run_pip(f"install -U -I --no-deps {xformers_package}", "xformers", live=True)
- else:
- print("Installation of xformers is not supported in this version of Python.")
- print("You can also check this and build manually: https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Xformers#building-xformers-on-windows-by-duckness")
- if not is_installed("xformers"):
- exit(0)
- elif platform.system() == "Linux":
- run_pip(f"install -U -I --no-deps {xformers_package}", "xformers")
-
+ run_pip(f"install -U -I --no-deps {xformers_package}", "xformers")
startup_timer.record("install xformers")
if not is_installed("ngrok") and args.ngrok:
@@ -404,7 +396,8 @@ def prepare_environment():
run_pip(f"install -r \"{requirements_file}\"", "requirements")
startup_timer.record("install requirements")
- run_extensions_installers(settings_file=args.ui_settings_file)
+ if not args.skip_install:
+ run_extensions_installers(settings_file=args.ui_settings_file)
if args.update_check:
version_check(commit)
diff --git a/modules/script_callbacks.py b/modules/script_callbacks.py
index fab23551..c99695eb 100644
--- a/modules/script_callbacks.py
+++ b/modules/script_callbacks.py
@@ -29,12 +29,15 @@ class ImageSaveParams:
class ExtraNoiseParams:
- def __init__(self, noise, x):
+ def __init__(self, noise, x, xi):
self.noise = noise
"""Random noise generated by the seed"""
self.x = x
- """Latent image representation of the image"""
+ """Latent representation of the image"""
+
+ self.xi = xi
+ """Noisy latent representation of the image"""
class CFGDenoiserParams:
diff --git a/modules/sd_samplers_kdiffusion.py b/modules/sd_samplers_kdiffusion.py
index b9e0d577..8a8c87e0 100644
--- a/modules/sd_samplers_kdiffusion.py
+++ b/modules/sd_samplers_kdiffusion.py
@@ -148,7 +148,7 @@ class KDiffusionSampler(sd_samplers_common.Sampler):
if opts.img2img_extra_noise > 0:
p.extra_generation_params["Extra noise"] = opts.img2img_extra_noise
- extra_noise_params = ExtraNoiseParams(noise, x)
+ extra_noise_params = ExtraNoiseParams(noise, x, xi)
extra_noise_callback(extra_noise_params)
noise = extra_noise_params.noise
xi += noise * opts.img2img_extra_noise
@@ -197,7 +197,11 @@ class KDiffusionSampler(sd_samplers_common.Sampler):
sigmas = self.get_sigmas(p, steps)
- x = x * sigmas[0]
+ if opts.sgm_noise_multiplier:
+ p.extra_generation_params["SGM noise multiplier"] = True
+ x = x * torch.sqrt(1.0 + sigmas[0] ** 2.0)
+ else:
+ x = x * sigmas[0]
extra_params_kwargs = self.initialize(p)
parameters = inspect.signature(self.func).parameters
diff --git a/modules/sd_samplers_timesteps.py b/modules/sd_samplers_timesteps.py
index 7a6cbd46..b17a8f93 100644
--- a/modules/sd_samplers_timesteps.py
+++ b/modules/sd_samplers_timesteps.py
@@ -107,7 +107,7 @@ class CompVisSampler(sd_samplers_common.Sampler):
if opts.img2img_extra_noise > 0:
p.extra_generation_params["Extra noise"] = opts.img2img_extra_noise
- extra_noise_params = ExtraNoiseParams(noise, x)
+ extra_noise_params = ExtraNoiseParams(noise, x, xi)
extra_noise_callback(extra_noise_params)
noise = extra_noise_params.noise
xi += noise * opts.img2img_extra_noise * sqrt_alpha_cumprod
diff --git a/modules/shared_options.py b/modules/shared_options.py
index 0f054f47..78652ea2 100644
--- a/modules/shared_options.py
+++ b/modules/shared_options.py
@@ -309,6 +309,7 @@ options_templates.update(options_section(('sampler-params', "Sampler parameters"
'rho': OptionInfo(0.0, "rho", gr.Number, infotext='Schedule rho').info("0 = default (7 for karras, 1 for polyexponential); higher values result in a steeper noise schedule (decreases faster)"),
'eta_noise_seed_delta': OptionInfo(0, "Eta noise seed delta", gr.Number, {"precision": 0}, infotext='ENSD').info("ENSD; does not improve anything, just produces different results for ancestral samplers - only useful for reproducing images"),
'always_discard_next_to_last_sigma': OptionInfo(False, "Always discard next-to-last sigma", infotext='Discard penultimate sigma').link("PR", "https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/6044"),
+ 'sgm_noise_multiplier': OptionInfo(False, "SGM noise multiplier", infotext='SGM noise multplier').link("PR", "https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12818").info("Match initial noise to official SDXL implementation - only useful for reproducing images"),
'uni_pc_variant': OptionInfo("bh1", "UniPC variant", gr.Radio, {"choices": ["bh1", "bh2", "vary_coeff"]}, infotext='UniPC variant'),
'uni_pc_skip_type': OptionInfo("time_uniform", "UniPC skip type", gr.Radio, {"choices": ["time_uniform", "time_quadratic", "logSNR"]}, infotext='UniPC skip type'),
'uni_pc_order': OptionInfo(3, "UniPC order", gr.Slider, {"minimum": 1, "maximum": 50, "step": 1}, infotext='UniPC order').info("must be < sampling steps"),
diff --git a/modules/ui_extensions.py b/modules/ui_extensions.py
index e0138267..67a243c3 100644
--- a/modules/ui_extensions.py
+++ b/modules/ui_extensions.py
@@ -557,8 +557,12 @@ def create_ui():
msg = '"--disable-extra-extensions" was used, remove it to load all extensions again'
html = f'<span style="color: var(--primary-400);">{msg}</span>'
- info = gr.HTML(html)
- extensions_table = gr.HTML('Loading...')
+ with gr.Row():
+ info = gr.HTML(html)
+
+ with gr.Row(elem_classes="progress-container"):
+ extensions_table = gr.HTML('Loading...', elem_id="extensions_installed_html")
+
ui.load(fn=extension_table, inputs=[], outputs=[extensions_table])
apply.click(
diff --git a/modules/ui_settings.py b/modules/ui_settings.py
index 6dde4b6a..8ff9c074 100644
--- a/modules/ui_settings.py
+++ b/modules/ui_settings.py
@@ -87,7 +87,7 @@ class UiSettings:
if not opts.same_type(value, opts.data_labels[key].default):
return gr.update(visible=True), opts.dumpjson()
- if not opts.set(key, value):
+ if value is None or not opts.set(key, value):
return gr.update(value=getattr(opts, key)), opts.dumpjson()
opts.save(shared.config_filename)
diff --git a/scripts/xyz_grid.py b/scripts/xyz_grid.py
index 517d6332..939d8605 100644
--- a/scripts/xyz_grid.py
+++ b/scripts/xyz_grid.py
@@ -265,6 +265,7 @@ axis_options = [
AxisOption("Token merging ratio", float, apply_override('token_merging_ratio')),
AxisOption("Token merging ratio high-res", float, apply_override('token_merging_ratio_hr')),
AxisOption("Always discard next-to-last sigma", str, apply_override('always_discard_next_to_last_sigma', boolean=True), choices=boolean_choice(reverse=True)),
+ AxisOption("SGM noise multiplier", str, apply_override('sgm_noise_multiplier', boolean=True), choices=boolean_choice(reverse=True)),
AxisOption("Refiner checkpoint", str, apply_field('refiner_checkpoint'), format_value=format_remove_path, confirm=confirm_checkpoints_or_none, cost=1.0, choices=lambda: ['None'] + sorted(sd_models.checkpoints_list, key=str.casefold)),
AxisOption("Refiner switch at", float, apply_field('refiner_switch_at')),
AxisOption("RNG source", str, apply_override("randn_source"), choices=lambda: ["GPU", "CPU", "NV"]),
diff --git a/style.css b/style.css
index e336e79d..fb4e2f1f 100644
--- a/style.css
+++ b/style.css
@@ -517,6 +517,11 @@ table.popup-table .link{
background: #b4c0cc;
border-radius: 3px !important;
top: -20px;
+ width: 100%;
+}
+
+.progress-container{
+ position: relative;
}
[id$=_results].mobile{
@@ -621,6 +626,9 @@ table.popup-table .link{
.modalControls {
display: flex;
+ position: absolute;
+ right: 0px;
+ left: 0px;
gap: 1em;
padding: 1em;
background-color:rgba(0,0,0,0);
@@ -660,13 +668,6 @@ table.popup-table .link{
min-height: 0;
}
-#modalImage{
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translateX(-50%) translateY(-50%);
-}
-
.modalPrev,
.modalNext {
cursor: pointer;
@@ -1009,6 +1010,8 @@ div.block.gradio-box.edit-user-metadata {
.edit-user-metadata .file-metadata th, .edit-user-metadata .file-metadata td{
padding: 0.3em 1em;
+ overflow-wrap: anywhere;
+ word-break: break-word;
}
.edit-user-metadata .wrap.translucent{