diff --git a/DIFFUSERS.md b/DIFFUSERS.md index 3a57dec92..bd7699f97 100644 --- a/DIFFUSERS.md +++ b/DIFFUSERS.md @@ -141,12 +141,18 @@ will need to handle in the code before we get out of alpha | pipeline | performance it/s | memory cpu/gpu | | --- | --- | --- | -| original | | | -| diffusers | 8.98 / 7.44 / 8.16 / 8.41 / 7.04 | 4.3 / 9.0 | -| diffusers with safetensors | 8.91 / 7.35 / 8.11 / 8.4 / 7.09 | 5.9 / 9.0 | -| diffusers medvram | 7.52 / 6.72 / 7.53 / 7.84 / 7.21 | 6.6 / 8.2 | -| diffusers lowvram | | | +| original | 7.99 / 7.93 / 8.83 / 9.14 / 9.2 | 6.7 / 7.2 | +| original medvram | 6.23 / 7.16 / 8.41 / 9.24 / 9.68 | 8.4 / 6.8 | +| original lowvram | | | +| diffusers | 9 / 7.4 / 8.2 / 8.4 / 7.0 | 4.3 / 9.0 | +| diffusers medvram | 7.5 / 6.7 / 7.5 / 7.8 / 7.2 | 6.6 / 8.2 | +| diffusers lowvram | 7.0 / 7.0 / 7.4 / 7.7 / 7.8 | 4.3 / 7.2 | +| diffusers with safetensors | 8.9 / 7.3 / 8.1 / 8.4 / 7.1 | 5.9 / 9.0 | Notes: - Performance is measured for batch sizes 1, 2, 4, 8 16 +- Test environment: + - nVidia RTX 3060 GPU + - Torch 2.1-nightly with CUDA 12.1 + - Cross-optimization: SDP diff --git a/modules/shared.py b/modules/shared.py index 68945b2c7..29cb28fe0 100644 --- a/modules/shared.py +++ b/modules/shared.py @@ -472,11 +472,11 @@ options_templates.update(options_section(('sampler-params', "Sampler Settings"), "show_samplers": OptionInfo(["Euler a", "UniPC", "DEIS", "DDIM", "DPM 1S", "DPM 2M", "DPM++ 2M SDE", "DPM++ 2M SDE Karras", "DPM2 Karras", "DPM++ 2M Karras"], "Show samplers in user interface", gr.CheckboxGroup, lambda: {"choices": [x.name for x in list_samplers() if x.name != "PLMS"]}), "fallback_sampler": OptionInfo("Euler a", "Secondary sampler", gr.Dropdown, lambda: {"choices": ["None"] + [x.name for x in list_samplers()]}), "force_latent_sampler": OptionInfo("None", "Force latent upscaler sampler", gr.Dropdown, lambda: {"choices": ["None"] + [x.name for x in list_samplers()]}), - "always_batch_cond_uncond": OptionInfo(False, "Disable conditional batching enabled on low memory systems"), })) if backend == Backend.ORIGINAL: options_templates.update(options_section(('sampler-params', "Sampler Settings"), { + "always_batch_cond_uncond": OptionInfo(False, "Disable conditional batching enabled on low memory systems"), "enable_quantization": OptionInfo(True, "Enable samplers quantization for sharper and cleaner results"), "eta_ancestral": OptionInfo(1.0, "Noise multiplier for ancestral samplers (eta)", gr.Slider, {"minimum": 0.0, "maximum": 1.0, "step": 0.01}), "eta_ddim": OptionInfo(0.0, "Noise multiplier for DDIM (eta)", gr.Slider, {"minimum": 0.0, "maximum": 1.0, "step": 0.01}), @@ -494,6 +494,23 @@ if backend == Backend.ORIGINAL: })) elif backend == Backend.DIFFUSERS: options_templates.update(options_section(('sampler-params', "Sampler Settings"), { + # hidden - included for compatibility only + "always_batch_cond_uncond": OptionInfo(False, "Disable conditional batching enabled on low memory systems", { "visible": False}), + "enable_quantization": OptionInfo(True, "Enable samplers quantization for sharper and cleaner results", { "visible": False}), + "eta_ancestral": OptionInfo(1.0, "Noise multiplier for ancestral samplers (eta)", gr.Slider, {"minimum": 0.0, "maximum": 1.0, "step": 0.01}, { "visible": False}), + "eta_ddim": OptionInfo(0.0, "Noise multiplier for DDIM (eta)", gr.Slider, {"minimum": 0.0, "maximum": 1.0, "step": 0.01}, { "visible": False}), + "ddim_discretize": OptionInfo('uniform', "DDIM discretize img2img", gr.Radio, {"choices": ['uniform', 'quad']}, { "visible": False}), + 's_churn': OptionInfo(0.0, "sigma churn", gr.Slider, {"minimum": 0.0, "maximum": 1.0, "step": 0.01}, { "visible": False}), + 's_min_uncond': OptionInfo(0, "sigma negative guidance minimum ", gr.Slider, {"minimum": 0.0, "maximum": 4.0, "step": 0.01}, { "visible": False}), + 's_tmin': OptionInfo(0.0, "sigma tmin", gr.Slider, {"minimum": 0.0, "maximum": 1.0, "step": 0.01}, { "visible": False}), + 's_noise': OptionInfo(1.0, "sigma noise", gr.Slider, {"minimum": 0.0, "maximum": 1.0, "step": 0.01}, { "visible": False}), + 'eta_noise_seed_delta': OptionInfo(0, "Noise seed delta (eta)", gr.Number, {"precision": 0}, { "visible": False}), + 'always_discard_next_to_last_sigma': OptionInfo(False, "Always discard next-to-last sigma", { "visible": False}), + 'uni_pc_variant': OptionInfo("bh1", "UniPC variant", gr.Radio, {"choices": ["bh1", "bh2", "vary_coeff"]}, { "visible": False}), + 'uni_pc_skip_type': OptionInfo("time_uniform", "UniPC skip type", gr.Radio, {"choices": ["time_uniform", "time_quadratic", "logSNR"]}, { "visible": False}), + 'uni_pc_order': OptionInfo(3, "UniPC order (must be < sampling steps)", gr.Slider, {"minimum": 1, "maximum": 10, "step": 1}, { "visible": False}), + 'uni_pc_lower_order_final': OptionInfo(True, "UniPC lower order final", { "visible": False}), + # diffuser specific "schedulers_prediction_type": OptionInfo("default", "Samplers override model prediction type", gr.Radio, lambda: {"choices": ['default', 'epsilon', 'sample', 'v-prediction']}), "schedulers_beta_schedule": OptionInfo("default", "Samplers override beta schedule", gr.Radio, lambda: {"choices": ['default', 'linear', 'scaled_linear', 'squaredcos_cap_v2']}), "schedulers_solver_order": OptionInfo(2, "Samplers solver order where applicable", gr.Slider, {"minimum": 1, "maximum": 5, "step": 1}),