Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can the extension function without the web UI? #47

Closed
Linaqruf opened this issue Apr 24, 2023 · 22 comments
Closed

Can the extension function without the web UI? #47

Linaqruf opened this issue Apr 24, 2023 · 22 comments

Comments

@Linaqruf
Copy link

Hi, great job on the extension! I just wanted to know if this extension can run separately and independently from the web UI, like ImJoy_Elfinder or FiftyOne? Thanks!

@zanllp
Copy link
Owner

zanllp commented Apr 25, 2023

Of course it is supported, and almost all functions can be used normally.

git clone https://github.com/zanllp/sd-webui-infinite-image-browsing.git
cd sd-webui-infinite-image-browsing
pip install -r requirements.txt
python app.py --port=7888 --sd_webui_config="your sd_webui config path"

You can also add target folder in IIB instead of passing it as a startup parameter. This method is more recommended for non-SD WebUI users. For detailed instructions on how to use it, please refer to the following link.
#202 (comment)

sd_webui_config

sd_webui_config is optional and is used to help the plugin know which folders to scan.

You can pass the config.json file located in the sd-webui root directory directly (for example C:\Users\zanllp\Desktop\stable-diffusion-webui\config.json.).

You can also pass partial parameters, like this:

{
    "outdir_txt2img_samples": "C:\\Users\\zanllp\\Desktop\\sd-remote-save\\txt2img-images",
    "outdir_img2img_samples": "C:\\Users\\zanllp\\Desktop\\sd-remote-save\\img2img-images",
    "outdir_extras_samples": "C:\\Users\\zanllp\\Desktop\\sd-remote-save\\extras-images",
}

Also, you can choose not to pass this parameter, but then you will need to manually open each folder, and the image search feature will not be available to you

The plugin will scan the values corresponding to these keys in the configuration file.

 "outdir_txt2img_samples",
 "outdir_img2img_samples", 
 "outdir_save",
 "outdir_extras_samples",
 "outdir_grids",
 "outdir_img2img_grids",
 "outdir_samples",
 "outdir_txt2img_grids",

!!! Note that if these paths are relative paths, they will be expanded to absolute paths relative to the current working directory, and once the expanded paths are not correct, they will be ignored. You can solve this problem by changing these paths to absolute paths. You can also solve this problem by adding the parameter --sd_webui_path_relative_to_config.

@zanllp zanllp pinned this issue Apr 25, 2023
@Linaqruf
Copy link
Author

Awesome, thankyou! It works.
image

@k0ala991
Copy link

Standalone mode is very cool! Love being able to specify a custom json.

In addition to the instructions above, I also needed to pip install pillow

@zanllp
Copy link
Owner

zanllp commented May 27, 2023

Standalone mode is very cool! Love being able to specify a custom json.

In addition to the instructions above, I also needed to pip install pillow

The issue indeed exists if Pillow is not installed, but since it is widely used, I did not include it in requirements.txt. I will add it later.

@Loli-Kyn
Copy link

How did you do it?
Скриншот 18-06-2023 224246

Awesome, thankyou! It works. image

@WSH032
Copy link
Contributor

WSH032 commented Jun 19, 2023

How did you do it? Скриншот 18-06-2023 224246

@Loli-Kyn
First, if you want to use shell in Jupyter, use !git instead of git

So, the code is

!git clone https://github.com/zanllp/sd-webui-infinite-image-browsing.git
%cd sd-webui-infinite-image-browsing
!pip install -r requirements.txt
!python app.py --port=7888 --sd_webui_config="your sd_webui config path"

Second, when using on Colab, you need output.serve_kernel_port_as_iframe(7888) to show the content, like what linaqruf do

@Loli-Kyn
Copy link

@WSH032

how do I start the diffusion itself then. After all, in colab the commands are executed sequentially, not all at once
Скриншот 19-06-2023 211506

@WSH032
Copy link
Contributor

WSH032 commented Jun 19, 2023

@WSH032

how do I start the diffusion itself then. After all, in colab the commands are executed sequentially, not all at once Скриншот 19-06-2023 211506

@Loli-Kyn
refer to #250 (comment)

You can use multi-thread

from google.colab.output import serve_kernel_port_as_iframe, serve_kernel_port_as_window
from threading import Thread

!git clone https://github.com/zanllp/sd-webui-infinite-image-browsing.git
%cd sd-webui-infinite-image-browsing
!pip install -r requirements.txt

port = 7888  # your port
config_file = "your sd_webui config path"

def run_app():
    !python app.py --port={port} --sd_webui_config={config_file}

thread = Thread(target=run_app)
thread.start()
serve_kernel_port_as_iframe(port)

# thread.join()  # if you want execute synchronously

@Loli-Kyn
Copy link

@WSH032
Multithreading doesn't work
Yes, I saw comment #250.
I tried running it, but it doesn't show my pictures. It needs to be set up, but I don't know how. I tried connecting to google drive, but there are no folders in colab, so I don't know why...
I think it would be easier for me to figure out how multithreading works.
Скриншот 20-06-2023 021857

@WSH032
Copy link
Contributor

WSH032 commented Jun 20, 2023

@Loli-Kyn
The issus we are discussing now is about jupyter notebook using.
I guess it is not appropriate to discuss it here, because here is about Standalone Operation issue

I will continue to discuss in #250

@pto2k
Copy link

pto2k commented Jul 17, 2023

Hello,
I followed these steps to setup the standalone version.

git clone https://github.com/zanllp/sd-webui-infinite-image-browsing.git
cd sd-webui-infinite-image-browsing
pip install -r requirements.txt

but I met the black page when open it in browser

It seems to have failed to load. You can try refreshing the page.
If that doesn't work, click on FAQ for help

My CMD output:

