vladmandic / sd-extension-nudenet

NudeNet extension for SD.Next with customizable NSFW detection and auto-blur fetaures
MIT License
23 stars 5 forks source link

[BUG] - Process Tab - Folder and Batch Sub tabs broken #7

Closed xedis closed 7 months ago

xedis commented 7 months ago

When leveraged with sdnext, the Process tab throws the following error when using the Batch and Folder subtabs.

(venv) ➜  branchie git:(dev) ✗ ./webui.sh --debug  --config config-3.json --insecure --listen --docs 
Create and activate python venv
Launching launch.py...
04:21:35-624382 INFO     Starting SD.Next                                                                                                                                                                                                    
04:21:35-626781 INFO     Logger: file="/home/vlad/onemoretime/branchie/sdnext.log" level=DEBUG size=64 mode=create                                                                                                                           
04:21:35-627683 INFO     Python 3.11.6 on Linux                                                                                                                                                                                              
04:21:35-643795 INFO     Version: app=sd.next updated=2024-01-28 hash=c6f6c80d url=https://github.com/vladmandic/automatic/tree/dev                                                                                                          
04:21:35-950019 INFO     Latest published version: 2a5b98c3c6f5df4ed9d3a4a01e1da2d8ddd599ef 2024-01-29T01:01:37Z                                                                                                                             
04:21:35-952248 INFO     Platform: arch=x86_64 cpu= system=Linux release=6.7.0-arch3-1 python=3.11.6                                                                                                                                         
04:21:35-953270 DEBUG    Setting environment tuning                                                                                                                                                                                          
04:21:35-953916 DEBUG    HF cache folder: /home/vlad/.cache/huggingface/hub                                                                                                                                                                  
04:21:35-954556 DEBUG    Torch overrides: cuda=False rocm=False ipex=False diml=False openvino=False                                                                                                                                         
04:21:35-955254 DEBUG    Torch allowed: cuda=True rocm=True ipex=True diml=True openvino=True                                                                                                                                                
04:21:35-956612 INFO     nVidia CUDA toolkit detected: nvidia-smi present                                                                                                                                                                    
04:21:37-143244 DEBUG    Repository update time: Sun Jan 28 14:10:51 2024                                                                                                                                                                    
04:21:37-144365 INFO     Startup: standard                                                                                                                                                                                                   
04:21:37-145001 INFO     Verifying requirements                                                                                                                                                                                              
04:21:37-148525 INFO     Verifying packages                                                                                                                                                                                                  
04:21:37-149268 INFO     Verifying submodules                                                                                                                                                                                                
04:21:37-428461 DEBUG    Submodule: extensions-builtin/sd-extension-chainner / main                                                                                                                                                          
04:21:37-439295 DEBUG    Submodule: extensions-builtin/sd-extension-system-info / main                                                                                                                                                       
04:21:37-449170 DEBUG    Submodule: extensions-builtin/sd-webui-agent-scheduler / main                                                                                                                                                       
04:21:37-458532 DEBUG    Submodule: extensions-builtin/sd-webui-controlnet / main                                                                                                                                                            
04:21:37-472644 DEBUG    Submodule: extensions-builtin/stable-diffusion-webui-images-browser / main                                                                                                                                          
04:21:37-481513 DEBUG    Submodule: extensions-builtin/stable-diffusion-webui-rembg / master                                                                                                                                                 
04:21:37-490867 DEBUG    Submodule: modules/k-diffusion / master                                                                                                                                                                             
04:21:37-502070 DEBUG    Submodule: modules/lora / main                                                                                                                                                                                      
04:21:37-521727 DEBUG    Submodule: wiki / master                                                                                                                                                                                            
04:21:37-528401 DEBUG    Register paths                                                                                                                                                                                                      
04:21:37-569574 DEBUG    Installed packages: 308                                                                                                                                                                                             
04:21:37-570282 DEBUG    Extensions all: ['sd-extension-system-info', 'stable-diffusion-webui-rembg', 'Lora', 'sd-extension-chainner']                                                                                                       
04:21:37-570979 DEBUG    Running extension installer: /home/vlad/onemoretime/branchie/extensions-builtin/sd-extension-system-info/install.py                                                                                                 
04:21:37-730941 DEBUG    Running extension installer: /home/vlad/onemoretime/branchie/extensions-builtin/stable-diffusion-webui-rembg/install.py                                                                                             
04:21:37-968764 DEBUG    Extensions all: ['sd-webui-aspect-ratio-helper', 'sd-extension-aesthetic-scorer', 'sd-webui-supermerger', 'sd-extension-nudenet', 'a1111-sd-webui-tagcomplete', 'StyleSelectorXL',                                  
                         'deforum-for-automatic1111-webui', 'stable-diffusion-webui-wildcards', 'krita-ai-diffusion', 'sd-webui-infinite-image-browsing']                                                                                    
