Stability AI changes to models. > Engine = V2beta Image Generation > Models now shows API models. > Hidden steps, height, etc.
| @@ -368,7 +368,7 @@ function toggleSourceControls() { | ||
| 368 | 368 | const source = $(this).data('sd-source').split(','); |
| 369 | 369 | $(this).toggle(source.includes(extension_settings.sd.source)); |
| 370 | 370 | }); |
| 371 | 371 | const stabilityHiddenControls = $('#sd_steps, #sd_scale, #sd_sampler, #sd_scheduler, #sd_width, #sd_height, #sd_hr_upscaler, #sd_clip_skip, #sd_steps_value, #sd_scale_value'); |
| 372 | 372 | if (extension_settings.sd.source === sources.stability) { |
| 373 | 373 | stabilityHiddenControls.hide(); |
| 374 | 374 | $('#sd_resolution').parent().hide(); |
| @@ -1679,21 +1679,29 @@ async function generateStabilityImage(prompt, negativePrompt) { | ||
| 1679 | 1679 | } |
| 1680 | 1680 | |
| 1681 | 1681 | async function loadStabilityModels() { |
| 1682 | - return [ | |
| 1682 | + if (!extension_settings.sd.stability_key) { | |
| 1683 | - { | |
| 1683 | + console.debug('Stability API key is not set.'); | |
| 1684 | - value: 'stable-image-ultra', | |
| 1684 | + return []; | |
| 1685 | - text: 'Stable Image Ultra', | |
| 1685 | + } | |
| 1686 | - }, | |
| 1686 | + | |
| 1687 | - { | |
| 1687 | + try { | |
| 1688 | - value: 'stable-image-core', | |
| 1688 | + const response = await fetch('/api/sd/stability/models', { | |
| 1689 | 1689 | textmethod: 'Stable Image CoreGET', |
| 1690 | - }, | |
| 1690 | + headers: getRequestHeaders(), | |
| 1691 | - { | |
| 1691 | + }); | |
| 1692 | - value: 'stable-diffusion-3', | |
| 1692 | + | |
| 1693 | - text: 'Stable Diffusion 3', | |
| 1693 | + if (!response.ok) { | |
| 1694 | - }, | |
| 1694 | + throw new Error('Failed to fetch Stability AI models'); | |
| 1695 | - ]; | |
| 1695 | + } | |
| 1696 | + | |
| 1697 | + const data = await response.json(); | |
| 1698 | + return data.map(model => ({ value: model.id, text: model.name })); | |
| 1699 | + } catch (error) { | |
| 1700 | + console.error('Error fetching Stability AI models:', error); | |
| 1701 | + return []; | |
| 1702 | + } | |
| 1696 | 1703 | } |
| 1704 | + | |
| 1697 | 1705 | async function loadPollinationsModels() { |
| 1698 | 1706 | return [ |
| 1699 | 1707 | { |
| @@ -207,9 +207,7 @@ | ||
| 207 | 207 | <div class="flex1"> |
| 208 | 208 | <label for="sd_stability_engine">Engine</label> |
| 209 | 209 | <select id="sd_stability_engine"> |
| 210 | 210 | <option value="stable-image-ultrav2beta">StableV2beta Image UltraGeneration</option> |
| 211 | - <option value="stable-image-core">Stable Image Core</option> | |
| 212 | - <option value="stable-diffusion-3">Stable Diffusion 3</option> | |
| 213 | 211 | </select> |
| 214 | 212 | </div> |
| 215 | 213 | <div class="flex1"> |