| 1784 | } | 1784 | } |
| 1785 | if (!config) { | 1785 | if (!config) { |
| 1786 | const chain = Array.isArray(extension_settings.sd.settings_preset_chain) ? extension_settings.sd.settings_preset_chain : []; | 1786 | const chain = Array.isArray(extension_settings.sd.settings_preset_chain) ? extension_settings.sd.settings_preset_chain : []; |
| 1787 | config = chain.find(e => isRunpodProxyUrl(e?.preset?.comfy_url))?.preset ?? null; | 1787 | // Find the first ComfyUI preset in the chain, not just any preset with a matching URL |
| | 1788 | config = chain.find(e => e?.preset?.source === 'comfy' && isRunpodProxyUrl(e?.preset?.comfy_url))?.preset ?? null; |
| 1788 | } | 1789 | } |
| 1789 | if (!config) { | 1790 | if (!config) { |
| 1790 | return []; | 1791 | return []; |