Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
png -> jpeg
Browse files- app.py +1 -1
- share_btn.py +2 -2
app.py
CHANGED
@@ -59,7 +59,7 @@ def infer(prompt):
|
|
59 |
payload = {'prompt': prompt}
|
60 |
images_request = requests.post(url, json = payload)
|
61 |
for image in images_request.json()["images"]:
|
62 |
-
image_b64 = (f"data:image/
|
63 |
images.append(image_b64)
|
64 |
|
65 |
return images
|
|
|
59 |
payload = {'prompt': prompt}
|
60 |
images_request = requests.post(url, json = payload)
|
61 |
for image in images_request.json()["images"]:
|
62 |
+
image_b64 = (f"data:image/jpeg;base64,{image}")
|
63 |
images.append(image_b64)
|
64 |
|
65 |
return images
|
share_btn.py
CHANGED
@@ -43,8 +43,8 @@ share_js = """async () => {
|
|
43 |
const res = await fetch(imgEl.src);
|
44 |
const blob = await res.blob();
|
45 |
const imgId = Date.now() % 200;
|
46 |
-
const fileName = `diffuse-the-rest-${{imgId}}.
|
47 |
-
return new File([blob], fileName, { type: 'image/
|
48 |
})
|
49 |
);
|
50 |
|
|
|
43 |
const res = await fetch(imgEl.src);
|
44 |
const blob = await res.blob();
|
45 |
const imgId = Date.now() % 200;
|
46 |
+
const fileName = `diffuse-the-rest-${{imgId}}.jpg`;
|
47 |
+
return new File([blob], fileName, { type: 'image/jpeg' });
|
48 |
})
|
49 |
);
|
50 |
|