From 2823793a97ac74ed15aaa127bf56d70a95ebb155 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 28 Jun 2026 05:45:19 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- studio/backend/core/inference/sd_cpp_backend.py | 7 ++++++- studio/backend/routes/inference.py | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/studio/backend/core/inference/sd_cpp_backend.py b/studio/backend/core/inference/sd_cpp_backend.py index 3fbad30571..f82335e385 100644 --- a/studio/backend/core/inference/sd_cpp_backend.py +++ b/studio/backend/core/inference/sd_cpp_backend.py @@ -497,7 +497,12 @@ class SdCppDiffusionBackend: raise RuntimeError("Diffusion generation was cancelled.") # ``seeds`` is the per-image seed (each sd-cli run used seed+index), so # the route can persist the real seed for every image in the batch. - return {"images": images, "seed": int(seed), "seeds": seeds, "repo_id": state.repo_id} + return { + "images": images, + "seed": int(seed), + "seeds": seeds, + "repo_id": state.repo_id, + } except SdCppCancelled as exc: raise RuntimeError("Diffusion generation was cancelled.") from exc finally: diff --git a/studio/backend/routes/inference.py b/studio/backend/routes/inference.py index 1363dca458..15c46d4132 100644 --- a/studio/backend/routes/inference.py +++ b/studio/backend/routes/inference.py @@ -10148,7 +10148,11 @@ async def generate_diffusion_image( def _persist() -> list[dict]: records = [] for index, image in enumerate(result["images"]): - seed = per_image_seeds[index] if per_image_seeds and index < len(per_image_seeds) else result["seed"] + seed = ( + per_image_seeds[index] + if per_image_seeds and index < len(per_image_seeds) + else result["seed"] + ) records.append( image_gallery.save( image,