Skip to content

Commit 76772d7

Browse files
authored
Merge pull request #76 from jtydhr88/webui-plugin-bug-fix
webui plugin bug fix - check empty str
2 parents 552ddb4 + 4ae2e17 commit 76772d7

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

packages/stablestudio-plugin-webui/src/Utilities.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export async function setOptions(baseUrl: string | undefined, options: any) {
4141
}
4242

4343
export async function getImageInfo(
44-
baseUrl: string | undefined,
44+
baseUrl: string | null,
4545
base64image: any
4646
) {
4747
const imageInfoResponse = await fetch(`${baseUrl}/sdapi/v1/png-info`, {

packages/stablestudio-plugin-webui/src/index.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ export const createPlugin = StableStudio.createPlugin<{
9494
| "getStableDiffusionDefaultInput"
9595
| "getStableDiffusionExistingImages"
9696
> => {
97-
webuiHostUrl = webuiHostUrl ?? "http://127.0.0.1:7861";
9897

9998
return {
10099
createStableDiffusionImages: async (options) => {
@@ -244,8 +243,11 @@ export const createPlugin = StableStudio.createPlugin<{
244243
};
245244
};
246245

247-
const webuiHostUrl =
248-
localStorage.getItem("webui-host-url") ?? "http://127.0.0.1:7861";
246+
let webuiHostUrl = localStorage.getItem("webui-host-url");
247+
248+
if (!webuiHostUrl || webuiHostUrl === "") {
249+
webuiHostUrl = "http://127.0.0.1:7861";
250+
}
249251

250252
return {
251253
...webuiLoad(webuiHostUrl),

0 commit comments

Comments
 (0)