Add upscale amount control to DrawThings

This commit is contained in:
Cohee
2024-05-29 02:49:13 +03:00
parent 24b6f99abf
commit 110d343eea
3 changed files with 57 additions and 1 deletions

View File

@ -676,6 +676,23 @@ drawthings.post('/get-model', jsonParser, async (request, response) => {
}
});
drawthings.post('/get-upscaler', jsonParser, async (request, response) => {
try {
const url = new URL(request.body.url);
url.pathname = '/';
const result = await fetch(url, {
method: 'GET',
});
const data = await result.json();
return response.send(data['upscaler']);
} catch (error) {
console.log(error);
return response.sendStatus(500);
}
});
drawthings.post('/generate', jsonParser, async (request, response) => {
try {
console.log('SD DrawThings API request:', request.body);