From 7899261755c0a350987b3e983b56fe609e33684f Mon Sep 17 00:00:00 2001 From: Manuel Schmid <9307310+mashb1t@users.noreply.github.com> Date: Fri, 31 May 2024 22:24:19 +0200 Subject: [PATCH 1/4] fix: turbo scheduler loading issue (#3065) * fix: correctly load ModelPatcher * feat: do not load model at all, not needed --- ldm_patched/contrib/external_custom_sampler.py | 3 +-- modules/sample_hijack.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ldm_patched/contrib/external_custom_sampler.py b/ldm_patched/contrib/external_custom_sampler.py index 985b03a0..60d5e3bd 100644 --- a/ldm_patched/contrib/external_custom_sampler.py +++ b/ldm_patched/contrib/external_custom_sampler.py @@ -107,8 +107,7 @@ class SDTurboScheduler: def get_sigmas(self, model, steps, denoise): start_step = 10 - int(10 * denoise) timesteps = torch.flip(torch.arange(1, 11) * 100 - 1, (0,))[start_step:start_step + steps] - ldm_patched.modules.model_management.load_models_gpu([model]) - sigmas = model.model.model_sampling.sigma(timesteps) + sigmas = model.model_sampling.sigma(timesteps) sigmas = torch.cat([sigmas, sigmas.new_zeros([1])]) return (sigmas, ) diff --git a/modules/sample_hijack.py b/modules/sample_hijack.py index 4ab3cbbd..84752ede 100644 --- a/modules/sample_hijack.py +++ b/modules/sample_hijack.py @@ -175,7 +175,7 @@ def calculate_sigmas_scheduler_hacked(model, scheduler_name, steps): elif scheduler_name == "sgm_uniform": sigmas = normal_scheduler(model, steps, sgm=True) elif scheduler_name == "turbo": - sigmas = SDTurboScheduler().get_sigmas(namedtuple('Patcher', ['model'])(model=model), steps=steps, denoise=1.0)[0] + sigmas = SDTurboScheduler().get_sigmas(model=model, steps=steps, denoise=1.0)[0] elif scheduler_name == "align_your_steps": model_type = 'SDXL' if isinstance(model.latent_format, ldm_patched.modules.latent_formats.SDXL) else 'SD1' sigmas = AlignYourStepsScheduler().get_sigmas(model_type=model_type, steps=steps, denoise=1.0)[0] From 07c6c89edf34676da86310dc1749db8ce3d082af Mon Sep 17 00:00:00 2001 From: Manuel Schmid <9307310+mashb1t@users.noreply.github.com> Date: Fri, 31 May 2024 22:41:36 +0200 Subject: [PATCH 2/4] fix: chown files directly at copy (#3066) --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1172c795..820ae94a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,7 @@ RUN chown -R user:user /content WORKDIR /content USER user -COPY . /content/app +COPY --chown=user:user . /content/app RUN mv /content/app/models /content/app/models.org CMD [ "sh", "-c", "/content/entrypoint.sh ${CMDARGS}" ] From 3d43976e8e057caf0df8ec9e7846935f80f25859 Mon Sep 17 00:00:00 2001 From: Manuel Schmid <9307310+mashb1t@users.noreply.github.com> Date: Sun, 2 Jun 2024 02:13:16 +0200 Subject: [PATCH 3/4] feat: update cmd args (#3075) --- readme.md | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/readme.md b/readme.md index 0ec06f19..e79b72aa 100644 --- a/readme.md +++ b/readme.md @@ -370,25 +370,36 @@ entry_with_update.py [-h] [--listen [IP]] [--port PORT] [--web-upload-size WEB_UPLOAD_SIZE] [--hf-mirror HF_MIRROR] [--external-working-path PATH [PATH ...]] - [--output-path OUTPUT_PATH] [--temp-path TEMP_PATH] + [--output-path OUTPUT_PATH] + [--temp-path TEMP_PATH] [--cache-path CACHE_PATH] [--in-browser] - [--disable-in-browser] [--gpu-device-id DEVICE_ID] + [--disable-in-browser] + [--gpu-device-id DEVICE_ID] [--async-cuda-allocation | --disable-async-cuda-allocation] - [--disable-attention-upcast] [--all-in-fp32 | --all-in-fp16] + [--disable-attention-upcast] + [--all-in-fp32 | --all-in-fp16] [--unet-in-bf16 | --unet-in-fp16 | --unet-in-fp8-e4m3fn | --unet-in-fp8-e5m2] - [--vae-in-fp16 | --vae-in-fp32 | --vae-in-bf16] + [--vae-in-fp16 | --vae-in-fp32 | --vae-in-bf16] + [--vae-in-cpu] [--clip-in-fp8-e4m3fn | --clip-in-fp8-e5m2 | --clip-in-fp16 | --clip-in-fp32] - [--directml [DIRECTML_DEVICE]] [--disable-ipex-hijack] + [--directml [DIRECTML_DEVICE]] + [--disable-ipex-hijack] [--preview-option [none,auto,fast,taesd]] [--attention-split | --attention-quad | --attention-pytorch] [--disable-xformers] - [--always-gpu | --always-high-vram | --always-normal-vram | - --always-low-vram | --always-no-vram | --always-cpu [CPU_NUM_THREADS]] - [--always-offload-from-vram] [--disable-server-log] - [--debug-mode] [--is-windows-embedded-python] - [--disable-server-info] [--share] [--preset PRESET] - [--language LANGUAGE] [--disable-offload-from-vram] - [--theme THEME] [--disable-image-log] + [--always-gpu | --always-high-vram | --always-normal-vram | + --always-low-vram | --always-no-vram | --always-cpu [CPU_NUM_THREADS]] + [--always-offload-from-vram] + [--pytorch-deterministic] [--disable-server-log] + [--debug-mode] [--is-windows-embedded-python] + [--disable-server-info] [--multi-user] [--share] + [--preset PRESET] [--disable-preset-selection] + [--language LANGUAGE] + [--disable-offload-from-vram] [--theme THEME] + [--disable-image-log] [--disable-analytics] + [--disable-metadata] [--disable-preset-download] + [--enable-describe-uov-image] + [--always-download-new-model] ``` ## Advanced Features From ab01104d42d8f68abb9f88e79ecc600acdb02f3b Mon Sep 17 00:00:00 2001 From: Manuel Schmid <9307310+mashb1t@users.noreply.github.com> Date: Sun, 2 Jun 2024 13:40:42 +0200 Subject: [PATCH 4/4] feat: make textboxes (incl. positive prompt) resizable (#3074) * feat: make textboxes (incl. positive prompt) resizable again * wip: auto-resize positive prompt on new line dirty approach as container is hidden and 1px padding is applied for border shadow to actually work * feat: set row height to 84, exactly matching 3 lines for positive prompt eliminate need for JS to resize positive prompt onUiLoaded --- css/style.css | 24 ++++++++++++++---------- webui.py | 4 ++-- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/css/style.css b/css/style.css index 18bacaaf..6ed0f628 100644 --- a/css/style.css +++ b/css/style.css @@ -74,31 +74,35 @@ progress::after { text-align: right; width: 215px; } - -.type_row{ - height: 80px !important; +div:has(> #positive_prompt) { + border: none; } -.type_row_half{ - height: 32px !important; +#positive_prompt { + padding: 1px; + background: var(--background-fill-primary); } -.scroll-hide{ - resize: none !important; +.type_row { + height: 84px !important; } -.refresh_button{ +.type_row_half { + height: 34px !important; +} + +.refresh_button { border: none !important; background: none !important; font-size: none !important; box-shadow: none !important; } -.advanced_check_row{ +.advanced_check_row { width: 250px !important; } -.min_check{ +.min_check { min-width: min(1px, 100%) !important; } diff --git a/webui.py b/webui.py index 0dd86350..63ff6813 100644 --- a/webui.py +++ b/webui.py @@ -112,10 +112,10 @@ with shared.gradio_root: gallery = gr.Gallery(label='Gallery', show_label=False, object_fit='contain', visible=True, height=768, elem_classes=['resizable_area', 'main_view', 'final_gallery', 'image_gallery'], elem_id='final_gallery') - with gr.Row(elem_classes='type_row'): + with gr.Row(): with gr.Column(scale=17): prompt = gr.Textbox(show_label=False, placeholder="Type prompt here or paste parameters.", elem_id='positive_prompt', - container=False, autofocus=True, elem_classes='type_row', lines=1024) + autofocus=True, lines=3) default_prompt = modules.config.default_prompt if isinstance(default_prompt, str) and default_prompt != '':