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,