04:21:38-049847 DEBUG    Running extension installer: /home/vlad/onemoretime/branchie/extensions/sd-webui-supermerger/install.py                                                                                                             
04:21:40-892809 DEBUG    Running extension installer: /home/vlad/onemoretime/branchie/extensions/sd-extension-nudenet/install.py                                                                                                             
04:21:41-145718 DEBUG    Running extension installer: /home/vlad/onemoretime/branchie/extensions/sd-webui-infinite-image-browsing/install.py                                                                                                 
04:21:49-125178 INFO     Extensions enabled: ['sd-extension-system-info', 'stable-diffusion-webui-rembg', 'Lora', 'sd-extension-chainner', 'sd-webui-aspect-ratio-helper', 'sd-extension-aesthetic-scorer', 'sd-webui-supermerger',          
                         'sd-extension-nudenet', 'a1111-sd-webui-tagcomplete', 'StyleSelectorXL', 'deforum-for-automatic1111-webui', 'stable-diffusion-webui-wildcards', 'krita-ai-diffusion', 'sd-webui-infinite-image-browsing']           
04:21:49-126338 INFO     Verifying requirements                                                                                                                                                                                              
04:21:49-129599 DEBUG    Setup complete without errors: 1706530909                                                                                                                                                                           
04:21:49-131964 INFO     Extension preload: {'extensions-builtin': 0.0, 'extensions': 0.0}                                                                                                                                                   
04:21:49-132837 DEBUG    Starting module: <module 'webui' from '/home/vlad/onemoretime/branchie/webui.py'>                                                                                                                                   
04:21:49-133648 INFO     Command line args: ['--debug', '--config', 'config-3.json', '--insecure', '--listen', '--docs'] config=config-3.json insecure=True listen=True docs=True debug=True                                                 
04:21:49-134555 DEBUG    Env flags: []                                                                                                                                                                                                       
04:21:51-093034 INFO     Load packages: torch=2.1.2+cu121 diffusers=0.25.1 gradio=3.43.2                                                                                                                                                     
04:21:51-908504 DEBUG    Read: file="config-3.json" json=58 bytes=2306 time=0.000                                                                                                                                                            
04:21:51-909905 DEBUG    Unknown settings: ['arh_javascript_aspect_ratio', 'enable_styleselector_by_default', 'aesthetic_scorer_enabled', 'image_browser_debug_level']                                                                       
04:21:51-911021 INFO     Engine: backend=Backend.DIFFUSERS compute=cuda device=cuda attention="xFormers" mode=no_grad                                                                                                                        
04:21:51-943774 INFO     Device: device=NVIDIA GeForce RTX 3060 n=1 arch=sm_90 cap=(8, 6) cuda=12.1 cudnn=8902 driver=545.29.06                                                                                                              
04:21:52-566766 DEBUG    Importing LDM                                                                                                                                                                                                       
04:21:52-575701 DEBUG    Entering start sequence                                                                                                                                                                                             
04:21:52-576727 DEBUG    Initializing                                                                                                                                                                                                        
04:21:52-608574 INFO     Available VAEs: path="models/VAE" items=10                                                                                                                                                                          
04:21:52-609579 INFO     Disabled extensions: ['sd-webui-agent-scheduler', 'sd-webui-controlnet', 'stable-diffusion-webui-images-browser']                                                                                                   
04:21:52-631684 DEBUG    Scanning diffusers cache: models/Diffusers models/Diffusers items=42 time=0.00                                                                                                                                      
04:21:52-632952 DEBUG    Read: file="cache.json" json=2 bytes=15437 time=0.000                                                                                                                                                               
04:21:52-964827 DEBUG    Read: file="metadata.json" json=7864 bytes=48151637 time=0.331                                                                                                                                                      
04:21:52-967777 ERROR    Error reading metadata from: /home/vlad/onemoretime/branchie/models/Stable-diffusion/ControlNet/control-lora-recolor-rank128.safetensors [Errno 13] Permission denied:                                              
                         '/home/vlad/onemoretime/branchie/models/Stable-diffusion/ControlNet/control-lora-recolor-rank128.safetensors'                                                                                                       
