Skip to content

Commit

Permalink
Merge pull request #76 from jtydhr88/webui-plugin-bug-fix
Browse files Browse the repository at this point in the history
webui plugin bug fix - check empty str
  • Loading branch information
KAJdev committed Jun 1, 2023
2 parents 552ddb4 + 4ae2e17 commit 76772d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/stablestudio-plugin-webui/src/Utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`, {
Expand Down
8 changes: 5 additions & 3 deletions packages/stablestudio-plugin-webui/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ export const createPlugin = StableStudio.createPlugin<{
| "getStableDiffusionDefaultInput"
| "getStableDiffusionExistingImages"
> => {
webuiHostUrl = webuiHostUrl ?? "http://127.0.0.1:7861";

return {
createStableDiffusionImages: async (options) => {
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit 76772d7

Please sign in to comment.