Spaces:
Running
on
Zero
Running
on
Zero
Upload dc.py
Browse files
dc.py
CHANGED
|
@@ -1172,12 +1172,13 @@ def process_style_prompt(prompt: str, neg_prompt: str, styles_key: str = "None",
|
|
| 1172 |
|
| 1173 |
def save_images(images: list[Image.Image], metadatas: list[str]):
|
| 1174 |
from PIL import PngImagePlugin
|
|
|
|
| 1175 |
try:
|
| 1176 |
output_images = []
|
| 1177 |
for image, metadata in zip(images, metadatas):
|
| 1178 |
info = PngImagePlugin.PngInfo()
|
| 1179 |
info.add_text("parameters", metadata)
|
| 1180 |
-
savefile = "
|
| 1181 |
image.save(savefile, "PNG", pnginfo=info)
|
| 1182 |
output_images.append(str(Path(savefile).resolve()))
|
| 1183 |
return output_images
|
|
|
|
| 1172 |
|
| 1173 |
def save_images(images: list[Image.Image], metadatas: list[str]):
|
| 1174 |
from PIL import PngImagePlugin
|
| 1175 |
+
import uuid
|
| 1176 |
try:
|
| 1177 |
output_images = []
|
| 1178 |
for image, metadata in zip(images, metadatas):
|
| 1179 |
info = PngImagePlugin.PngInfo()
|
| 1180 |
info.add_text("parameters", metadata)
|
| 1181 |
+
savefile = f"{str(uuid.uuid4())}.png"
|
| 1182 |
image.save(savefile, "PNG", pnginfo=info)
|
| 1183 |
output_images.append(str(Path(savefile).resolve()))
|
| 1184 |
return output_images
|