04:21:52-968757 ERROR    Error reading metadata from: /home/vlad/onemoretime/branchie/models/Stable-diffusion/ControlNet/control-lora-sketch-rank128-metadata.safetensors [Errno 13] Permission denied:                                      
                         '/home/vlad/onemoretime/branchie/models/Stable-diffusion/ControlNet/control-lora-sketch-rank128-metadata.safetensors'                                                                                               
04:21:52-980026 INFO     Available models: path="models/Stable-diffusion" items=830 time=0.37                                                                                                                                                
04:21:53-002308 DEBUG    Load extensions                                                                                                                                                                                                     
04:21:53-159720 ERROR    Error reading metadata from: /home/vlad/onemoretime/branchie/models/Lora/lcm-lora-ssd-1b.safetensors [Errno 13] Permission denied: '/home/vlad/onemoretime/branchie/models/Lora/lcm-lora-ssd-1b.safetensors'        
04:21:53-160880 ERROR    Error reading metadata from: /home/vlad/onemoretime/branchie/models/Lora/lcm-lora-sdxl.safetensors [Errno 13] Permission denied: '/home/vlad/onemoretime/branchie/models/Lora/lcm-lora-sdxl.safetensors'            
04:21:53-262096 INFO     LoRA networks: available=3467 folders=129                                                                                                                                                                           
04:21:53-953388 INFO     Extension: script='extensions/a1111-sd-webui-tagcomplete/scripts/tag_autocomplete_helper.py' Tag Autocomplete: Could not locate model-keyword extension, Lora trigger word completion will be limited to those added
                         through the extra networks menu.                                                                                                                                                                                    
04:21:54-385802 INFO     Extensions init time: 1.38 img2imgalt.py=0.09 Lora=0.14 stable-diffusion-webui-rembg=0.06 a1111-sd-webui-tagcomplete=0.60 sd-webui-supermerger=0.37                                                                 
04:21:54-391287 DEBUG    Read: file="html/upscalers.json" json=4 bytes=2640 time=0.000                                                                                                                                                       
04:21:54-392138 DEBUG    Read: file="extensions-builtin/sd-extension-chainner/models.json" json=24 bytes=2693 time=0.000                                                                                                                     
04:21:54-393156 DEBUG    chaiNNer models: path="models/chaiNNer" defined=24 discovered=0 downloaded=14                                                                                                                                       
04:21:54-393977 DEBUG    Upscaler type=SwinIR folder="models/SwinIR" model="SwinIR_4x" path="models/SwinIR/SwinIR_4x.pth"                                                                                                                    
04:21:54-395129 DEBUG    Upscaler type=ESRGAN folder="models/ESRGAN" model="8x_NMKD-Superscale_150000_G" path="models/ESRGAN/8x_NMKD-Superscale_150000_G.pth"                                                                                
04:21:54-395859 DEBUG    Upscaler type=ESRGAN folder="models/ESRGAN" model="4x_NMKD-YandereNeoXL_200k" path="models/ESRGAN/4x_NMKD-YandereNeoXL_200k.pth"                                                                                    
04:21:54-396668 DEBUG    Upscaler type=ESRGAN folder="models/ESRGAN" model="4x-UltraMix_Balanced" path="models/ESRGAN/4x-UltraMix_Balanced.pth"                                                                                              
04:21:54-397355 DEBUG    Upscaler type=ESRGAN folder="models/ESRGAN" model="2x-ATLA-KORRA" path="models/ESRGAN/2x-ATLA-KORRA.pth"                                                                                                            
04:21:54-398036 DEBUG    Upscaler type=ESRGAN folder="models/ESRGAN" model="4x-AnimeSharp" path="models/ESRGAN/4x-AnimeSharp.pth"                                                                                                            
04:21:54-398689 DEBUG    Upscaler type=ESRGAN folder="models/ESRGAN" model="4x-UltraSharp" path="models/ESRGAN/4x-UltraSharp.pth"                                                                                                            
04:21:54-399358 DEBUG    Upscaler type=ESRGAN folder="models/ESRGAN" model="4xBox" path="models/ESRGAN/4xBox.pth"                                                                                                                            
04:21:54-400051 DEBUG    Upscaler type=ESRGAN folder="models/ESRGAN" model="4x_NMKD-Siax_200k" path="models/ESRGAN/4x_NMKD-Siax_200k.pth"                                                                                                    
04:21:54-400723 DEBUG    Upscaler type=ESRGAN folder="models/ESRGAN" model="4x_BigFace_v3" path="models/ESRGAN/4x_BigFace_v3.pth"                                                                                                            
04:21:54-401382 DEBUG    Upscaler type=ESRGAN folder="models/ESRGAN" model="2x_AniScale_30000" path="models/ESRGAN/2x_AniScale_30000.pth"                                                                                                    
04:21:54-402063 DEBUG    Upscaler type=ESRGAN folder="models/ESRGAN" model="4x-UltraMix_Restore" path="models/ESRGAN/4x-UltraMix_Restore.pth"                                                                                                
04:21:54-402840 DEBUG    Upscaler type=ESRGAN folder="models/ESRGAN" model="ESRGAN_4x" path="models/ESRGAN/ESRGAN_4x.pth"                                                                                                                    
04:21:54-403498 DEBUG    Upscaler type=ESRGAN folder="models/ESRGAN" model="4x_RealisticRescaler_100000_G" path="models/ESRGAN/4x_RealisticRescaler_100000_G.pth"                                                                            
04:21:54-404173 DEBUG    Upscaler type=ESRGAN folder="models/ESRGAN" model="4x-UltraMix_Smooth" path="models/ESRGAN/4x-UltraMix_Smooth.pth"                                                                                                  
04:21:54-404837 DEBUG    Upscaler type=ESRGAN folder="models/ESRGAN" model="8x_HugePaint_v1" path="models/ESRGAN/8x_HugePaint_v1.pth"                                                                                                        
04:21:54-405515 DEBUG    Upscaler type=ESRGAN folder="models/ESRGAN" model="4x_foolhardy_Remacri" path="models/ESRGAN/4x_foolhardy_Remacri.pth"                                                                                              
04:21:54-406188 DEBUG    Upscaler type=ESRGAN folder="models/ESRGAN" model="4x_Valar_v1" path="models/ESRGAN/4x_Valar_v1.pth"                                                                                                                
04:21:54-406856 DEBUG    Upscaler type=ESRGAN folder="models/ESRGAN" model="4x_NMKD-Superscale-SP_178000_G" path="models/ESRGAN/4x_NMKD-Superscale-SP_178000_G.pth"                                                                          
04:21:54-407733 DEBUG    Load upscalers: total=71 downloaded=49 user=19 time=0.02 ['None', 'Lanczos', 'Nearest', 'ChaiNNer', 'SD', 'SwinIR', 'RealESRGAN', 'SCUNet', 'LDSR', 'ESRGAN']                                                       
04:21:54-417595 DEBUG    Load styles: folder="models/styles" items=297 time=0.01                                                                                                                                                             
04:21:54-419112 DEBUG    Creating UI                                                                                                                                                                                                         
04:21:54-419751 INFO     Load UI theme: name="midnight-barbie" style=Dark base=sdnext.css                                                                                                                                                    
04:21:54-423273 DEBUG    UI initialize: txt2img                                                                                                                                                                                              
04:21:54-432554 ERROR    Extra networks error listing items: class=ExtraNetworksPageStyles tab=<modules.ui_extra_networks_styles.ExtraNetworksPageStyles object at 0x7b72a009d410> 'NoneType' object is not subscriptable                    
04:21:55-270040 DEBUG    Read: file="html/reference.json" json=32 bytes=16982 time=0.000                                                                                                                                                     
04:21:56-933464 DEBUG    Extra networks: page='model' items=862 subfolders=44 tab=txt2img folders=['models/Stable-diffusion', 'models/Diffusers', 'models/Reference'] list=1.15 thumb=0.31 desc=0.21 info=1.32 workers=4                     
04:21:56-940488 ERROR    Extra networks error listing items: class=ExtraNetworksPageStyles tab=txt2img 'NoneType' object is not subscriptable                                                                                                
04:21:56-941526 DEBUG    Extra networks: page='style' items=0 subfolders=4 tab=txt2img folders=['models/styles', 'html'] list=0.01 thumb=0.00 desc=0.00 info=0.00 workers=4                                                                  
04:21:56-952970 DEBUG    Extra networks: page='embedding' items=489 subfolders=6 tab=txt2img folders=['models/embeddings'] list=1.22 thumb=0.03 desc=0.02 info=0.43 workers=4                                                                
04:21:56-955213 DEBUG    Extra networks: page='hypernetwork' items=11 subfolders=0 tab=txt2img folders=['models/hypernetworks'] list=0.05 thumb=0.02 desc=0.02 info=0.03 workers=4                                                           
04:21:56-959975 DEBUG    Extra networks: page='vae' items=10 subfolders=3 tab=txt2img folders=['models/VAE'] list=0.05 thumb=0.04 desc=0.00 info=0.00 workers=4                                                                              
04:21:57-031224 DEBUG    Extra networks: page='lora' items=3467 subfolders=21 tab=txt2img folders=['models/Lora', 'models/LyCORIS'] list=2.47 thumb=0.56 desc=0.01 info=3.36 workers=4                                                       
04:21:57-084105 DEBUG    UI initialize: img2img                                                                                                                                                                                              
04:21:57-096515 ERROR    Extra networks error listing items: class=ExtraNetworksPageStyles tab=<modules.ui_extra_networks_styles.ExtraNetworksPageStyles object at 0x7b72a009d410> 'NoneType' object is not subscriptable                    
04:21:57-211461 DEBUG    UI initialize: control models=models/control                                                                                                                                                                        
04:21:57-250157 ERROR    Extra networks error listing items: class=ExtraNetworksPageStyles tab=<modules.ui_extra_networks_styles.ExtraNetworksPageStyles object at 0x7b72a009d410> 'NoneType' object is not subscriptable                    
04:21:57-404645 DEBUG    Read: file="ui-config.json" json=0 bytes=2 time=0.000                                                                                                                                                               
04:21:57-538271 DEBUG    Themes: builtin=11 default=5 external=55                                                                                                                                                                            
04:21:57-871369 DEBUG    Extension list: processed=320 installed=17 enabled=14 disabled=3 visible=320 hidden=0                                                                                                                               
04:21:58-375953 INFO     Local URL: http://localhost:7860/                                                                                                                                                                                   
04:21:58-376740 INFO     API Docs: http://localhost:7860/docs                                                                                                                                                                                
04:21:58-377316 INFO     API ReDocs: http://localhost:7860/redocs                                                                                                                                                                            
04:21:58-377869 DEBUG    Gradio functions: registered=1623                                                                                                                                                                                   
04:21:58-378440 INFO     Initializing middleware                                                                                                                                                                                             
04:21:58-381235 DEBUG    Creating API                                                                                                                                                                                                        
04:21:58-461695 DEBUG    SD-System-Info: benchmark data loaded: /home/vlad/onemoretime/branchie/extensions-builtin/sd-extension-system-info/scripts/benchmark-data-local.json                                                                
04:21:58-564509 DEBUG    Scripts setup: ['X/Y/Z Grid:0.009', 'Face:0.01', 'AnimateDiff:0.006']                                                                                                                                               
04:21:58-566855 DEBUG    Model metadata: file="metadata.json" no changes                                                                                                                                                                     
04:21:58-567485 DEBUG    Model auto load disabled                                                                                                                                                                                            
04:21:58-568358 DEBUG    Save: file="config-3.json" json=58 bytes=2306 time=0.000                                                                                                                                                            
04:21:58-569076 DEBUG    Unused settings: ['image_browser_debug_level']                                                                                                                                                                      
04:21:58-569783 DEBUG    Script callback init time: supermerger.py:ui_tabs=0.07 system-info.py:app_started=0.05                                                                                                                              
04:21:58-570477 INFO     Startup time: 9.43 torch=1.24 gradio=0.70 libraries=1.47 ldm=0.96 extensions=1.38 models=0.37 ui-en=2.75 ui-control=0.05 ui-settings=0.22 ui-extensions=0.27 ui-defaults=0.05 launch=0.44 api=0.08 app-started=0.11 
04:21:59-572888 DEBUG    Server: alive=True jobs=0 requests=1 uptime=8 memory=1.36/125.72 backend=Backend.DIFFUSERS state=idle                                                                                                               
Authorization required, but no authorization protocol specified

