Commit
·
d303ce7
1
Parent(s):
6ae5bb0
Fix base64 decode for guided diffusion
Browse files
app.py
CHANGED
@@ -42,13 +42,11 @@ def text2image_diffusion(text,steps_diff, images_diff, weight, clip):
|
|
42 |
results = diffusion(text, steps_diff, images_diff, weight, clip)
|
43 |
image_paths = []
|
44 |
image_arrays = []
|
45 |
-
print(results)
|
46 |
for image in results:
|
47 |
-
image_str = image
|
48 |
image_str = image_str.replace("data:image/png;base64,","")
|
49 |
decoded_bytes = base64.decodebytes(bytes(image_str, "utf-8"))
|
50 |
img = Image.open(io.BytesIO(decoded_bytes))
|
51 |
-
#image_arrays.append(numpy.asarray(img))
|
52 |
url = shortuuid.uuid()
|
53 |
temp_dir = './tmp'
|
54 |
if not os.path.exists(temp_dir):
|
|
|
42 |
results = diffusion(text, steps_diff, images_diff, weight, clip)
|
43 |
image_paths = []
|
44 |
image_arrays = []
|
|
|
45 |
for image in results:
|
46 |
+
image_str = image
|
47 |
image_str = image_str.replace("data:image/png;base64,","")
|
48 |
decoded_bytes = base64.decodebytes(bytes(image_str, "utf-8"))
|
49 |
img = Image.open(io.BytesIO(decoded_bytes))
|
|
|
50 |
url = shortuuid.uuid()
|
51 |
temp_dir = './tmp'
|
52 |
if not os.path.exists(temp_dir):
|