update diffusers and extra networks

This commit is contained in:
Vladimir Mandic
2023-07-04 09:28:48 -04:00
parent 145b990c73
commit b216a35ddd
11 changed files with 91 additions and 31 deletions
+6 -4
View File
@@ -9,6 +9,7 @@ function setupExtraNetworksForTab(tabname) {
const refresh = gradioApp().getElementById(`${tabname}_extra_refresh`);
const description = gradioApp().getElementById(`${tabname}_description`);
const close = gradioApp().getElementById(`${tabname}_extra_close`);
const en = gradioApp().getElementById(`${tabname}_extra_networks`);
search.classList.add('search');
description.classList.add('description');
tabs.appendChild(refresh);
@@ -23,16 +24,15 @@ function setupExtraNetworksForTab(tabname) {
elem.style.display = text.indexOf(searchTerm) == -1 ? 'none' : '';
});
});
intersectionObserver = new IntersectionObserver((entries) => {
// if (entries[0].intersectionRatio <= 0) onHidden();
const en = gradioApp().getElementById(`${tabname}_extra_networks`);
if (entries[0].intersectionRatio > 0) {
for (el of Array.from(gradioApp().querySelectorAll('.extra-network-cards'))) {
const rect = el.getBoundingClientRect();
en.style.transition = 'width 0.2s ease';
if (rect.top > 0) {
if (!en) return
if (window.opts.extra_networks_card_cover == 'cover') {
en.style.transition = '';
en.style.zIndex = 9999;
en.style.position = 'absolute';
en.style.right = 'unset';
@@ -40,6 +40,7 @@ function setupExtraNetworksForTab(tabname) {
el.style.height = document.body.offsetHeight - el.getBoundingClientRect().top + 'px';
gradioApp().getElementById(`${tabname}_settings`).parentNode.style.width = 'unset'
} if (window.opts.extra_networks_card_cover == 'sidebar') {
en.style.transition = 'width 0.2s ease';
en.style.zIndex = 0;
en.style.position = 'absolute';
en.style.right = '0';
@@ -47,6 +48,7 @@ function setupExtraNetworksForTab(tabname) {
el.style.height = gradioApp().getElementById(`${tabname}_settings`).offsetHeight - 90 + 'px';
gradioApp().getElementById(`${tabname}_settings`).parentNode.style.width = 100 - 2 - window.opts.extra_networks_sidebar_width + 'vw';
} else {
en.style.transition = '';
en.style.zIndex = 0;
en.style.position = 'relative';
en.style.right = 'unset';
@@ -61,7 +63,7 @@ function setupExtraNetworksForTab(tabname) {
gradioApp().getElementById(`${tabname}_settings`).parentNode.style.width = 'unset'
}
});
intersectionObserver.observe(search); // monitor visibility of
intersectionObserver.observe(en); // monitor visibility of
}
function setupExtraNetworks() {
+1 -1
View File
@@ -542,7 +542,7 @@ table.settings-value-table td{
.extra-networks-page { display: flex }
.extra-networks .custom-button { min-width: 80px; max-width: 240px; width: 100%; background: none; justify-content: left; text-align: left; padding: 2px 8px 2px 8px; box-shadow: none; }
.extra-networks .custom-button:hover { background: var(--button-primary-background-fill) }
.extra-network-cards { display: flex; flex-wrap: wrap; height: 50vh; overflow-y: scroll; overflow-x: hidden; scroll-snap-type: y mandatory; width: -webkit-fill-available; }
.extra-network-cards { display: flex; flex-wrap: wrap; height: 50vh; overflow-y: scroll; overflow-x: hidden; width: -webkit-fill-available; }
.extra-network-cards .card { height: fit-content; margin: 0.5em; position: relative; scroll-snap-align: start; scroll-margin-top: 0; }
.extra-network-cards .card .overlay { position: absolute; bottom: 0; padding: 0.2em; z-index: 10; width: 100%; background: none; }
.extra-network-cards .card:hover .overlay { background: rgba(0, 0, 0, 0.40); }