04:22:57-379397 DEBUG    Process: mode=batch inputs=4 images=4                                                                                                                                                                               
04:22:57-380538 DEBUG    Process: image=<PIL.PngImagePlugin.PngImageFile image mode=RGB size=608x1152 at 0x7B73241875D0> (0, 4, 512, 512, True, 'ESRGAN 4x-UltraMix_Balanced', 'None', 0, '', 'None', 2, True, 1, 0, 1, 0.3, 0, 0, 0.2, True,
                         True, True, 0.01, 3, ['male-penis', 'female-vagina', 'female-breast-bare', 'anus-bare'], 'none', '/home/vlad/logo1a.png', 'None', False, False, True, 240, 10, 10)                                                  
04:22:57-402045 DEBUG    Process: script=Upscale args={'upscale_mode': 0, 'upscale_by': 4, 'upscale_to_width': 512, 'upscale_to_height': 512, 'upscale_crop': True, 'upscaler_1_name': 'ESRGAN 4x-UltraMix_Balanced', 'upscaler_2_name':     
                         'None', 'upscaler_2_visibility': 0}                                                                                                                                                                                 
04:22:57-472270 INFO     Upscaler loaded: type=ESRGAN model=models/ESRGAN/4x-UltraMix_Balanced.pth                                                                                                                                           
Upscaling ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00 0:00:08
04:23:06-570169 DEBUG    Process: script=Video args={'filename': '', 'video_type': 'None', 'duration': 2, 'loop': True, 'pad': 1, 'interpolate': 0, 'scale': 1, 'change': 0.3}                                                               
04:23:06-571450 DEBUG    Process: script=GFPGAN args={'gfpgan_visibility': 0}                                                                                                                                                                
04:23:06-572117 DEBUG    Process: script=CodeFormer args={'codeformer_visibility': 0, 'codeformer_weight': 0.2}                                                                                                                              
04:23:06-572839 DEBUG    Process: script=NudeNet args={'enabled': True, 'metadata': True, 'copy': True, 'score': 0.01, 'blocks': 3, 'censor': ['male-penis', 'female-vagina', 'female-breast-bare', 'anus-bare'], 'method': 'none',          
                         'overlay': '/home/vlad/logo1a.png'}                                                                                                                                                                                 
