diff --git a/public/img/blockentropy.svg b/public/img/blockentropy.svg new file mode 100644 index 000000000..93afdd3d0 --- /dev/null +++ b/public/img/blockentropy.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/public/scripts/extensions/stable-diffusion/index.js b/public/scripts/extensions/stable-diffusion/index.js index af3516fba..cc4997f5e 100644 --- a/public/scripts/extensions/stable-diffusion/index.js +++ b/public/scripts/extensions/stable-diffusion/index.js @@ -2692,7 +2692,16 @@ async function generateBlockEntropyImage(prompt, negativePrompt, signal) { if (result.ok) { const data = await result.json(); - return { format: 'png', data: data.images[0] }; + + // Default format is 'jpg' + let format = 'jpg'; + + // Check if a format is specified in the result + if (data.format) { + format = data.format.toLowerCase(); + } + + return { format: format, data: data.images[0] }; } else { const text = await result.text(); throw new Error(text); diff --git a/src/endpoints/stable-diffusion.js b/src/endpoints/stable-diffusion.js index 30c0b1dd6..a87b1f71e 100644 --- a/src/endpoints/stable-diffusion.js +++ b/src/endpoints/stable-diffusion.js @@ -920,7 +920,7 @@ blockentropy.post('/models', jsonParser, async (request, response) => { return response.sendStatus(400); } - const modelsResponse = await fetch('https://api.blockentropy.ai/sdapi/v1/schedulers', { + const modelsResponse = await fetch('https://api.blockentropy.ai/sdapi/v1/sd-models', { method: 'GET', headers: { 'Authorization': `Bearer ${key}`, @@ -961,16 +961,13 @@ blockentropy.post('/generate', jsonParser, async (request, response) => { const result = await fetch('https://api.blockentropy.ai/sdapi/v1/txt2img', { method: 'POST', body: JSON.stringify({ - request_type: 'image-model-inference', prompt: request.body.prompt, negative_prompt: request.body.negative_prompt, - height: request.body.height, - width: request.body.width, model: request.body.model, steps: request.body.steps, - scheduler: request.body.scheduler, - n: 1, - // Limited to 10000 on playground, works fine with more. + width: request.body.width, + height: request.body.height, + // Random seed if negative. seed: request.body.seed >= 0 ? request.body.seed : Math.floor(Math.random() * 10_000_000), }), headers: {