webui plugin: check empty str

This commit is contained in:
jtydhr88 2023-05-31 13:55:51 -04:00
parent 552ddb4a3d
commit 4ae2e1766e
2 changed files with 6 additions and 4 deletions

View File

@ -41,7 +41,7 @@ export async function setOptions(baseUrl: string | undefined, options: any) {
}
export async function getImageInfo(
baseUrl: string | undefined,
baseUrl: string | null,
base64image: any
) {
const imageInfoResponse = await fetch(`${baseUrl}/sdapi/v1/png-info`, {

View File

@ -94,7 +94,6 @@ export const createPlugin = StableStudio.createPlugin<{
| "getStableDiffusionDefaultInput"
| "getStableDiffusionExistingImages"
> => {
webuiHostUrl = webuiHostUrl ?? "http://127.0.0.1:7861";
return {
createStableDiffusionImages: async (options) => {
@ -244,8 +243,11 @@ export const createPlugin = StableStudio.createPlugin<{
};
};
const webuiHostUrl =
localStorage.getItem("webui-host-url") ?? "http://127.0.0.1:7861";
let webuiHostUrl = localStorage.getItem("webui-host-url");
if (!webuiHostUrl || webuiHostUrl === "") {
webuiHostUrl = "http://127.0.0.1:7861";
}
return {
...webuiLoad(webuiHostUrl),