Stability AI changes to models. > Engine = V2beta Image Generation > Models now shows API models. > Hidden steps, height, etc.

84b8f771072c98c8f51f9af6a9220360a71a92b0

WBlair1 <wolfgangblair1@gmail.com>

2 files changed, +24 -18Showing whitespace changes
public/scripts/extensions/stable-diffusion/index.js+23 -15
@@ -368,7 +368,7 @@ function toggleSourceControls() {
368 const source = $(this).data('sd-source').split(',');368 const source = $(this).data('sd-source').split(',');
369 $(this).toggle(source.includes(extension_settings.sd.source));369 $(this).toggle(source.includes(extension_settings.sd.source));
370 });370 });
371 const stabilityHiddenControls = $('#sd_steps, #sd_scale, #sd_sampler, #sd_scheduler, #sd_width, #sd_height, #sd_hr_upscaler, #sd_clip_skip');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 if (extension_settings.sd.source === sources.stability) {372 if (extension_settings.sd.source === sources.stability) {
373 stabilityHiddenControls.hide();373 stabilityHiddenControls.hide();
374 $('#sd_resolution').parent().hide();374 $('#sd_resolution').parent().hide();
@@ -1679,21 +1679,29 @@ async function generateStabilityImage(prompt, negativePrompt) {
1679}1679}
16801680
1681async function loadStabilityModels() {1681async 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',
1686 },
1687 {
1688 value: 'stable-image-core',
1689 text: 'Stable Image Core',
1690 },
1691 {
1692 value: 'stable-diffusion-3',
1693 text: 'Stable Diffusion 3',
1694 },
1695 ];
1696 }1685 }
1686
1687 try {
1688 const response = await fetch('/api/sd/stability/models', {
1689 method: 'GET',
1690 headers: getRequestHeaders(),
1691 });
1692
1693 if (!response.ok) {
1694 throw new Error('Failed to fetch Stability AI models');
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 }
1703}
1704
1697async function loadPollinationsModels() {1705async function loadPollinationsModels() {
1698 return [1706 return [
1699 {1707 {
public/scripts/extensions/stable-diffusion/settings.html+1 -3
@@ -207,9 +207,7 @@
207 <div class="flex1">207 <div class="flex1">
208 <label for="sd_stability_engine">Engine</label>208 <label for="sd_stability_engine">Engine</label>
209 <select id="sd_stability_engine">209 <select id="sd_stability_engine">
210 <option value="stable-image-ultra">Stable Image Ultra</option>210 <option value="v2beta">V2beta Image Generation</option>
211 <option value="stable-image-core">Stable Image Core</option>
212 <option value="stable-diffusion-3">Stable Diffusion 3</option>
213 </select>211 </select>
214 </div>212 </div>
215 <div class="flex1">213 <div class="flex1">