Allow configuration of steps, default to a1111 default

This commit is contained in:
Justin Firth 2024-02-24 10:44:08 -05:00
parent 261a53c8b1
commit 3fa79e59bf
3 changed files with 82 additions and 1 deletions

View file

@ -12,7 +12,8 @@
toggleImageGenerationEnabledStatus,
updateAUTOMATIC1111Url,
updateDefaultDiffusionModel,
updateImageSize
updateImageSize,
updateImageSteps
} from '$lib/apis/images';
import { getBackendConfig } from '$lib/apis';
const dispatch = createEventDispatcher();
@ -28,6 +29,7 @@
let models = [];
let imageSize = '';
let steps = 50;
const getModels = async () => {
models = await getDiffusionModels(localStorage.token).catch((error) => {
@ -98,6 +100,10 @@
toast.error(error);
return null;
});
await updateImageSteps(localStorage.token, steps).catch((error) => {
toast.error(error);
return null;
});
dispatch('save');
loading = false;
@ -210,6 +216,19 @@
</div>
</div>
</div>
<div>
<div class=" mb-2.5 text-sm font-medium">Set Steps</div>
<div class="flex w-full">
<div class="flex-1 mr-2">
<input
class="w-full rounded py-2 px-4 text-sm dark:text-gray-300 dark:bg-gray-800 outline-none"
placeholder="Enter Number of Steps (e.g. 50)"
bind:value={steps}
/>
</div>
</div>
</div>
{/if}
</div>