Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -125,8 +125,9 @@ def generate_image_to_image(prompt_mash, image_input_path, image_strength, steps
|
|
125 |
final_image.save(temp_file.name, "PNG")
|
126 |
|
127 |
# Convert the image to a base64 string
|
128 |
-
|
129 |
-
|
|
|
130 |
|
131 |
return final_image, temp_file.name, f"data:image/png;base64,{img_base64}"
|
132 |
|
|
|
125 |
final_image.save(temp_file.name, "PNG")
|
126 |
|
127 |
# Convert the image to a base64 string
|
128 |
+
buffered = io.BytesIO()
|
129 |
+
final_image.save(buffered, format="PNG")
|
130 |
+
img_base64 = base64.b64encode(buffered.getvalue()).decode("utf-8")
|
131 |
|
132 |
return final_image, temp_file.name, f"data:image/png;base64,{img_base64}"
|
133 |
|