From 0185ef7c83548f6ffc76d6b26333b7310830e7af Mon Sep 17 00:00:00 2001
From: Marc-Andre Ferland <madrang@gmail.com>
Date: Fri, 28 Oct 2022 02:00:59 -0400
Subject: [PATCH] Apply force_full_precision if was set on device_select.

---
 ui/sd_internal/runtime.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ui/sd_internal/runtime.py b/ui/sd_internal/runtime.py
index 9e98634f..bbb71730 100644
--- a/ui/sd_internal/runtime.py
+++ b/ui/sd_internal/runtime.py
@@ -77,6 +77,8 @@ def device_select(device):
 
     thread_data.device = device
     thread_data.has_valid_gpu = True
+    # Apply force_full_precision if was set.
+    thread_data.precision = 'full' if thread_data.force_full_precision else 'autocast'
     return True
 
 def device_init(device_selection=None):