vladmandic / automatic

SD.Next: Advanced Implementation of Stable Diffusion and other Diffusion-based generative image models
https://github.com/vladmandic/automatic
GNU Affero General Public License v3.0
5.61k stars 411 forks source link

[Issue]: Stuck on loading screen after server restart #2287

Closed akvyalkov closed 1 year ago

akvyalkov commented 1 year ago

Issue Description

After restarting SD and when enabled auth, I stuck on loading screen. It can be solved with Ctrl+F5. But now I have SD in a iframe so this hack doesn't work. Is there a way to force login and not to try to reuse old session after restart? Maybe clear some cache.

As a workaround: looks like if I change port with --port, it will force to use new cookies.

PS: same with --safe

Version Platform Description

No response

Relevant log output

Using VENV: X:\automatic2\venv
20:03:45-099145 INFO     Starting SD.Next
20:03:45-107147 INFO     Python 3.10.11 on Windows
20:03:45-275246 INFO     Version: app=sd.next updated=2023-10-01 hash=c6226605
                         url=https://github.com/vladmandic/automatic.git/tree/master
20:03:45-787740 INFO     Platform: arch=AMD64 cpu=AMD64 Family 23 Model 1 Stepping 1, AuthenticAMD system=Windows
                         release=Windows-10-10.0.19045-SP0 python=3.10.11
20:03:45-795742 INFO     nVidia CUDA toolkit detected
20:03:46-003528 INFO     Extensions: disabled=[]
20:03:46-006236 INFO     Extensions: enabled=['a1111-sd-webui-lycoris', 'clip-interrogator-ext', 'LDSR', 'Lora',
                         'multidiffusion-upscaler-for-automatic1111', 'ScuNET', 'sd-dynamic-thresholding',
                         'sd-extension-system-info', 'sd-webui-agent-scheduler', 'sd-webui-controlnet',
                         'stable-diffusion-webui-images-browser', 'stable-diffusion-webui-rembg', 'SwinIR']
                         extensions-builtin
20:03:46-018567 INFO     Extensions: enabled=['sd-webui-photopea-embed', 'sd-webui-roop'] extensions
20:03:46-021558 INFO     No changes detected: Quick launch active
20:03:46-023558 INFO     Verifying requirements
20:03:46-044573 INFO     Verifying packages
20:03:46-048574 INFO     Extensions: disabled=[]
20:03:46-051565 INFO     Extensions: enabled=['a1111-sd-webui-lycoris', 'clip-interrogator-ext', 'LDSR', 'Lora',
                         'multidiffusion-upscaler-for-automatic1111', 'ScuNET', 'sd-dynamic-thresholding',
                         'sd-extension-system-info', 'sd-webui-agent-scheduler', 'sd-webui-controlnet',
                         'stable-diffusion-webui-images-browser', 'stable-diffusion-webui-rembg', 'SwinIR']
                         extensions-builtin
20:03:46-063578 INFO     Extensions: enabled=['sd-webui-photopea-embed', 'sd-webui-roop'] extensions
20:03:46-077570 INFO     Extension preload: {'extensions-builtin': 0.01, 'extensions': 0.0}
20:03:46-080571 INFO     Command line args: ['--tls-selfsign', '--auth-file', 'X:\\common\\authfile.cred',
                         '--cors-regex', '.*', '--listen', '--port', '9098', '--tls-keyfile',
                         'X:\\common\\ai.mysite.com\\privkey1.pem', '--tls-certfile',
                         'X:\\common\\ai.mysite.com\\fullchain1.pem'] listen=True port=9098
                         auth_file=X:\common\authfile.cred cors_regex=.*
                         tls_keyfile=X:\common\ai.mysite.com\privkey1.pem
                         tls_certfile=X:\common\ai.mysite.com\fullchain1.pem tls_selfsign=True
20:03:57-454763 INFO     Engine: backend=Backend.ORIGINAL compute=cuda mode=no_grad device=cuda
20:03:57-529945 INFO     Device: device=NVIDIA GeForce RTX 3060 n=1 arch=compute_37 cap=(8, 6) cuda=11.8 cudnn=8700
                         driver=536.99
