Spaces:
Running
on
A10G
Running
on
A10G
Commit
•
0f5e0cd
1
Parent(s):
3522486
Updated share button
Browse files- share_btn.py +3 -2
share_btn.py
CHANGED
@@ -42,7 +42,7 @@ share_js = """async () => {
|
|
42 |
// const gradioEl = document.querySelector("gradio-app").shadowRoot;
|
43 |
const inputImgCanvas = gradioEl.querySelector('canvas[key="drawing"]');
|
44 |
const outputImgEl = gradioEl.querySelector('#output-img img');
|
45 |
-
const promptTxt = gradioEl.querySelector('#
|
46 |
let titleTxt = promptTxt;
|
47 |
if(titleTxt.length > 100){
|
48 |
titleTxt = titleTxt.slice(0, 100) + ' ...';
|
@@ -85,7 +85,8 @@ ${outputImgUrl}
|
|
85 |
});
|
86 |
|
87 |
const paramsStr = params.toString();
|
88 |
-
|
|
|
89 |
|
90 |
shareBtnEl.style.removeProperty('pointer-events');
|
91 |
shareIconEl.style.removeProperty('display');
|
|
|
42 |
// const gradioEl = document.querySelector("gradio-app").shadowRoot;
|
43 |
const inputImgCanvas = gradioEl.querySelector('canvas[key="drawing"]');
|
44 |
const outputImgEl = gradioEl.querySelector('#output-img img');
|
45 |
+
const promptTxt = gradioEl.querySelector('#prompt textarea').value;
|
46 |
let titleTxt = promptTxt;
|
47 |
if(titleTxt.length > 100){
|
48 |
titleTxt = titleTxt.slice(0, 100) + ' ...';
|
|
|
85 |
});
|
86 |
|
87 |
const paramsStr = params.toString();
|
88 |
+
|
89 |
+
window.open(`https://huggingface.co/spaces/diffusers/stable-diffusion-xl-inpainting/discussions/new?${paramsStr}&preview=true`, '_blank');
|
90 |
|
91 |
shareBtnEl.style.removeProperty('pointer-events');
|
92 |
shareIconEl.style.removeProperty('display');
|