akhaliq HF staff mishig HF staff commited on
Commit
e0b92d6
1 Parent(s): cda3af8

Fix share btn img format `jpeg` -> `png` (#5)

Browse files

- Fix share btn img format `jpeg` -> `png` (f9a082fb02e7c6e28933642668e0d09b17e504e1)
- Update share_btn.py (af4843a28d34ff35ce3df3eb2246aa45c17a1dab)


Co-authored-by: Mishig Davaadorj <mishig@users.noreply.huggingface.co>

Files changed (1) hide show
  1. share_btn.py +3 -3
share_btn.py CHANGED
@@ -34,8 +34,8 @@ share_js = """async () => {
34
  const res = await fetch(imgEl.src);
35
  const blob = await res.blob();
36
  const imgId = Date.now() % 200;
37
- const fileName = `sd-inpainting-${{imgId}}.jpg`;
38
- return new File([blob], fileName, { type: 'image/jpeg' });
39
  }
40
 
41
  const gradioEl = document.querySelector('body > gradio-app');
@@ -65,7 +65,7 @@ share_js = """async () => {
65
 
66
  const urls = await Promise.all(files.map((f) => uploadFile(f)));
67
 
68
- const htmlImgs = urls.map(url => `<img src='${url}' sytle='max-width: 600px;'>`);
69
  const [inputImgUrl, outputImgUrl] = htmlImgs;
70
 
71
  const descriptionMd = `<div style='display: flex; flex-wrap: wrap; column-gap: 0.75rem;'>
 
34
  const res = await fetch(imgEl.src);
35
  const blob = await res.blob();
36
  const imgId = Date.now() % 200;
37
+ const fileName = `sd-inpainting-${{imgId}}.png`;
38
+ return new File([blob], fileName, { type: 'image/png' });
39
  }
40
 
41
  const gradioEl = document.querySelector('body > gradio-app');
 
65
 
66
  const urls = await Promise.all(files.map((f) => uploadFile(f)));
67
 
68
+ const htmlImgs = urls.map(url => `<img src='${url}' style='max-width: 450px;'>`);
69
  const [inputImgUrl, outputImgUrl] = htmlImgs;
70
 
71
  const descriptionMd = `<div style='display: flex; flex-wrap: wrap; column-gap: 0.75rem;'>