mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Fix background URI encoding
This commit is contained in:
@ -897,7 +897,7 @@ async function generatePicture(_, trigger, message, callback) {
|
|||||||
const callbackOriginal = callback;
|
const callbackOriginal = callback;
|
||||||
callback = async function (prompt, base64Image) {
|
callback = async function (prompt, base64Image) {
|
||||||
const imagePath = base64Image;
|
const imagePath = base64Image;
|
||||||
const imgUrl = `url('${encodeURIComponent(base64Image)}')`;
|
const imgUrl = `url("${encodeURI(base64Image)}")`;
|
||||||
|
|
||||||
if (typeof window['forceSetBackground'] === 'function') {
|
if (typeof window['forceSetBackground'] === 'function') {
|
||||||
window['forceSetBackground'](imgUrl);
|
window['forceSetBackground'](imgUrl);
|
||||||
|
@ -4764,6 +4764,8 @@ app.post('/api/sd/set-model', jsonParser, async (request, response) => {
|
|||||||
|
|
||||||
app.post('/api/sd/generate', jsonParser, async (request, response) => {
|
app.post('/api/sd/generate', jsonParser, async (request, response) => {
|
||||||
try {
|
try {
|
||||||
|
console.log('SD WebUI request:', request.body);
|
||||||
|
|
||||||
const url = new URL(request.body.url);
|
const url = new URL(request.body.url);
|
||||||
url.pathname = '/sdapi/v1/txt2img';
|
url.pathname = '/sdapi/v1/txt2img';
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user