Stability-AI / StableStudio

Community interface for generative AI
MIT License
8.79k stars 876 forks source link

Cannot load model and sampler using A1111 backend - cors issue #71

Closed harrywang closed 1 year ago

harrywang commented 1 year ago

Describe the bug Cannot load model and sampler using A1111 backend

Seems to be CORS issue but WebUI is running with --nowebui --cors-allow-origins=http://localhost:3000 (see log below).

Screenshot 2023-05-25 at 2 51 44 PM Screenshot 2023-05-25 at 2 49 44 PM
...

Launching API server with arguments: --skip-torch-cuda-test --upcast-sampling --no-half-vae --use-cpu interrogate --nowebui --cors-allow-origins=http://localhost:3000
No module 'xformers'. Proceeding without it.
Warning: caught exception 'Torch not compiled with CUDA enabled', memory monitor disabled
ControlNet v1.1.185
ControlNet v1.1.185
Loading weights [9aba26abdf] from /Users/harrywang/sandbox/stable-diffusion-webui/models/Stable-diffusion/deliberate_v2.safetensors
Startup time: 4.2s (import torch: 1.1s, import gradio: 0.8s, import ldm: 0.3s, other imports: 0.8s, load scripts: 1.2s).
INFO:     Started server process [16150]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://127.0.0.1:7861 (Press CTRL+C to quit)
Creating model from config: /Users/harrywang/sandbox/stable-diffusion-webui/configs/v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Applying cross attention optimization (InvokeAI).
Textual inversion embeddings loaded(0): 
Model loaded in 6.4s (load weights from disk: 0.2s, create model: 0.6s, apply weights to model: 3.3s, apply half(): 1.6s, move model to device: 0.6s).
harrywang commented 1 year ago

problem solved by changing --nowebui --cors-allow-origins=http://localhost:3000 to --nowebui --cors-allow-origins=http://127.0.0.1:3000

harrywang commented 1 year ago

problem solved by changing --nowebui --cors-allow-origins=http://localhost:3000 to --nowebui --cors-allow-origins=http://127.0.0.1:3000

@jtydhr88 @cruhl Please take a look at this and we may want to update the README for this?

KAJdev commented 1 year ago

this depends on where you view stablestudio in your browser, this would work if you visited via http://localhost:3000

harrywang commented 1 year ago

this depends on where you view stablestudio in your browser, this would work if you visited via http://localhost:3000

I just tried http://localhost:3000/ and it did not work. Nevermind - I got a solution anyway :).