EP Error /onnxruntime_src/onnxruntime/core/session/provider_bridge_ort.cc:1193 onnxruntime::Provider& onnxruntime::ProviderLibrary::Get() [ONNXRuntimeError] : 1 : FAIL : Failed to load library libonnxruntime_providers_tensorrt.so with error: libcublas.so.11: cannot open shared object file: No such file or directory
 when using ['TensorrtExecutionProvider', 'CUDAExecutionProvider', 'AzureExecutionProvider', 'CPUExecutionProvider']
Falling back to ['CUDAExecutionProvider', 'CPUExecutionProvider'] and retrying.
2024-01-29 04:23:06.588434904 [E:onnxruntime:Default, provider_bridge_ort.cc:1480 TryGetProviderInfo_CUDA] /onnxruntime_src/onnxruntime/core/session/provider_bridge_ort.cc:1193 onnxruntime::Provider& onnxruntime::ProviderLibrary::Get() [ONNXRuntimeError] : 1 : FAIL : Failed to load library libonnxruntime_providers_cuda.so with error: libcublasLt.so.11: cannot open shared object file: No such file or directory

2024-01-29 04:23:06.588468573 [W:onnxruntime:Default, onnxruntime_pybind_state.cc:747 CreateExecutionProviderInstance] Failed to create CUDAExecutionProvider. Please reference https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#requirements to ensure all dependencies are met.
04:23:06-719653 DEBUG    Model requested: fn=create_infotext                                                                                                                                                                                 
04:23:06-720608 INFO     Select: model="AniLazyCoffee-v3.fp16 [27d5f24ffc]"                                                                                                                                                                  
04:23:06-721663 DEBUG    Load model: existing=False target=/home/vlad/onemoretime/branchie/models/Stable-diffusion/AniLazyCoffee-v3.fp16.safetensors info=None                                                                               
04:23:06-724978 DEBUG    Desired Torch parameters: dtype=FP16 no-half=False no-half-vae=False upscast=False                                                                                                                                  
04:23:06-725721 INFO     Setting Torch parameters: device=cuda dtype=torch.float16 vae=torch.float16 unet=torch.float16 context=inference_mode fp16=True bf16=None                                                                           
04:23:06-726570 INFO     Loading VAE: model=models/VAE/sd1.5/sd-vae-ft-mse-original/vae-ft-mse-840000-ema-pruned.safetensors source=settings                                                                                                 
04:23:06-727281 DEBUG    Diffusers VAE load config: {'low_cpu_mem_usage': False, 'torch_dtype': torch.float16, 'use_safetensors': True, 'variant': 'fp16'}                                                                                   
04:23:06-728041 INFO     Autodetect: vae="Stable Diffusion" class=StableDiffusionPipeline file="/home/vlad/onemoretime/branchie/models/Stable-diffusion/AniLazyCoffee-v3.fp16.safetensors" size=2034MB                                       
04:23:06-832978 DEBUG    Diffusers loading: path="/home/vlad/onemoretime/branchie/models/Stable-diffusion/AniLazyCoffee-v3.fp16.safetensors"                                                                                                 
04:23:06-833976 INFO     Autodetect: model="Stable Diffusion" class=StableDiffusionPipeline file="/home/vlad/onemoretime/branchie/models/Stable-diffusion/AniLazyCoffee-v3.fp16.safetensors" size=2034MB                                     
04:23:08-580689 DEBUG    Setting model: pipeline=StableDiffusionPipeline config={'low_cpu_mem_usage': True, 'torch_dtype': torch.float16, 'load_connected_pipeline': True, 'extract_ema': True, 'force_zeros_for_empty_prompt ': False,      
                         'requires_aesthetics_score': False, 'use_safetensors': True}                                                                                                                                                        
