Fit FLUX hot swap within 16 GiB VRAM

This commit is contained in:
Mikei386
2026-08-22 18:10:07 +02:00
parent 364ac6b83e
commit b00e882063
3 changed files with 25 additions and 4 deletions
+11 -2
View File
@@ -719,8 +719,17 @@ class _RemoteWorker:
headers["Content-Type"] = "application/json"
req = urllib.request.Request(IMAGE_WORKER_URL + path, data=body,
method=method, headers=headers)
with urllib.request.urlopen(req, timeout=timeout) as response:
return json.load(response)
try:
with urllib.request.urlopen(req, timeout=timeout) as response:
return json.load(response)
except urllib.error.HTTPError as exc:
try:
message = json.loads(exc.read(4096)).get("message")
except Exception:
message = None
raise RuntimeError(message or f"Bild-Worker HTTP {exc.code}") from exc
except (OSError, urllib.error.URLError, TimeoutError) as exc:
raise RuntimeError(f"Bild-Worker nicht erreichbar: {exc}") from exc
def start(self) -> None:
if not IMAGE_WORKER_TOKEN or len(IMAGE_WORKER_TOKEN) < 32: