| 1772 | 1772 | */ |
| 1773 | 1773 | function getRunpodActiveModels() { |
| 1774 | 1774 | 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)) { |
| 1776 | 1782 | config = extension_settings.sd; |
| 1777 | | - } else { |
| 1783 | + } |
| 1784 | + } |
| 1785 | + if (!config) { |
| 1778 | 1786 | const chain = Array.isArray(extension_settings.sd.settings_preset_chain) ? extension_settings.sd.settings_preset_chain : []; |
| 1779 | 1787 | config = chain.find(e => isRunpodProxyUrl(e?.preset?.comfy_url))?.preset ?? null; |
| 1780 | 1788 | } |