04:23:08-582127 DEBUG    Setting model VAE: name=vae-ft-mse-840000-ema-pruned.safetensors                                                                                                                                                    
04:23:09-813470 INFO     Load embeddings: loaded=453 skipped=36 time=0.66                                                                                                                                                                    
04:23:10-190119 DEBUG    GC: collected=5416 device=cuda {'ram': {'used': 4.02, 'total': 125.72}, 'gpu': {'used': 4.27, 'total': 11.55}, 'retries': 0, 'oom': 0} time=0.38                                                                    
04:23:10-194202 INFO     Load model: time=3.09 load=3.09 native=512 {'ram': {'used': 4.02, 'total': 125.72}, 'gpu': {'used': 4.27, 'total': 11.55}, 'retries': 0, 'oom': 0}                                                                  
04:23:10-195423 ERROR    Exception: 'NoneType' object has no attribute 'batch_size'                                                                                                                                                          
04:23:10-196096 ERROR    Arguments: args=(1, None, [<tempfile._TemporaryFileWrapper object at 0x7b726a839b50>, <tempfile._TemporaryFileWrapper object at 0x7b726a342b90>, <tempfile._TemporaryFileWrapper object at 0x7b726a9ec050>,         
                         <tempfile._TemporaryFileWrapper object at 0x7b726a5712d0>], '/usr/share/pics/2024-01/text/TokyoGhoul/', '/usr/share/pics/2024-01/extras/', True, True, 0, 4, 512, 512, True, 'ESRGAN 4x-UltraMix_Balanced', 'None', 
                         0, '', 'None', 2, True, 1, 0, 1, 0.3, 0, 0, 0.2, True, True, True, 0.01, 3, ['male-penis', 'female-vagina', 'female-breast-bare', 'anus-bare'], 'none', '/home/vlad/logo1a.png', 'None', False, False, True, 240,   
                         10, 10) kwargs={}                                                                                                                                                                                                   
