From ae88eade677212234dbed28f73b23601d8946af1 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Sun, 30 Nov 2025 23:27:04 +0100 Subject: [PATCH] Improve MPS handling and add VAE slicing/tiling --- concept-maker_gui.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/concept-maker_gui.py b/concept-maker_gui.py index 4db0d4a..183034d 100644 --- a/concept-maker_gui.py +++ b/concept-maker_gui.py @@ -1907,7 +1907,8 @@ class App(TkinterDnD.Tk): # type: ignore raise RuntimeError(f"Model file not found: {model_path}") has_mps = bool(getattr(torch.backends, "mps", None) and torch.backends.mps.is_available()) device = "cuda" if torch.cuda.is_available() else "mps" if has_mps else "cpu" - dtype = torch.float16 if device in {"cuda", "mps"} else torch.float32 + # MPS often produces black outputs in float16; keep float32 there for stability + dtype = torch.float16 if device == "cuda" else torch.float32 pipe = StableDiffusionXLPipeline.from_single_file( str(model_path), torch_dtype=dtype, @@ -1924,6 +1925,11 @@ class App(TkinterDnD.Tk): # type: ignore pipe.enable_attention_slicing() except Exception: pass + try: + pipe.enable_vae_slicing() + pipe.enable_vae_tiling() + except Exception: + pass try: pipe.set_progress_bar_config(disable=True) except Exception: