Mikubill / sd-webui-controlnet

WebUI extension for ControlNet
GNU General Public License v3.0
16.4k stars 1.9k forks source link

[Bug]: ControlNet OpenPose editor has bad scaling #2361

Closed tranzmatt closed 6 months ago

tranzmatt commented 6 months ago

Is there an existing issue for this?

What happened?

When attempting to open the OpenPose editor I get a badly scaled UI as attached and I'm unable to rubber-band it into something usable.

This behavior appears different setups from different machines

1) Ubuntu 20.04, current versions of Firefox and Chrome 2) Ubuntu 22.04, current versions of Firefox and Chrome

bad-openpose-ui

Steps to reproduce the problem

  1. Set an image, I had chosen 600x800
  2. Enable Openpose in Controlnet
  3. Choose your openpose (doesn't matter if it had a face or hands)
  4. Add image
  5. Select Enable and Perfect Pixel
  6. Run preprocessor
  7. Click on "edit" on resulting pose model

What should have happened?

I should see an editor UI that is properly scaled to the size of my browser window

Commit where the problem happens

vladmandic/automatic: 00281e15d2f4d50b53fa892bae4e1cfa56e7ecd6 controlnet: a43e574254d19a362082bbd412f24aeef1beed47 (but it happened eariler, not sure when)

What browsers do you use to access the UI ?

Mozilla Firefox, Google Chrome, Brave

Command Line Arguments

No

List of enabled extensions

Automatically added by vladmandic installer:

+656293e7bf4c2c462f7904dd2b5b03a244989a39 extensions-builtin/sd-extension-chainner (heads/main) +f934808698523465e7abb2d1fb0d290065def776 extensions-builtin/sd-extension-system-info (heads/main) +1d623c62fd2c1e0f6a9b46994e7735544cd27ff7 extensions-builtin/sd-webui-agent-scheduler (heads/main) +a43e574254d19a362082bbd412f24aeef1beed47 extensions-builtin/sd-webui-controlnet (heads/main) +7301877532180b621207f3580a212cf008d621ca extensions-builtin/stable-diffusion-webui-images-browser (heads/main) +7fb6a263d66c4167f386bf6f66b12f187d44505e extensions-builtin/stable-diffusion-webui-rembg (heads/master) 045515774882014cc14c1ba2668ab5bad9cbf7c0 modules/k-diffusion (v0.1.1) +2a23713f71628b2d1b88a51035b3e4ee2b5dbe46 modules/lora (v0.7.0) +3b4fb16cb127069f76dc2ae049603f8a951864d8 wiki (heads/master)

Added myself:

drwxrwxr-x 5 mclark mclark 4096 Oct 20 11:52 a1111-sd-webui-lycoris drwxrwxr-x 9 mclark mclark 4096 Dec 22 21:52 adetailer drwxrwxr-x 9 mclark mclark 4096 Dec 25 20:57 sd-webui-infinite-image-browsing drwxrwxr-x 4 mclark mclark 4096 Oct 19 12:05 sd-webui-mobile-friendly drwxrwxr-x 8 mclark mclark 4096 Dec 7 13:14 Stable-Diffusion-Webui-Civitai-Helper

Console logs

`
(vladmandic) mclark@2m7x6m3:~/Code/StableDiffusion/automatic-stable-diffusion-webui$ ./webui.sh 
Create and activate python venv
Setting OneAPI environment

:: initializing oneAPI environment ...
   webui.sh: BASH_VERSION = 5.1.16(1)-release
   args: Using "$@" for setvars.sh arguments: 
:: advisor -- latest
:: ccl -- latest
:: compiler -- latest
:: dal -- latest
:: debugger -- latest
:: dev-utilities -- latest
:: dnnl -- latest
:: dpcpp-ct -- latest
:: dpl -- latest
:: embree -- latest
:: ipp -- latest
:: ippcp -- latest
:: ispc -- latest
:: mkl -- latest
:: mpi -- latest
:: oidn -- latest
:: openpgl -- latest
:: openvkl -- latest
:: ospray -- latest
:: ospray_studio -- latest
:: rkcommon -- latest
:: rkutil -- latest
:: tbb -- latest
:: vtune -- latest
:: oneAPI environment initialized ::

Launching launch.py...
21:21:26-089234 INFO     Starting SD.Next                                                                                                                                                         
21:21:26-090938 INFO     Logger: file="/home/StableDiffusion/automatic-stable-diffusion-webui/sdnext.log" level=INFO size=2087580 mode=append                         
21:21:26-091654 INFO     Python 3.11.5 on Linux                                                                                                                                                   
21:21:26-092237 INFO     Skipping GIT operations                                                                                                                                                  
21:21:26-102415 INFO     Version: app=sd.next updated=2023-12-19 hash=00281e15 url=https://github.com/vladmandic/automatic.git/tree/master                                                        
21:21:26-104251 INFO     Platform: arch=x86_64 cpu=x86_64 system=Linux release=5.14.0-1048-oem python=3.11.5                                                                                      
21:21:26-105362 INFO     nVidia CUDA toolkit detected: nvidia-smi present                                                                                                                         
21:21:26-106314 INFO     Startup: quick launch                                                                                                                                                    
21:21:26-106843 INFO     Verifying requirements                                                                                                                                                   
21:21:26-123396 INFO     Verifying packages                                                                                                                                                       
21:21:26-124647 INFO     Extensions: disabled=[]                                                                                                                                                  
21:21:26-125144 INFO     Extensions: enabled=['stable-diffusion-webui-images-browser', 'sd-extension-chainner', 'sd-webui-agent-scheduler', 'sd-extension-system-info', 'clip-interrogator-ext',  
                         'sd-webui-controlnet', 'Lora', 'stable-diffusion-webui-rembg'] extensions-builtin                                                                                        
21:21:26-126108 INFO     Extensions: enabled=['sd-extension-system-info', 'sd-webui-infinite-image-browsing', 'sd-webui-openpose-editor', 'adetailer', 'a1111-sd-webui-lycoris'] extensions       
21:21:26-129857 INFO     Extension preload: {'extensions-builtin': 0.0, 'extensions': 0.0}                                                                                                        
21:21:26-130756 INFO     Command line args: ['--listen', '--insecure', '--skip-git'] insecure=True listen=True skip_git=True                                                                      
21:21:29-467332 INFO     Load packages: torch=2.1.0+cu121 diffusers=0.24.0 gradio=3.43.2                                                                                                          
21:21:29-703918 INFO     Engine: backend=Backend.ORIGINAL compute=cuda mode=no_grad device=cuda cross-optimization="Scaled-Dot-Product"                                                           
21:21:29-789406 INFO     Device: device=NVIDIA GeForce RTX 3080 Laptop GPU n=1 arch=sm_90 cap=(8, 6) cuda=12.1 cudnn=8902 driver=545.23.08                                                        
21:21:31-740819 INFO     Available VAEs: path="models/VAE" items=16                                                                                                                               
21:21:31-742624 INFO     Skipping conflicting extension: extensions/sd-extension-system-info                                                                                                      
21:21:31-743136 INFO     Disabling uncompatible extensions: backend=Backend.ORIGINAL []                                                                                                           
21:21:31-806902 INFO     Available models: path="models/Stable-diffusion" items=502 time=0.06                                                                                                     
21:21:32-349882 INFO     Extension: script='extensions-builtin/sd-webui-agent-scheduler/scripts/task_scheduler.py' Using sqlite file:                                                             
                         extensions-builtin/sd-webui-agent-scheduler/task_scheduler.sqlite3                                                                                                       
21:21:32-475334 INFO     Extension: script='extensions-builtin/sd-webui-controlnet/scripts/controlnet.py' Warning: ControlNet failed to load SGM - will use LDM instead.                          
21:21:32-476175 INFO     Extension: script='extensions-builtin/sd-webui-controlnet/scripts/controlnet.py' ControlNet preprocessor location:                                                       
                         /home/StableDiffusion/automatic-stable-diffusion-webui/extensions-builtin/sd-webui-controlnet/annotator/downloads                            
21:21:32-479795 INFO     Extension: script='extensions-builtin/sd-webui-controlnet/scripts/hook.py' Warning: ControlNet failed to load SGM - will use LDM instead.                                
21:21:33-544438 INFO     Extension: script='extensions/adetailer/scripts/!adetailer.py' [-] ADetailer initialized. version: 23.11.1, num models: 16                                               
21:21:33-580448 INFO     Extensions time: 1.68 { clip-interrogator-ext=0.19 Lora=0.06 sd-webui-agent-scheduler=0.17 sd-webui-controlnet=0.13 stable-diffusion-webui-rembg=0.46 adetailer=0.56 }   
21:21:33-712938 INFO     Load UI theme: name="black-teal" style=Dark base=sdnext.css                                                                                                              
21:21:35-211355 INFO     Extra network thumbnails: embedding created=1                                                                                                                            
21:21:35-637939 INFO     Extra network thumbnails: lora created=3                                                                                                                                 
21:21:36-659793 INFO     Local URL: http://localhost:7860/                                                                                                                                        
21:21:36-660537 INFO     Initializing middleware                                                                                                                                                  
21:21:36-793432 INFO     [AgentScheduler] Task queue is empty                                                                                                                                     
21:21:36-794135 INFO     [AgentScheduler] Registering APIs                                                                                                                                        
21:21:37-018316 INFO     Model metadata saved: file="metadata.json" items=21 time=0.03                                                                                                            
21:21:37-019504 INFO     Startup time: 10.86 { torch=2.83 gradio=0.46 libraries=2.27 extensions=1.68 models=0.06 face-restore=0.09 ui-extra-networks=1.63 ui-txt2img=0.06 ui-img2img=0.08         
                         ui-settings=0.12 ui-extensions=0.36 ui-defaults=0.06 launch=0.70 api=0.08 app-started=0.15 checkpoint=0.13 }                                                             
22:12:19-540274 INFO     MOTD: N/A                                                                                                                                                                
22:12:46-007700 INFO     Browser session: user=None client=192.168.50.109 agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36   
22:14:21-669256 INFO     Select: model="photon_v1 [ec41bd2a82]"                                                                                                                                   
Loading model: /home/StableDiffusion/automatic-stable-diffusion-webui/models/Stable-diffusion/photon_v1.safetensors ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0.0/2.1 GB -:--:--22:14:21-761885 INFO     Setting Torch parameters: device=cuda dtype=torch.float16 vae=torch.float16 unet=torch.float16 context=no_grad fp16=True bf16=False                                      
22:14:26-980055 INFO     LDM: LatentDiffusion: mode=eps                                                                                                                                           
22:14:26-980873 INFO     LDM: DiffusionWrapper params=859.52M                                                                                                                                     
22:14:26-981539 INFO     Autodetect: model="Stable Diffusion" class=StableDiffusionPipeline                                                                                                       
                         file="/home/StableDiffusion/automatic-stable-diffusion-webui/models/Stable-diffusion/photon_v1.safetensors" size=2034MB                      
Loading model: models/VAE/vae-ft-mse-840000-ema-pruned.ckpt ━━━━━━━━━━━━━━━━━━━━━━━━━╺━━━━━━━━━━━━━━ 210.6/334.7 MB 0:00:00
22:14:27-956692 INFO     Cross-attention: optimization=Scaled-Dot-Product options=[]                                                                                                              
22:14:28-300669 INFO     Load embeddings: loaded=288 skipped=1 time=0.34                                                                                                                          
22:14:28-305131 INFO     Model loaded in 6.63 { load=0.05 create=5.21 apply=0.31 vae=0.38 move=0.28 embeddings=0.34 }                                                                             
22:14:28-657315 INFO     Model load finished: {'ram': {'used': 6.43, 'total': 62.1}, 'gpu': {'used': 2.42, 'total': 15.73}, 'retries': 0, 'oom': 0} cached=0                          
`

Additional information

No response

huchenlei commented 6 months ago

Please discuss in this SDNext thread: https://github.com/vladmandic/automatic/issues/2594.