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]: ERROR Failed to load diffusers model #3479

Closed xiangxinhello closed 1 week ago

xiangxinhello commented 1 week ago

Issue Description

./webui.sh --debug --ckpt /workspace/mnt/storage/xiangxin@supremind.com/infer_tensor/stable-diffusion-2-1 --listen --port 8000

image image

Version Platform Description

No response

Relevant log output

No response

Backend

Diffusers

UI

Standard

Branch

Master

Model

StableDiffusion 2.1

Acknowledgements

vladmandic commented 1 week ago

Post actual log, not screenshots of logs - it makes it impossible to analyze it!

And fill all required fields.

xiangxinhello commented 1 week ago

Post actual log, not screenshots of logs - it makes it impossible to analyze it!

And fill all required fields.

Hi, @vladmandic,

2024-10-09 11:52:03,621 | sd | INFO | launch | Starting SD.Next
2024-10-09 11:52:03,642 | sd | INFO | installer | Logger: file="/workspace/mnt/storage/xiangxin@supremind.com/infer_tensor/automatic/sdnext.log" level=DEBUG size=64 mode=create
2024-10-09 11:52:03,644 | sd | INFO | installer | Python version=3.10.12 platform=Linux bin="/workspace/mnt/storage/xiangxin@supremind.com/infer_tensor/automatic/venv/bin/python3" venv="/workspace/mnt/storage/xiangxin@supremind.com/infer_tensor/automatic/venv"
2024-10-09 11:52:03,794 | sd | INFO | installer | Version: app=sd.next updated=2024-09-13 hash=e7ec07f9 branch=master url=https://githubfast.com/vladmandic/automatic.git/tree/master ui=main
2024-10-09 11:52:04,577 | sd | INFO | launch | Platform: arch=x86_64 cpu=x86_64 system=Linux release=5.15.0-78-generic python=3.10.12
2024-10-09 11:52:04,578 | sd | DEBUG | installer | Setting environment tuning
2024-10-09 11:52:04,580 | sd | INFO | installer | HF cache folder: /root/.cache/huggingface/hub
2024-10-09 11:52:04,582 | sd | DEBUG | installer | Torch allocator: "garbage_collection_threshold:0.80,max_split_size_mb:512"
2024-10-09 11:52:04,605 | sd | DEBUG | installer | Torch overrides: cuda=True rocm=False ipex=False diml=False openvino=False
2024-10-09 11:52:04,607 | sd | DEBUG | installer | Torch allowed: cuda=True rocm=False ipex=False diml=False openvino=False
2024-10-09 11:52:04,608 | sd | INFO | installer | nVidia CUDA toolkit detected: nvidia-smi present
2024-10-09 11:52:05,173 | sd | WARNING | installer | Modified files: ['webui.py']
2024-10-09 11:52:05,540 | sd | INFO | installer | Verifying requirements
2024-10-09 11:52:05,544 | sd | INFO | installer | Verifying packages
2024-10-09 11:52:05,583 | sd | DEBUG | installer | Repository update time: Fri Sep 13 16:51:56 2024
2024-10-09 11:52:05,585 | sd | INFO | launch | Startup: standard
2024-10-09 11:52:05,586 | sd | INFO | installer | Verifying submodules
2024-10-09 11:52:08,377 | sd | DEBUG | installer | Submodule: extensions-builtin/sd-extension-chainner / main
2024-10-09 11:52:08,551 | sd | DEBUG | installer | Submodule: extensions-builtin/sd-extension-system-info / main
2024-10-09 11:52:08,634 | sd | DEBUG | installer | Submodule: extensions-builtin/sd-webui-agent-scheduler / main
2024-10-09 11:52:08,886 | sd | DEBUG | installer | Git detached head detected: folder="extensions-builtin/sdnext-modernui" reattach=main
2024-10-09 11:52:08,887 | sd | DEBUG | installer | Submodule: extensions-builtin/sdnext-modernui / main
2024-10-09 11:52:09,011 | sd | DEBUG | installer | Submodule: extensions-builtin/stable-diffusion-webui-rembg / master
2024-10-09 11:52:09,096 | sd | DEBUG | installer | Submodule: modules/k-diffusion / master
2024-10-09 11:52:09,179 | sd | DEBUG | installer | Submodule: wiki / master
2024-10-09 11:52:09,311 | sd | DEBUG | paths | Register paths
2024-10-09 11:52:09,708 | sd | DEBUG | installer | Installed packages: 188
2024-10-09 11:52:09,710 | sd | DEBUG | installer | Extensions all: ['Lora', 'sd-extension-chainner', 'sd-extension-system-info', 'sd-webui-agent-scheduler', 'sdnext-modernui', 'stable-diffusion-webui-rembg']
2024-10-09 11:52:11,000 | sd | DEBUG | installer | Running extension installer: /workspace/mnt/storage/xiangxin@supremind.com/infer_tensor/automatic/extensions-builtin/sd-webui-agent-scheduler/install.py
2024-10-09 11:52:12,507 | sd | DEBUG | installer | Running extension installer: /workspace/mnt/storage/xiangxin@supremind.com/infer_tensor/automatic/extensions-builtin/stable-diffusion-webui-rembg/install.py
2024-10-09 11:52:13,532 | sd | DEBUG | installer | Extensions all: []
2024-10-09 11:52:13,532 | sd | INFO | installer | Extensions enabled: ['Lora', 'sd-extension-chainner', 'sd-extension-system-info', 'sd-webui-agent-scheduler', 'sdnext-modernui', 'stable-diffusion-webui-rembg']
2024-10-09 11:52:13,533 | sd | INFO | installer | Verifying requirements
2024-10-09 11:52:13,534 | sd | DEBUG | launch | Setup complete without errors: 1728474734
2024-10-09 11:52:13,548 | sd | DEBUG | installer | Extension preload: {'extensions-builtin': 0.0, 'extensions': 0.0}
2024-10-09 11:52:13,550 | sd | DEBUG | launch | Starting module: <module 'webui' from '/workspace/mnt/storage/xiangxin@supremind.com/infer_tensor/automatic/webui.py'>
2024-10-09 11:52:13,551 | sd | INFO | launch | Command line args: ['--debug', '--ckpt', '/workspace/mnt/storage/xiangxin@supremind.com/infer_tensor/stable-diffusion-2-1', '--listen', '--port', '8000', '--use-cuda'] ckpt=/workspace/mnt/storage/xiangxin@supremind.com/infer_tensor/stable-diffusion-2-1 listen=True port=8000 use_cuda=True debug=True
2024-10-09 11:52:13,552 | sd | DEBUG | launch | Env flags: []
2024-10-09 11:52:26,606 | sd | INFO | loader | Load packages: {'torch': '2.4.1+cu124', 'diffusers': '0.31.0.dev0', 'gradio': '3.43.2'}
2024-10-09 11:52:28,084 | sd | INFO | shared | VRAM: Detected=79.15 GB Optimization=none
2024-10-09 11:52:28,108 | sd | DEBUG | shared | Read: file="config.json" json=22 bytes=934 time=0.001
2024-10-09 11:52:28,128 | sd | INFO | shared | Engine: backend=Backend.DIFFUSERS compute=cuda device=cuda attention="Scaled-Dot-Product" mode=no_grad
2024-10-09 11:52:28,230 | sd | INFO | shared | Device: device=NVIDIA A100-SXM4-80GB n=1 arch=sm_90 cap=(8, 0) cuda=12.4 cudnn=90100 driver=535.129.03
2024-10-09 11:52:28,237 | sd | DEBUG | shared | Read: file="html/reference.json" json=52 bytes=28756 time=0.003
2024-10-09 11:52:29,072 | sd | DEBUG | __init__ | ONNX: version=1.19.2 provider=CUDAExecutionProvider, available=['AzureExecutionProvider', 'CPUExecutionProvider']
2024-10-09 11:52:29,474 | sd | DEBUG | sd_hijack | Importing LDM
2024-10-09 11:52:29,515 | sd | DEBUG | webui | Entering start sequence
2024-10-09 11:52:29,524 | sd | DEBUG | webui | Initializing
2024-10-09 11:52:29,626 | sd | INFO | sd_vae | Available VAEs: path="models/VAE" items=0
2024-10-09 11:52:29,644 | sd | DEBUG | sd_unet | Available UNets: path="models/UNET" items=0
2024-10-09 11:52:29,661 | sd | DEBUG | model_t5 | Available T5s: path="models/T5" items=0
2024-10-09 11:52:29,680 | sd | INFO | extensions | Disabled extensions: ['sdnext-modernui']
2024-10-09 11:52:29,714 | sd | DEBUG | shared | Read: file="metadata.json" json=5 bytes=691 time=0.001
2024-10-09 11:52:29,721 | sd | DEBUG | modelloader | Scanning diffusers cache: folder=models/Diffusers items=0 time=0.00
2024-10-09 11:52:29,723 | sd | INFO | sd_models | Available models: path="models/Stable-diffusion" items=6 time=0.04
2024-10-09 11:52:29,958 | sd | DEBUG | webui | Load extensions
2024-10-09 11:52:30,150 | sd | INFO | networks | LoRA networks: available=0 folders=2
2024-10-09 11:52:31,206 | sd | INFO | script_loading | Extension: script='extensions-builtin/sd-webui-agent-scheduler/scripts/task_scheduler.py' Using sqlite file: extensions-builtin/sd-webui-agent-scheduler/task_scheduler.sqlite3
2024-10-09 11:52:31,232 | sd | DEBUG | webui | Extensions init time: 1.27 sd-extension-chainner=0.11 sd-webui-agent-scheduler=0.93
2024-10-09 11:52:31,274 | sd | DEBUG | shared | Read: file="html/upscalers.json" json=4 bytes=2640 time=0.001
2024-10-09 11:52:31,293 | sd | DEBUG | shared | Read: file="extensions-builtin/sd-extension-chainner/models.json" json=24 bytes=2693 time=0.002
2024-10-09 11:52:31,301 | sd | DEBUG | chainner_model | chaiNNer models: path="models/chaiNNer" defined=24 discovered=0 downloaded=0
2024-10-09 11:52:31,323 | sd | DEBUG | modelloader | Load upscalers: total=53 downloaded=0 user=0 time=0.08 ['None', 'Lanczos', 'Nearest', 'ChaiNNer', 'AuraSR', 'ESRGAN', 'LDSR', 'RealESRGAN', 'SCUNet', 'SD', 'SwinIR']
2024-10-09 11:52:31,353 | sd | DEBUG | styles | Load styles: folder="models/styles" items=288 time=0.01
2024-10-09 11:52:31,363 | sd | DEBUG | webui | Creating UI
2024-10-09 11:52:31,368 | sd | DEBUG | theme | UI themes available: type=Standard themes=12
2024-10-09 11:52:31,370 | sd | INFO | theme | UI theme: type=Standard name="black-teal"
2024-10-09 11:52:31,407 | sd | DEBUG | ui_javascript | UI theme: css="/workspace/mnt/storage/xiangxin@supremind.com/infer_tensor/automatic/javascript/black-teal.css" base="sdnext.css" user="None"
2024-10-09 11:52:31,414 | sd | DEBUG | ui_txt2img | UI initialize: txt2img
2024-10-09 11:52:31,470 | sd | DEBUG | ui_extra_networks | Networks: page='model' items=57 subfolders=8 tab=txt2img folders=['models/Stable-diffusion', 'models/Diffusers', 'models/Reference'] list=0.02 thumb=0.01 desc=0.00 info=0.00 workers=4 sort=Default
2024-10-09 11:52:31,472 | sd | DEBUG | ui_extra_networks | Networks: page='lora' items=0 subfolders=0 tab=txt2img folders=['models/Lora', 'models/LyCORIS'] list=0.01 thumb=0.01 desc=0.00 info=0.00 workers=4 sort=Default
2024-10-09 11:52:31,482 | sd | DEBUG | ui_extra_networks | Networks: page='style' items=288 subfolders=1 tab=txt2img folders=['models/styles', 'html'] list=0.01 thumb=0.01 desc=0.00 info=0.00 workers=4 sort=Default
2024-10-09 11:52:31,485 | sd | DEBUG | ui_extra_networks | Networks: page='embedding' items=0 subfolders=0 tab=txt2img folders=['models/embeddings'] list=0.01 thumb=0.00 desc=0.00 info=0.00 workers=4 sort=Default
2024-10-09 11:52:31,500 | sd | DEBUG | ui_extra_networks | Networks: page='vae' items=0 subfolders=0 tab=txt2img folders=['models/VAE'] list=0.00 thumb=0.00 desc=0.00 info=0.00 workers=4 sort=Default
2024-10-09 11:52:31,632 | sd | DEBUG | ui_img2img | UI initialize: img2img
2024-10-09 11:52:31,756 | sd | DEBUG | ui_control_helpers | UI initialize: control models=models/control
2024-10-09 11:52:32,267 | sd | DEBUG | shared | Read: file="ui-config.json" json=0 bytes=2 time=0.002
2024-10-09 11:52:32,423 | sd | DEBUG | theme | UI themes available: type=Standard themes=12
2024-10-09 11:52:32,588 | sd | DEBUG | shared | Reading failed: /workspace/mnt/storage/xiangxin@supremind.com/infer_tensor/automatic/html/extensions.json [Errno 2] No such file or directory: '/workspace/mnt/storage/xiangxin@supremind.com/infer_tensor/automatic/html/extensions.json'
2024-10-09 11:52:32,589 | sd | INFO | ui_extensions | Extension list is empty: refresh required
2024-10-09 11:52:32,974 | sd | DEBUG | ui_extensions | Extension list: processed=6 installed=6 enabled=5 disabled=1 visible=6 hidden=0
2024-10-09 11:52:33,441 | sd | DEBUG | webui | Root paths: ['/workspace/mnt/storage/xiangxin@supremind.com/infer_tensor/automatic']
2024-10-09 11:52:33,628 | sd | INFO | webui | Local URL: http://localhost:8000/
2024-10-09 11:52:33,631 | sd | DEBUG | webui | Gradio functions: registered=1801
2024-10-09 11:52:33,639 | sd | DEBUG | middleware | FastAPI middleware: ['Middleware', 'Middleware']
2024-10-09 11:52:33,645 | sd | DEBUG | webui | Creating API
2024-10-09 11:52:33,838 | sd | INFO | task_runner | [AgentScheduler] Task queue is empty
2024-10-09 11:52:33,839 | sd | INFO | api | [AgentScheduler] Registering APIs
2024-10-09 11:52:33,949 | sd | DEBUG | webui | Scripts setup: ['IP Adapters:0.028', 'XYZ Grid:0.021', 'Face:0.021', 'AnimateDiff:0.008', 'CogVideoX:0.009', 'LUT Color grading:0.007', 'X/Y/Z Grid:0.014', 'Image-to-Video:0.007', 'Stable Video Diffusion:0.006']
2024-10-09 11:52:33,951 | sd | DEBUG | sd_models | Model metadata: file="metadata.json" no changes
2024-10-09 11:52:33,967 | sd | DEBUG | devices | Torch mode: deterministic=False
2024-10-09 11:52:33,976 | sd | DEBUG | devices | Desired Torch parameters: dtype=FP16 no-half=False no-half-vae=False upscast=False
2024-10-09 11:52:33,978 | sd | INFO | devices | Setting Torch parameters: device=cuda dtype=torch.float16 vae=torch.float16 unet=torch.float16 context=no_grad fp16=True bf16=None optimization=Scaled-Dot-Product
2024-10-09 11:52:34,000 | sd | DEBUG | webui | Model auto load disabled
2024-10-09 11:52:34,002 | sd | DEBUG | script_callbacks | Script callback init time: system-info.py:app_started=0.07 task_scheduler.py:app_started=0.14
2024-10-09 11:52:34,003 | sd | INFO | webui | Startup time: 20.43 torch=10.02 gradio=1.80 diffusers=0.37 libraries=3.72 samplers=0.09 extensions=1.27 face-restore=0.23 upscalers=0.10 ui-networks=0.26 ui-txt2img=0.10 ui-img2img=0.09 ui-control=0.15 ui-models=0.21 ui-settings=0.31 ui-extensions=0.44 ui-defaults=0.39 launch=0.25 api=0.10 app-started=0.20 checkpoint=0.05
2024-10-09 11:52:34,013 | sd | DEBUG | shared | Save: file="config.json" json=22 bytes=934 time=0.011
2024-10-09 11:54:00,091 | sd | DEBUG | launch | Server: alive=True jobs=0 requests=1 uptime=93 memory=1.0/2003.92 backend=Backend.DIFFUSERS state=idle
2024-10-09 11:55:54,813 | sd | INFO | server | MOTD: N/A
2024-10-09 11:55:56,591 | sd | DEBUG | theme | UI themes available: type=Standard themes=12
2024-10-09 11:55:57,168 | sd | INFO | api | Browser session: user=None client=127.0.0.1 agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
2024-10-09 11:56:00,231 | sd | DEBUG | launch | Server: alive=True jobs=0 requests=20 uptime=213 memory=1.05/2003.92 backend=Backend.DIFFUSERS state=idle
2024-10-09 11:56:04,524 | sd | DEBUG | modeldata | Model requested: fn=txt2img
2024-10-09 11:56:04,530 | sd | INFO | sd_models | Select: model="/workspace/mnt/storage/xiangxin@supremind.com/infer_tensor/stable-diffusion-2-1"
2024-10-09 11:56:04,533 | sd | DEBUG | sd_models | Load model: existing=False target=/workspace/mnt/storage/xiangxin@supremind.com/infer_tensor/stable-diffusion-2-1 info=None
2024-10-09 11:56:04,538 | sd | ERROR | sd_models | Failed to load diffusers model
2024-10-09 11:56:04,540 | sd | ERROR | errors | loading Diffusers model: AttributeError
2024-10-09 11:56:04,999 | sd | DEBUG | devices | GC: utilization={'gpu': 1, 'ram': 0, 'threshold': 80} gc={'collected': 147, 'saved': 0.0} before={'gpu': 0.49, 'ram': 1.05} after={'gpu': 0.49, 'ram': 1.05, 'retries': 0, 'oom': 0} device=cuda fn=load_diffuser time=0.27
2024-10-09 11:56:05,001 | sd | DEBUG | modeldata | Model requested: fn=assign_network_names_to_compvis_modules
2024-10-09 11:56:05,003 | sd | ERROR | errors | Executing callback: /workspace/mnt/storage/xiangxin@supremind.com/infer_tensor/automatic/extensions-builtin/Lora/scripts/lora_script.py model_loaded_callback: AttributeError
2024-10-09 11:56:05,022 | sd | INFO | sd_models | Load model: time=0.00  native=0 {'ram': {'used': 1.05, 'total': 2003.92}, 'gpu': {'used': 0.49, 'total': 79.15}, 'retries': 0, 'oom': 0}
2024-10-09 11:56:05,023 | sd | WARNING | txt2img | Model not loaded
xiangxinhello commented 1 week ago

