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(
|
export async function getImageInfo(
|
||||||
baseUrl: string | undefined,
|
baseUrl: string | null,
|
||||||
base64image: any
|
base64image: any
|
||||||
) {
|
) {
|
||||||
const imageInfoResponse = await fetch(`${baseUrl}/sdapi/v1/png-info`, {
|
const imageInfoResponse = await fetch(`${baseUrl}/sdapi/v1/png-info`, {
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,6 @@ export const createPlugin = StableStudio.createPlugin<{
|
||||||
| "getStableDiffusionDefaultInput"
|
| "getStableDiffusionDefaultInput"
|
||||||
| "getStableDiffusionExistingImages"
|
| "getStableDiffusionExistingImages"
|
||||||
> => {
|
> => {
|
||||||
webuiHostUrl = webuiHostUrl ?? "http://127.0.0.1:7861";
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
createStableDiffusionImages: async (options) => {
|
createStableDiffusionImages: async (options) => {
|
||||||
|
|
@ -244,8 +243,11 @@ export const createPlugin = StableStudio.createPlugin<{
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const webuiHostUrl =
|
let webuiHostUrl = localStorage.getItem("webui-host-url");
|
||||||
localStorage.getItem("webui-host-url") ?? "http://127.0.0.1:7861";
|
|
||||||
|
if (!webuiHostUrl || webuiHostUrl === "") {
|
||||||
|
webuiHostUrl = "http://127.0.0.1:7861";
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...webuiLoad(webuiHostUrl),
|
...webuiLoad(webuiHostUrl),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue