Spaces:
Running on Zero
Running on Zero
Commit ·
d77e97b
1
Parent(s): 564483a
Remove image downscale in logging; log at full resolution
Browse filesCo-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
app.py
CHANGED
|
@@ -246,13 +246,9 @@ def log_inference(pil_inputs, output_pil, prompt, seed, steps, guidance_scale,
|
|
| 246 |
("error_message", pa.string()),
|
| 247 |
], metadata={b"huggingface": hf_meta})
|
| 248 |
|
| 249 |
-
def _to_jpeg(img,
|
| 250 |
if img is None:
|
| 251 |
return None
|
| 252 |
-
w, h = img.size
|
| 253 |
-
if max(w, h) > max_dim:
|
| 254 |
-
scale = max_dim / max(w, h)
|
| 255 |
-
img = img.resize((int(w * scale), int(h * scale)), LANCZOS)
|
| 256 |
buf = BytesIO()
|
| 257 |
img.convert("RGB").save(buf, format="JPEG", quality=quality)
|
| 258 |
return buf.getvalue()
|
|
|
|
| 246 |
("error_message", pa.string()),
|
| 247 |
], metadata={b"huggingface": hf_meta})
|
| 248 |
|
| 249 |
+
def _to_jpeg(img, quality=85):
|
| 250 |
if img is None:
|
| 251 |
return None
|
|
|
|
|
|
|
|
|
|
|
|
|
| 252 |
buf = BytesIO()
|
| 253 |
img.convert("RGB").save(buf, format="JPEG", quality=quality)
|
| 254 |
return buf.getvalue()
|