Post actual log, not screenshots of logs - it makes it impossible to analyze it!

And fill all required fields.

Hi, @vladmandic

11:56:04-538443 ERROR    Failed to load diffusers model                                                                                                         
11:56:04-540196 ERROR    loading Diffusers model: AttributeError                                                                                                
╭───────────────────────────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────────────────────────╮
│ /workspace/mnt/storage/xiangxin@supremind.com/infer_tensor/automatic/modules/sd_models.py:1056 in load_diffuser                                              │
│                                                                                                                                                              │
│   1055 │   │   │   ckpt_basename = os.path.basename(shared.cmd_opts.ckpt)                                                                                    │
│ ❱ 1056 │   │   │   model_name = modelloader.find_diffuser(ckpt_basename)                                                                                     │
│   1057 │   │   │   if model_name is not None:                                                                                                                │
│                                                                                                                                                              │
│ /workspace/mnt/storage/xiangxin@supremind.com/infer_tensor/automatic/modules/modelloader.py:303 in find_diffuser                                             │
│                                                                                                                                                              │
│   302 │   hf_api = hf.HfApi()                                                                                                                                │
│ ❱ 303 │   hf_filter = hf.ModelFilter(                                                                                                                        │
│   304 │   │   model_name=name,                                                                                                                               │
│                                                                                                                                                              │
│ /workspace/mnt/storage/xiangxin@supremind.com/infer_tensor/automatic/venv/lib/python3.10/site-packages/huggingface_hub/__init__.py:535 in __getattr__        │
│                                                                                                                                                              │
│   534 │   │   else:                                                                                                                                          │
│ ❱ 535 │   │   │   raise AttributeError(f"No {package_name} attribute {name}")                                                                                │
│   536                                                                                                                                                        │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: No huggingface_hub attribute ModelFilter
11:56:04-999076 DEBUG    GC: utilization={'gpu': 1, 'ram': 0, 'threshold': 80} gc={'collected': 147, 'saved': 0.0} before={'gpu': 0.49, 'ram': 1.05}            
                         after={'gpu': 0.49, 'ram': 1.05, 'retries': 0, 'oom': 0} device=cuda fn=load_diffuser time=0.27                                        
11:56:05-001719 DEBUG    Model requested: fn=assign_network_names_to_compvis_modules                                                                            
11:56:05-003823 ERROR    Executing callback: /workspace/mnt/storage/xiangxin@supremind.com/infer_tensor/automatic/extensions-builtin/Lora/scripts/lora_script.py
                         model_loaded_callback: AttributeError                                                                                                  
╭───────────────────────────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────────────────────────╮
│ /workspace/mnt/storage/xiangxin@supremind.com/infer_tensor/automatic/modules/script_callbacks.py:196 in model_loaded_callback                                │
│                                                                                                                                                              │
│   195 │   │   │   t0 = time.time()                                                                                                                           │
│ ❱ 196 │   │   │   c.callback(sd_model)                                                                                                                       │
│   197 │   │   │   timer(t0, c.script, 'model_loaded')                                                                                                        │
│                                                                                                                                                              │
│ /workspace/mnt/storage/xiangxin@supremind.com/infer_tensor/automatic/extensions-builtin/Lora/networks.py:54 in assign_network_names_to_compvis_modules       │
│                                                                                                                                                              │
│    53 │   │   if not hasattr(shared.sd_model, 'text_encoder') or not hasattr(shared.sd_model, 'unet'):                                                       │
│ ❱  54 │   │   │   sd_model.network_layer_mapping = {}                                                                                                        │
│    55 │   │   │   return                                                                                                                                     │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: 'NoneType' object has no attribute 'network_layer_mapping'
11:56:05-022280 INFO     Load model: time=0.00  native=0 {'ram': {'used': 1.05, 'total': 2003.92}, 'gpu': {'used': 0.49, 'total': 79.15}, 'retries': 0, 'oom':  
                         0}                                                                                                                                     
11:56:05-023736 WARNING  Model not loaded                                                                                                                       
vladmandic commented 1 week ago

you still have provided NO DESCRIPTION of the issue and NO version/platform info. ok, i've fixed it in latest dev branch, but for the future and issue without description will be auto-closed and not considered.