mirror of
https://github.com/vladmandic/automatic
synced 2026-09-06 13:00:44 +02:00
update diffusers and extra networks
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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); }
|
||||
|
||||
Reference in New Issue
Block a user