Update image saving logic to correctly handle prompts and save the final image
This commit is contained in:
@@ -12,7 +12,6 @@ import json
|
|||||||
import math
|
import math
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import shutil
|
|
||||||
import tempfile
|
import tempfile
|
||||||
import torch
|
import torch
|
||||||
from PIL import Image, ImageDraw
|
from PIL import Image, ImageDraw
|
||||||
@@ -555,7 +554,9 @@ def generate(
|
|||||||
except Exception as e: # noqa: BLE001
|
except Exception as e: # noqa: BLE001
|
||||||
print(f"Upscaling failed ({upscale}); keeping seamless image: {e}")
|
print(f"Upscaling failed ({upscale}); keeping seamless image: {e}")
|
||||||
|
|
||||||
shutil.move(final_path, output_path)
|
with Image.open(final_path) as final_img:
|
||||||
|
final_img.load()
|
||||||
|
save_png_with_prompt(final_img, output_path, prompt)
|
||||||
try:
|
try:
|
||||||
with Image.open(output_path) as _im:
|
with Image.open(output_path) as _im:
|
||||||
print(f"→ Final image written to {output_path} [{_im.size[0]}x{_im.size[1]}]")
|
print(f"→ Final image written to {output_path} [{_im.size[0]}x{_im.size[1]}]")
|
||||||
|
|||||||
Reference in New Issue
Block a user