Fit FLUX hot swap within 16 GiB VRAM
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user