Spaces:
Running
on
Zero
Running
on
Zero
再次尝试转换为png格式
Browse files- __pycache__/config.cpython-310.pyc +0 -0
- __pycache__/utils.cpython-310.pyc +0 -0
- app.py +4 -1
__pycache__/config.cpython-310.pyc
ADDED
Binary file (1.04 kB). View file
|
|
__pycache__/utils.cpython-310.pyc
ADDED
Binary file (3.78 kB). View file
|
|
app.py
CHANGED
@@ -178,8 +178,11 @@ def generate(
|
|
178 |
).images
|
179 |
out_img = images[0]
|
180 |
out_img = out_img.convert("RGB")
|
|
|
|
|
|
|
181 |
progress(1, desc="Complete")
|
182 |
-
return
|
183 |
except GenerationError as e:
|
184 |
logger.warning(f"Generation validation error: {str(e)}")
|
185 |
raise gr.Error(str(e))
|
|
|
178 |
).images
|
179 |
out_img = images[0]
|
180 |
out_img = out_img.convert("RGB")
|
181 |
+
img_io = io.BytesIO()
|
182 |
+
out_img.save(img_io, format="PNG") # 使用 PNG 格式保存
|
183 |
+
img_io.seek(0)
|
184 |
progress(1, desc="Complete")
|
185 |
+
return Image.open(img_io)
|
186 |
except GenerationError as e:
|
187 |
logger.warning(f"Generation validation error: {str(e)}")
|
188 |
raise gr.Error(str(e))
|