20:03:58-511307 INFO     Available VAEs: models\VAE items=0
20:03:58-524311 INFO     Available models: models\Stable-diffusion items=5 time=0.01s
20:04:03-074893 INFO     Extension: script='extensions-builtin\sd-webui-controlnet\scripts\controlnet.py' ControlNet
                         preprocessor location:
                         X:\automatic2\extensions-builtin\sd-webui-controlnet\annotator\downloads
20:04:05-105853 INFO     Extensions time: 6.46s { a1111-sd-webui-lycoris=2.34s clip-interrogator-ext=0.09s LDSR=0.08s
                         Lora=0.44s sd-dynamic-thresholding=0.08s sd-extension-system-info=0.15s
                         sd-webui-agent-scheduler=0.64s sd-webui-controlnet=0.58s
                         stable-diffusion-webui-images-browser=0.19s stable-diffusion-webui-rembg=1.09s SwinIR=0.09s
                         sd-webui-photopea-embed=0.08s sd-webui-roop=0.39s ScuNET=0.18s }
20:04:05-208804 INFO     Loading UI theme: name=gradio/base style=Light
20:04:05-216808 INFO     Running with TLS
20:04:05-700664 INFO     Themes: builtin=7 default=5 external=56
20:04:12-396003 INFO     Local URL: https://localhost:9098/
20:04:12-397991 INFO     Initializing middleware
20:04:12-628055 INFO     [AgentScheduler] Runner is paused
20:04:12-631045 INFO     [AgentScheduler] Registering APIs
Loading weights: X:\automatic2\models\Stable-diffusion\deliberate_v2.safetensors ------------------- 0.0/2.1 GB -:--:--
20:04:13-105164 INFO     Setting Torch parameters: device=cuda dtype=torch.float16 vae=torch.float16 unet=torch.float16
                         context=no_grad fp16=True bf16=False
20:04:13-699296 INFO     LDM: LatentDiffusion: Running in eps-prediction mode
20:04:13-702286 INFO     LDM: DiffusionWrapper has 859.52 M params.
20:04:16-778125 INFO     Cross-attention: optimization=Scaled-Dot-Product options=[]
20:04:16-822001 INFO     Loaded embeddings: loaded=0 skipped=0
20:04:16-834995 INFO     Model loaded in 4.05s { load=0.27s config=0.07s create=0.57s apply=0.94s vae=0.97s move=1.16s
                         }
20:04:17-193087 INFO     Model load finished: {'ram': {'used': 3.06, 'total': 15.93}, 'gpu': {'used': 3.05, 'total':
                         12.0}, 'retries': 0, 'oom': 0} cached=0
Loading weights: X:\automatic2\models\Stable-diffusion\deliberate_v2.safetensors ------------------- 0.0/2.1 GB -:--:--
20:04:17-628909 INFO     Setting Torch parameters: device=cuda dtype=torch.float16 vae=torch.float16 unet=torch.float16
                         context=no_grad fp16=True bf16=False
20:04:18-295183 INFO     LDM: LatentDiffusion: Running in eps-prediction mode
20:04:18-298060 INFO     LDM: DiffusionWrapper has 859.52 M params.
20:04:21-266138 INFO     Cross-attention: optimization=Scaled-Dot-Product options=[]
20:04:21-286142 INFO     Model loaded in 3.92s { load=0.26s create=0.65s apply=0.80s vae=0.95s move=1.20s }
20:04:21-611217 INFO     Model load finished: {'ram': {'used': 3.09, 'total': 15.93}, 'gpu': {'used': 5.07, 'total':
                         12.0}, 'retries': 0, 'oom': 0} cached=0
20:04:21-778605 INFO     Startup time: 35.64s { torch=8.31s gradio=1.11s diffusers=1.20s libraries=1.75s
                         extensions=6.46s codeformer=0.09s onchange=0.09s ui-txt2img=0.17s ui-img2img=0.16s
                         ui-settings=0.16s ui-extensions=2.27s ui-defaults=0.08s launch=4.27s api=0.14s
                         app-started=0.25s checkpoint=8.99s }

Backend

Original

Model

SD 1.5

Acknowledgements

vladmandic commented 1 year ago

lets be real, this is more of an advanced usage question than a product issue - please do not open issue if there is no issue with core product, this should go into discussions.

and if you're using authentication and starting sdnext in iframe, i suggest to call issue a post to /login api endpoint before opening iframe.

akvyalkov commented 1 year ago

Ok, just stumbled on this issue when updated in July, before that there was no such problem