d:\Repo\sd-webui-infinite-image-browsing>python app.py --port=7888 --extra_paths d:\Repo\stable-diffusion-webui\extensions\OneButtonPrompt\automated_outputs\txt2img
←[32mINFO←[0m: Started server process [←[36m3604←[0m]
←[32mINFO←[0m: Waiting for application startup.
←[32mINFO←[0m: Application startup complete.
←[32mINFO←[0m: Uvicorn running on ←[1mhttp://127.0.0.1:7888←[0m (Press CTRL+C to quit)
←[32mINFO←[0m: 127.0.0.1:8609 - "←[1mGET / HTTP/1.1←[0m" ←[32m200 OK←[0m
←[32mINFO←[0m: 127.0.0.1:8609 - "←[1mGET /assets/index-77d97794.js HTTP/1.1←[0m" ←[32m200 OK←[0m
←[32mINFO←[0m: 127.0.0.1:8610 - "←[1mGET /assets/index-618900f2.css HTTP/1.1←[0m" ←[32m200 mK←[0
←[32mINFO←[0m: 127.0.0.1:8609 - "←[1mGET /favicon.ico HTTP/1.1←[0m" ←[31m404 Not Found←[0m

The log.log file in the app folder stays empty so nothing is there.
I did try some suggestions from the FAQ page but had no luck with them.

Any suggestions?

Thank you!

@zanllp
Copy link
Owner

zanllp commented Jul 17, 2023

Hello, I followed these steps to setup the standalone version.

git clone https://github.com/zanllp/sd-webui-infinite-image-browsing.git
cd sd-webui-infinite-image-browsing
pip install -r requirements.txt

but I met the black page when open it in browser

It seems to have failed to load. You can try refreshing the page.
If that doesn't work, click on FAQ for help

My CMD output:

d:\Repo\sd-webui-infinite-image-browsing>python app.py --port=7888 --extra_paths d:\Repo\stable-diffusion-webui\extensions\OneButtonPrompt\automated_outputs\txt2img
←[32mINFO←[0m: Started server process [←[36m3604←[0m]
←[32mINFO←[0m: Waiting for application startup.
←[32mINFO←[0m: Application startup complete.
←[32mINFO←[0m: Uvicorn running on ←[1mhttp://127.0.0.1:7888←[0m (Press CTRL+C to quit)
←[32mINFO←[0m: 127.0.0.1:8609 - "←[1mGET / HTTP/1.1←[0m" ←[32m200 OK←[0m
←[32mINFO←[0m: 127.0.0.1:8609 - "←[1mGET /assets/index-77d97794.js HTTP/1.1←[0m" ←[32m200 OK←[0m
←[32mINFO←[0m: 127.0.0.1:8610 - "←[1mGET /assets/index-618900f2.css HTTP/1.1←[0m" ←[32m200 mK←[0
←[32mINFO←[0m: 127.0.0.1:8609 - "←[1mGET /favicon.ico HTTP/1.1←[0m" ←[31m404 Not Found←[0m

The log.log file in the app folder stays empty so nothing is there. I did try some suggestions from the FAQ page but had no luck with them.

Any suggestions?

Thank you!

Can you please refer to the image below and open the browser's console to see if there are any error messages?

image

@pto2k
Copy link

pto2k commented Jul 17, 2023

Hello~
I found 2 errors in the console... Does it help to locate the cause? Thanks!

Snipaste_2023-07-17_20-15-21

@zanllp
Copy link
Owner

zanllp commented Jul 17, 2023

Hello~ I found 2 errors in the console... Does it help to locate the cause? Thanks!

Snipaste_2023-07-17_20-15-21
image Can you try click 'disable cache', then refreshing the page and see if the problem still occurs? image

@pto2k
Copy link

pto2k commented Jul 17, 2023

Hi,
I tried disable that but it did not help.
I also tried loading it in another fresh browser Firefox and had same issue.

IIB inside A1111 web ui works fine.

@zanllp
Copy link
Owner

zanllp commented Jul 18, 2023

@pto2k

A strange error, perhaps due to dependency version issue. You could try using venv to see if it helps.

git clone https://github.com/zanllp/sd-webui-infinite-image-browsing.git
cd sd-webui-infinite-image-browsing
python -m venv venv
venv\Scripts\activate.bat # or venv/bin/Activate.ps1 , source venv/bin/activate ...  
pip install -r requirements.txt
python app.py --port=7888 --sd_webui_config="your sd_webui config path"

If all else fails, you can try using the desktop app version of IIB. https://github.com/zanllp/sd-webui-infinite-image-browsing/releases/tag/v0.2.0

@pto2k
Copy link

pto2k commented Jul 18, 2023

Hello, @zanllp

Thank you for the suggestions. This is strange indeed.

So I tried to setup venv, from clean folders, at both office and home. But it still has same error as before
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec.

I also tried the desktop version, but it triggered virus warning for some reason.

  • At office (Win10) I was able to download but after installation, a warning was triggered from Symantec.
IIB_Symantec
  • At home (Win11), the download was directly blocked in Chrome saying "Virus detected".

Is this a known issue?

Thanks

@zanllp
Copy link
Owner

zanllp commented Jul 18, 2023

@pto2k
Yes, it is true that some antivirus software may identify the sidecar of iib as a virus, but this is a false positive and can be ignored. You can refer to Nuitka/Nuitka#2081 for more information.

@ore-
Copy link

ore- commented Jul 25, 2023

@pto2k I had the same issue. worked for me after updating windows registry per - https://stackoverflow.com/questions/64013643/failed-to-load-module-script-the-server-responded-with-a-non-javascript-mime-ty

@pto2k
Copy link

pto2k commented Jul 25, 2023

@ore- Thank you very much! That works.

@kernel55
Copy link

where is the --listen,I learned to call the server all the way.

@Fone520
Copy link

Fone520 commented Nov 10, 2023

Awesome, thankyou! It works. image

Can jupyter lab do this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants