Spaces:
Running
Running
yizhangliu
commited on
Commit
•
14b994d
1
Parent(s):
2d8e201
Update app.py
Browse files
app.py
CHANGED
@@ -13,7 +13,7 @@ import time
|
|
13 |
import imghdr
|
14 |
from loguru import logger
|
15 |
|
16 |
-
from share_btn import community_icon_html, loading_icon_html,
|
17 |
|
18 |
from lama_cleaner.model_manager import ModelManager
|
19 |
from lama_cleaner.schema import Config
|
@@ -249,7 +249,6 @@ start_cleaner = """async() => {
|
|
249 |
return false;
|
250 |
}
|
251 |
}
|
252 |
-
|
253 |
var gradioEl = document.querySelector('body > gradio-app').shadowRoot;
|
254 |
if (!gradioEl) {
|
255 |
gradioEl = document.querySelector('body > gradio-app');
|
@@ -285,11 +284,10 @@ start_cleaner = """async() => {
|
|
285 |
const container = gradioEl.querySelectorAll('.container')[0];
|
286 |
container.setAttribute('style', 'max-width: 100%;');
|
287 |
|
288 |
-
//image_upload.setAttribute('style', 'min-height: ' + max_height + 'px; overflow: overlay');
|
289 |
-
|
290 |
data_image.setAttribute('style', 'height: ' + max_height + 'px');
|
291 |
data_image_div.setAttribute('style', 'min-height: ' + max_height + 'px');
|
292 |
-
|
|
|
293 |
const share_btn_container = gradioEl.querySelectorAll('#share-btn-container')[0];
|
294 |
share_btn_container.setAttribute('style', 'width: 0px; height:0px;');
|
295 |
const share_btn_share_icon = gradioEl.querySelectorAll('#share-btn-share-icon')[0];
|
|
|
13 |
import imghdr
|
14 |
from loguru import logger
|
15 |
|
16 |
+
from share_btn import community_icon_html, loading_icon_html, share_js
|
17 |
|
18 |
from lama_cleaner.model_manager import ModelManager
|
19 |
from lama_cleaner.schema import Config
|
|
|
249 |
return false;
|
250 |
}
|
251 |
}
|
|
|
252 |
var gradioEl = document.querySelector('body > gradio-app').shadowRoot;
|
253 |
if (!gradioEl) {
|
254 |
gradioEl = document.querySelector('body > gradio-app');
|
|
|
284 |
const container = gradioEl.querySelectorAll('.container')[0];
|
285 |
container.setAttribute('style', 'max-width: 100%;');
|
286 |
|
|
|
|
|
287 |
data_image.setAttribute('style', 'height: ' + max_height + 'px');
|
288 |
data_image_div.setAttribute('style', 'min-height: ' + max_height + 'px');
|
289 |
+
}
|
290 |
+
if (window.location.href.indexOf('https://huggingface.co/spaces') == -1) {
|
291 |
const share_btn_container = gradioEl.querySelectorAll('#share-btn-container')[0];
|
292 |
share_btn_container.setAttribute('style', 'width: 0px; height:0px;');
|
293 |
const share_btn_share_icon = gradioEl.querySelectorAll('#share-btn-share-icon')[0];
|