webui plugin: check empty str
This commit is contained in:
parent
552ddb4a3d
commit
4ae2e1766e
|
@ -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`, {
|
||||
|
|
|
@ -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),
|
||||
|
|
Loading…
Reference in New Issue