SD: fix runpod active model selection - only use live settings when source is comfy AND model is in catalog

e976fff1d77d7dc62c0f55ae7a841d9aeab27411

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

1 files changed, +10 -2Showing whitespace changes
public/scripts/extensions/stable-diffusion/index.js+10 -2
@@ -1772,9 +1772,17 @@ function parseRunpodFiles(text) {
17721772 */
17731773function getRunpodActiveModels() {
17741774 let config = null;
1775- if (isRunpodProxyUrl(extension_settings.sd.comfy_url)) {
1775+ // Only use live settings when the current source is actually ComfyUI AND
1776+ // its model is in the catalog. If the user is on Grok/OpenRouter but
1777+ // comfy_url points at the proxy, the fallback chain's ComfyUI presets are
1778+ // what matter, not the live source which may not even be image-gen capable.
1779+ if (extension_settings.sd.source === 'comfy' && isRunpodProxyUrl(extension_settings.sd.comfy_url)) {
1780+ const known = new Set(getRunpodCatalog().map(m => m.value));
1781+ if (known.has(extension_settings.sd.model)) {
17761782 config = extension_settings.sd;
1777- } else {
1783+ }
1784+ }
1785+ if (!config) {
17781786 const chain = Array.isArray(extension_settings.sd.settings_preset_chain) ? extension_settings.sd.settings_preset_chain : [];
17791787 config = chain.find(e => isRunpodProxyUrl(e?.preset?.comfy_url))?.preset ?? null;
17801788 }