mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-01-05 13:36:47 +01:00
fixed generation endpoints, added animation via gifs
This commit is contained in:
parent
b9857eb315
commit
08d5a2826f
3
public/img/blockentropy.svg
Normal file
3
public/img/blockentropy.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg id="Layer_2" data-name="Layer 2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 236.38 282.41">
|
||||
<path d="M126.55,0v54.44l-79.87,33.76v93.95l27.53-12.94,43.08,31.09.04-.05v.09l55.21-31.44.13-.08v-80.06l-55.34,24.92v80.2l-42.55-30.7h-.02s0-81.16,0-81.16l57.02-24.11V9.23l93.54,56.12v22.51l-24.34,11.53,1.84,90.56-88.45,51.47-.13.08v34.46L5.23,198.97v-65.56H0v66.92c0,.85.41,1.64,1.11,2.14l113.13,79.91v.05l.04-.02h0s0,0,0,0l121.97-73.54.13-.08v-126.13l-5.84,2.76v-22.94h-.3l.11-.18L126.55,0Z" fill="#000000"/>
|
||||
</svg>
|
After Width: | Height: | Size: 522 B |
@ -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);
|
||||
|
@ -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: {
|
||||
|
Loading…
Reference in New Issue
Block a user