Commit 1d096ed1 authored by missionfloyd's avatar missionfloyd
Browse files

Lazy load extra network images

parent a9fed7c3
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
<div class='card' {preview_html} onclick={card_clicked}>
<div class='card' onclick={card_clicked}>
    {preview_html}
    {metadata_button}

	<div class='actions'>
		<div class='additional'>
			<ul>
+1 −1
Original line number Diff line number Diff line
@@ -131,7 +131,7 @@ class ExtraNetworksPage:
            metadata_button = f"<div class='metadata-button' title='Show metadata' onclick={metadata_onclick}></div>"

        args = {
            "preview_html": "style='background-image: url(\"" + html.escape(preview) + "\")'" if preview else '',
            "preview_html": f'<img src="{html.escape(preview)}" class="preview" loading="lazy">' if preview else '',
            "prompt": item.get("prompt", None),
            "tabname": json.dumps(tabname),
            "local_preview": json.dumps(item["local_preview"]),
+7 −0
Original line number Diff line number Diff line
@@ -1026,6 +1026,13 @@ footer {
    color: red;
}

.extra-network-cards .card .preview{
    position: absolute;
    object-fit: cover;
    width: 100%;
    height:100%;
}

[id*='_prompt_container'] > div {
	margin: 0!important;
}