04:23:10-197948 ERROR    gradio call: AttributeError                                                                                                                                                                                         
╭──────────────────────────────────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ /home/vlad/onemoretime/branchie/modules/call_queue.py:31 in f                                                                                                                                                                             │
│                                                                                                                                                                                                                                           │
│   30 │   │   │   try:                                                                                                                                                                                                                     │
│ ❱ 31 │   │   │   │   res = func(*args, **kwargs)                                                                                                                                                                                          │
│   32 │   │   │   │   progress.record_results(id_task, res)                                                                                                                                                                                │
│                                                                                                                                                                                                                                           │
│ /home/vlad/onemoretime/branchie/modules/ui_postprocessing.py:16 in submit_click                                                                                                                                                           │
│                                                                                                                                                                                                                                           │
│   15 def submit_click(tab_index, extras_image, image_batch, extras_batch_input_dir, extras_batch_output_dir, show_extras_results, save_output, *script_inputs):                                                                           │
│ ❱ 16 │   result_images, geninfo, js_info = postprocessing.run_postprocessing(tab_index, extras_image, image_batch, extras_batch_input_dir, extras_batch_output_dir, show_extras_results, *script_inputs, save_output=save_output)         │
│   17 │   return result_images, geninfo, json.dumps(js_info), ''                                                                                                                                                                           │
│                                                                                                                                                                                                                                           │
│ /home/vlad/onemoretime/branchie/modules/postprocessing.py:74 in run_postprocessing                                                                                                                                                        │
│                                                                                                                                                                                                                                           │
│    73 │   │   pp = scripts_postprocessing.PostprocessedImage(image.convert("RGB"))                                                                                                                                                        │
│ ❱  74 │   │   scripts.scripts_postproc.run(pp, args)                                                                                                                                                                                      │
│    75 │   │   geninfo, items = images.read_info_from_image(image)                                                                                                                                                                         │
│                                                                                                                                                                                                                                           │
│ /home/vlad/onemoretime/branchie/modules/scripts_postprocessing.py:105 in run                                                                                                                                                              │
│                                                                                                                                                                                                                                           │
│   104 │   │   │   shared.log.debug(f'Process: script={script.name} args={process_args}')                                                                                                                                                  │
│ ❱ 105 │   │   │   script.process(pp, **process_args)                                                                                                                                                                                      │
│   106                                                                                                                                                                                                                                     │
│                                                                                                                                                                                                                                           │
│ /home/vlad/onemoretime/branchie/extensions/sd-extension-nudenet/scripts/nudenet_ext.py:86 in process                                                                                                                                      │
│                                                                                                                                                                                                                                           │
│    85 │   def process(self, pp: scripts_postprocessing.PostprocessedImage, enabled, metadata, copy, score, blocks, censor, method, overlay): # pylint: disable=arguments-differ                                                           │
│ ❱  86 │   │   process(None, pp, enabled, metadata, copy, score, blocks, censor, method, overlay)                                                                                                                                          │
│    87                                                                                                                                                                                                                                     │
│                                                                                                                                                                                                                                           │
│ /home/vlad/onemoretime/branchie/extensions/sd-extension-nudenet/scripts/nudenet_ext.py:41 in process                                                                                                                                      │
│                                                                                                                                                                                                                                           │
│    40 │   │   else:                                                                                                                                                                                                                       │
│ ❱  41 │   │   │   info = processing.create_infotext(p)                                                                                                                                                                                    │
│    42 │   │   │   images.save_image(nudes.output, path=p.outpath_samples, seed=p.seed, prompt=p.prompt, info=info, p=p, suffix="-censored")                                                                                               │
│                                                                                                                                                                                                                                           │
│ /home/vlad/onemoretime/branchie/modules/processing.py:571 in create_infotext                                                                                                                                                              │
│                                                                                                                                                                                                                                           │
│    570 │   if index is None:                                                                                                                                                                                                              │
│ ❱  571 │   │   index = position_in_batch + iteration * p.batch_size                                                                                                                                                                       │
│    572 │   if all_prompts is None:                                                                                                                                                                                                        │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: 'NoneType' object has no attribute 'batch_size'

image

vladmandic commented 7 months ago

i cannot reproduce, but looks like something went wrong with onnxruntime. i just updated the repo to include a bit more error handling and logging, can you try?

vladmandic commented 7 months ago

closing as root cause was os limit to number of files.