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

@ -198,6 +198,39 @@ export const updateImageSize = async (token: string = '', size: string) => {
return res.IMAGE_SIZE;
};
export const updateImageSteps = async (token: string = '', steps: number) => {
let error = null;
const res = await fetch(`${IMAGES_API_BASE_URL}/steps/update`, {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
...(token && { authorization: `Bearer ${token}` })
},
body: JSON.stringify({ steps })
})
.then(async (res) => {
if (!res.ok) throw await res.json();
return res.json();
})
.catch((err) => {
console.log(err);
if ('detail' in err) {
error = err.detail;
} else {
error = 'Server connection failed';
}
return null;
});
if (error) {
throw error;
}
return res.IMAGE_STEPS;
};
export const getDiffusionModels = async (token: string = '') => {
let error = null;