Stable Diffusion: Open ComfyUI link for the running RunPod pod

08ed06d07dc083ef5a34bf0cb03276859c63ee5e

permissionBRICK <40219477+permissionBRICK@users.noreply.github.com>

2 files changed, +12 -0Ignore whitespace
public/scripts/extensions/stable-diffusion/index.js+8 -0
@@ -1479,6 +1479,14 @@ function renderRunpodStatus(status) {
14791479 const phase = status?.state ?? 'red';
14801480 dot.classList.remove('sd_runpod_red', 'sd_runpod_orange', 'sd_runpod_green');
14811481 dot.classList.add(`sd_runpod_${['red', 'orange', 'green'].includes(phase) ? phase : 'red'}`);
1482+ const openLink = document.getElementById('sd_runpod_open');
1483+ if (openLink) {
1484+ const showLink = phase === 'green' && status?.url;
1485+ openLink.style.display = showLink ? '' : 'none';
1486+ if (showLink) {
1487+ openLink.href = status.url;
1488+ }
1489+ }
14821490 if (!status) {
14831491 text.textContent = 'proxy unreachable';
14841492 } else if (phase === 'green') {
public/scripts/extensions/stable-diffusion/settings.html+4 -0
@@ -88,6 +88,10 @@
8888 <i class="fa-solid fa-power-off"></i>
8989 <span data-i18n="Shut down">Shut down</span>
9090 </div>
91+ <a id="sd_runpod_open" class="menu_button menu_button_icon" href="#" target="_blank" rel="noopener" title="Open the pod's ComfyUI web interface" data-i18n="[title]sd_runpod_open" style="display: none;">
92+ <i class="fa-solid fa-up-right-from-square"></i>
93+ <span data-i18n="Open ComfyUI">Open ComfyUI</span>
94+ </a>
9195 </div>
9296 <small data-i18n="sd_runpod_small">While a SillyTavern tab is open, a keepalive ping keeps the pod alive; it shuts down 15 minutes after the last activity either way. Red = off, orange = starting/downloading models, green = ready.</small>
9397 <hr>