Fix background URI encoding

This commit is contained in:
Cohee
2023-09-04 02:51:39 +03:00
parent 67c8476cdf
commit f69aa07ec1
2 changed files with 3 additions and 1 deletions

View File

@ -897,7 +897,7 @@ async function generatePicture(_, trigger, message, callback) {
const callbackOriginal = callback;
callback = async function (prompt, base64Image) {
const imagePath = base64Image;
const imgUrl = `url('${encodeURIComponent(base64Image)}')`;
const imgUrl = `url("${encodeURI(base64Image)}")`;
if (typeof window['forceSetBackground'] === 'function') {
window['forceSetBackground'](imgUrl);

View File

@ -4764,6 +4764,8 @@ app.post('/api/sd/set-model', jsonParser, async (request, response) => {
app.post('/api/sd/generate', jsonParser, async (request, response) => {
try {
console.log('SD WebUI request:', request.body);
const url = new URL(request.body.url);
url.pathname = '/sdapi/v1/txt2img';