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.68k stars 421 forks source link

[Issue]: Failing to load diffusers model #3017

Closed HackdaNorth closed 7 months ago

HackdaNorth commented 7 months ago

Issue Description

On fresh install of latest branch main, I am encountering issues with ONNX Runtime & Olive implementation.

I have attempted many different things, I have used dreamshaper_8, and a few others same result. This was working about a week and a half ago, It recently stopped when I attempted to upgrade torchvision itself using pip install torch torchvision --upgrade and failed, so I reinstalled and get the same error each time.

  1. Clone fresh install from main branch https://github.com/vladmandic/automatic.git git clone https://github.com/vladmandic/automatic.git

  2. Start with webui.bat --debug

  3. wait for it to boot, then followed #first-time-setup, then shut down server,

  4. go to console and apply .\venv\Scripts\activate pip uninstall torch-directml pip install torch torchvision --upgrade pip install onnxruntime-directml .\webui.bat

  5. On first boot I followed ONNX-Runtime-&-Olive and followed, Change Execution backend to diffusers and Diffusers pipeline to ONNX Stable Diffusion on the System tab. then set Execution Provider to DmlExecutionProvider

  6. and follow and tick these Go to System tab → Compute Settings. Select Model, Text Encoder and VAE in Compile Model. Set Model compile backend to olive-ai.

  7. Apply and Shutdown SDNext.

  8. Copy dreamshaper_631vaebaked.safetensors into stable diffusion directory.

  9. attempt image Txt2Img generation

  10. ERROR Failed to load diffusers model

Version Platform Description

15:55:02-619735 INFO     Starting SD.Next
15:55:02-624736 INFO     Logger: file="F:\stable\automatic\sdnext.log" level=DEBUG size=65 mode=create
15:55:02-627737 INFO     Python 3.10.6 on Windows
15:55:02-777763 INFO     Version: app=sd.next updated=2024-03-21 hash=82973c49 branch=master url=https://github.com/vladmandic/automatic/tree/master
15:55:03-206837 INFO     Platform: arch=AMD64 cpu=AMD64 Family 25 Model 33 Stepping 2, AuthenticAMD system=Windows release=Windows-10-10.0.19045-SP0 python=3.10.6
15:55:03-210838 DEBUG    Setting environment tuning
15:55:03-212838 DEBUG    HF cache folder: C:\Users\macin\.cache\huggingface\hub
15:55:03-218339 DEBUG    Torch overrides: cuda=False rocm=False ipex=False diml=False openvino=False
15:55:03-221840 DEBUG    Torch allowed: cuda=True rocm=True ipex=True diml=True openvino=True

Relevant log output

Error part in log

15:56:48-264603 ERROR    Failed to load diffusers model
15:56:48-266104 ERROR    loading Diffusers model: ValueError
┌──────────────────────────────────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ F:\stable\automatic\modules\sd_models.py:1093 in load_diffuser                                                                                                                                                                             │
│                                                                                                                                                                                                                                            │
│   1092 │   │   else:                                                                                                                                                                                                                       │
│ > 1093 │   │   │   move_model(sd_model, devices.device)                                                                                                                                                                                    │
│   1094                                                                                                                                                                                                                                     │
│                                                                                                                                                                                                                                            │
│ F:\stable\automatic\modules\sd_models.py:763 in move_model                                                                                                                                                                                 │
│                                                                                                                                                                                                                                            │
│    762 │   debug_move(f'Model move: device={device} class={model.__class__} accelerate={getattr(model, "has_accelerate", False)} fn={sys._getframe(1).f_code.co_name}') # pylint: disable=protected-access                                 │
│ >  763 │   if hasattr(model, "components"): # accelerate patch                                                                                                                                                                             │
│    764 │   │   for name, m in model.components.items():                                                                                                                                                                                    │
│                                                                                                                                                                                                                                            │
│ F:\stable\automatic\venv\lib\site-packages\diffusers\pipelines\pipeline_utils.py:1504 in components                                                                                                                                        │
│                                                                                                                                                                                                                                            │
│   1503 │   │   if set(components.keys()) != expected_modules:                                                                                                                                                                              │
│ > 1504 │   │   │   raise ValueError(                                                                                                                                                                                                       │
│   1505 │   │   │   │   f"{self} has been incorrectly initialized or {self.__class__} is incorrectly implemented. Expected"                                                                                                                 │
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
ValueError: OnnxRawPipeline {
  "_class_name": "OnnxRawPipeline",
  "_diffusers_version": "0.27.0"
}
 has been incorrectly initialized or <class 'modules.onnx_impl.pipelines.OnnxRawPipeline'> is incorrectly implemented. Expected {'constructor', 'path'} to be defined, but dict_keys([]) are defined.

FULL LOG

15:55:02-619735 INFO     Starting SD.Next
15:55:02-624736 INFO     Logger: file="F:\stable\automatic\sdnext.log" level=DEBUG size=65 mode=create
15:55:02-627737 INFO     Python 3.10.6 on Windows
15:55:02-777763 INFO     Version: app=sd.next updated=2024-03-21 hash=82973c49 branch=master url=https://github.com/vladmandic/automatic/tree/master
15:55:03-206837 INFO     Platform: arch=AMD64 cpu=AMD64 Family 25 Model 33 Stepping 2, AuthenticAMD system=Windows release=Windows-10-10.0.19045-SP0 python=3.10.6
15:55:03-210838 DEBUG    Setting environment tuning
15:55:03-212838 DEBUG    HF cache folder: C:\Users\macin\.cache\huggingface\hub
15:55:03-218339 DEBUG    Torch overrides: cuda=False rocm=False ipex=False diml=False openvino=False
15:55:03-221840 DEBUG    Torch allowed: cuda=True rocm=True ipex=True diml=True openvino=True
15:55:03-232342 DEBUG    Package not found: torch-directml
15:55:03-242843 INFO     Using CPU-only Torch
15:55:03-244344 DEBUG    Installing torch: torch torchvision
15:55:03-357363 DEBUG    Repository update time: Wed Mar 20 22:23:50 2024
15:55:03-359364 INFO     Startup: standard
15:55:03-360864 INFO     Verifying requirements
15:55:03-376367 INFO     Verifying packages
15:55:03-378867 INFO     Verifying submodules
15:55:05-650762 DEBUG    Submodule: extensions-builtin/sd-extension-chainner / main
15:55:05-729276 DEBUG    Submodule: extensions-builtin/sd-extension-system-info / main
15:55:05-802788 DEBUG    Submodule: extensions-builtin/sd-webui-agent-scheduler / main
15:55:05-886803 DEBUG    Submodule: extensions-builtin/sd-webui-controlnet / main
15:55:06-002323 DEBUG    Submodule: extensions-builtin/stable-diffusion-webui-images-browser / main
15:55:06-076836 DEBUG    Submodule: extensions-builtin/stable-diffusion-webui-rembg / master
15:55:06-151849 DEBUG    Submodule: modules/k-diffusion / master
15:55:06-233363 DEBUG    Submodule: wiki / master
15:55:06-282872 DEBUG    Register paths
15:55:06-629933 DEBUG    Installed packages: 242
15:55:06-632933 DEBUG    Extensions all: ['Lora', 'sd-extension-chainner', 'sd-extension-system-info', 'sd-webui-agent-scheduler', 'sd-webui-controlnet', 'stable-diffusion-webui-images-browser', 'stable-diffusion-webui-rembg']
15:55:07-322053 DEBUG    Running extension installer: F:\stable\automatic\extensions-builtin\sd-extension-system-info\install.py
15:55:08-243712 DEBUG    Running extension installer: F:\stable\automatic\extensions-builtin\sd-webui-agent-scheduler\install.py
15:55:09-151871 DEBUG    Running extension installer: F:\stable\automatic\extensions-builtin\sd-webui-controlnet\install.py
15:55:10-075031 DEBUG    Running extension installer: F:\stable\automatic\extensions-builtin\stable-diffusion-webui-images-browser\install.py
15:55:10-996192 DEBUG    Running extension installer: F:\stable\automatic\extensions-builtin\stable-diffusion-webui-rembg\install.py
15:55:11-911350 DEBUG    Extensions all: []
15:55:11-913852 INFO     Extensions enabled: ['Lora', 'sd-extension-chainner', 'sd-extension-system-info', 'sd-webui-agent-scheduler', 'sd-webui-controlnet', 'stable-diffusion-webui-images-browser', 'stable-diffusion-webui-rembg']
15:55:11-915852 INFO     Verifying requirements
15:55:11-941356 DEBUG    Setup complete without errors: 1711914912
15:55:11-950858 DEBUG    Extension preload: {'extensions-builtin': 0.0, 'extensions': 0.0}
15:55:11-953358 DEBUG    Starting module: <module 'webui' from 'F:\\stable\\automatic\\webui.py'>
15:55:11-955859 INFO     Command line args: ['--debug'] debug=True
15:55:11-957859 DEBUG    Env flags: []
15:55:20-705879 INFO     Load packages: {'torch': '2.2.2+cpu', 'diffusers': '0.27.0', 'gradio': '3.43.2'}
15:55:22-354666 DEBUG    Read: file="config.json" json=36 bytes=1596 time=0.000
15:55:22-361168 INFO     Engine: backend=Backend.DIFFUSERS compute=cpu device=cpu attention="Scaled-Dot-Product" mode=no_grad
15:55:22-364168 INFO     Device:
15:55:22-366168 DEBUG    Read: file="html\reference.json" json=36 bytes=21493 time=0.000
15:55:23-230318 DEBUG    ONNX: version=1.17.1 provider=CPUExecutionProvider, available=['DmlExecutionProvider', 'CPUExecutionProvider']
15:55:23-347839 DEBUG    Importing LDM
15:55:23-381845 DEBUG    Entering start sequence
15:55:23-386346 DEBUG    Initializing
15:55:23-426853 INFO     Available VAEs: path="models\VAE" items=1
15:55:23-429854 INFO     Disabled extensions: ['sd-webui-controlnet']
15:55:23-433854 DEBUG    Scanning diffusers cache: folder=models\Diffusers items=0 time=0.00
15:55:23-436355 INFO     Available models: path="models\Stable-diffusion" items=0 time=0.00
15:55:23-542373 DEBUG    Load extensions
15:55:23-604884 INFO     Extension: script='extensions-builtin\Lora\scripts\lora_script.py' 15:55:23-600883 INFO     LoRA networks: available=0 folders=2
15:55:24-302505 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
15:55:24-610559 DEBUG    Extensions init time: 1.07 sd-extension-chainner=0.05 sd-webui-agent-scheduler=0.64 stable-diffusion-webui-images-browser=0.29
15:55:24-634563 DEBUG    Read: file="html/upscalers.json" json=4 bytes=2672 time=0.000
15:55:24-638064 DEBUG    Read: file="extensions-builtin\sd-extension-chainner\models.json" json=24 bytes=2719 time=0.000
15:55:24-642564 DEBUG    chaiNNer models: path="models\chaiNNer" defined=24 discovered=0 downloaded=0
15:55:24-648065 DEBUG    Upscaler type=ESRGAN folder="models\ESRGAN" model="ESRGAN_4x" path="models\ESRGAN\ESRGAN_4x.pth"
15:55:24-653066 DEBUG    Upscaler type=SwinIR folder="models\SwinIR" model="SwinIR_4x" path="models\SwinIR\SwinIR_4x.pth"
15:55:24-657067 DEBUG    Load upscalers: total=54 downloaded=3 user=2 time=0.04 ['None', 'Lanczos', 'Nearest', 'ChaiNNer', 'ESRGAN', 'LDSR', 'RealESRGAN', 'SCUNet', 'SD', 'SwinIR']
15:55:24-694574 DEBUG    Load styles: folder="models\styles" items=288 time=0.03
15:55:24-701574 DEBUG    Creating UI
15:55:24-703075 INFO     UI theme: name="black-teal" style=Auto base=sdnext.css
15:55:24-720578 DEBUG    UI initialize: txt2img
15:55:24-736081 DEBUG    Read: file="cache.json" json=2 bytes=523 time=0.000
15:55:24-772087 DEBUG    Extra networks: page='model' items=36 subfolders=2 tab=txt2img folders=['models\\Stable-diffusion', 'models\\Diffusers', 'models\\Reference'] list=0.01 thumb=0.00 desc=0.00 info=0.00 workers=4
15:55:24-832097 DEBUG    Extra networks: page='style' items=288 subfolders=1 tab=txt2img folders=['models\\styles', 'html'] list=0.03 thumb=0.00 desc=0.00 info=0.00 workers=4
15:55:24-837598 DEBUG    Extra networks: page='embedding' items=0 subfolders=0 tab=txt2img folders=['models\\embeddings'] list=0.00 thumb=0.00 desc=0.00 info=0.00 workers=4
15:55:24-842099 DEBUG    Extra networks: page='hypernetwork' items=0 subfolders=0 tab=txt2img folders=['models\\hypernetworks'] list=0.00 thumb=0.00 desc=0.00 info=0.00 workers=4
15:55:24-849100 DEBUG    Extra networks: page='vae' items=1 subfolders=0 tab=txt2img folders=['models\\VAE'] list=0.01 thumb=0.00 desc=0.00 info=0.00 workers=4
15:55:24-853601 DEBUG    Extra networks: page='lora' items=0 subfolders=0 tab=txt2img folders=['models\\Lora', 'models\\LyCORIS'] list=0.00 thumb=0.00 desc=0.00 info=0.00 workers=4
15:55:24-947617 DEBUG    UI initialize: img2img
15:55:25-071639 DEBUG    UI initialize: control models=models\control
15:55:25-362190 DEBUG    Read: file="ui-config.json" json=0 bytes=2 time=0.000
15:55:25-487711 DEBUG    Themes: builtin=12 gradio=5 huggingface=0
15:55:26-459380 INFO     Extension list is empty: refresh required
15:55:27-122995 DEBUG    Extension list: processed=7 installed=7 enabled=6 disabled=1 visible=7 hidden=0
15:55:27-323030 DEBUG    Root paths: ['F:\\stable\\automatic']
15:55:27-447052 INFO     Local URL: http://127.0.0.1:7860/
15:55:27-449553 DEBUG    Gradio functions: registered=2145
15:55:27-453053 DEBUG    FastAPI middleware: ['Middleware', 'Middleware']
15:55:27-457554 DEBUG    Creating API
15:55:27-957140 INFO     [AgentScheduler] Task queue is empty
15:55:27-959141 INFO     [AgentScheduler] Registering APIs
15:55:28-125670 DEBUG    Scripts setup: ['IP Adapters:0.019', 'AnimateDiff:0.012', 'X/Y/Z Grid:0.015', 'Face:0.017', 'Image-to-Video:0.008', 'Stable Video Diffusion:0.006']
15:55:28-128670 DEBUG    Model metadata: file="metadata.json" no changes
15:55:28-131671 DEBUG    Model requested: fn=<lambda>
15:55:28-134171 WARNING  Cannot generate without a checkpoint
15:55:28-135671 INFO     Set system paths to use existing folders in a different location
15:55:28-137172 INFO       or use --models-dir <path-to-folder> to specify base folder with all models
15:55:28-139672 INFO       or use --ckpt-dir <path-to-folder> to specify folder with sd models
15:55:28-141672 INFO       or use --ckpt <path-to-checkpoint> to force using existing model
15:55:28-144673 DEBUG    Script callback init time: image_browser.py:ui_tabs=0.80 system-info.py:app_started=0.37 task_scheduler.py:app_started=0.19
15:55:28-146673 DEBUG    Save: file="config.json" json=36 bytes=1540 time=0.003
15:55:28-151174 INFO     Startup time: 16.18 torch=7.44 olive=0.11 gradio=1.19 libraries=2.64 extensions=1.07 face-restore=0.10 upscalers=0.05 ui-en=0.27 ui-txt2img=0.07 ui-img2img=0.08 ui-control=0.13 ui-extras=0.05 ui-settings=0.28
                         ui-extensions=1.53 ui-defaults=0.10 launch=0.20 api=0.11 app-started=0.56
15:55:31-021173 INFO     MOTD: N/A
15:55:34-009693 DEBUG    Themes: builtin=12 gradio=5 huggingface=0
15:55:36-546135 INFO     MOTD: N/A
15:55:39-334118 DEBUG    Themes: builtin=12 gradio=5 huggingface=0
15:55:40-729862 INFO     Browser session: user=None client=127.0.0.1 agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 Edg/123.0.0.0
15:55:56-864667 DEBUG    Package not found: olive-ai
15:55:56-866667 INFO     Installing Olive
15:55:56-868667 DEBUG    Package not found: olive-ai
15:55:56-870168 INFO     Installing package: olive-ai
15:55:56-872168 DEBUG    Running pip: install --upgrade olive-ai
15:56:00-423785 DEBUG    Server: alive=True jobs=2 requests=119 uptime=39 memory=0.6/31.91 backend=Backend.DIFFUSERS state=job="run_settings" 0/-1
15:56:06-739883 INFO     Olive: Please restart webui session.
15:56:06-742384 INFO     Settings: changed=1 ['onnx_execution_provider']
15:56:06-743884 DEBUG    Save: file="config.json" json=37 bytes=1593 time=0.002
15:56:17-784804 WARNING  Server shutdown requested
15:56:18-561939 INFO     Server restarting...
15:56:18-949506 INFO     Server will restart
15:56:21-833008 DEBUG    Memory: 0.6/31.91 collected=9713
15:56:21-835508 DEBUG    Starting module: <module 'webui' from 'F:\\stable\\automatic\\webui.py'>
15:56:21-838009 INFO     Command line args: ['--debug'] debug=True
15:56:21-840009 DEBUG    Env flags: []
15:56:21-842510 DEBUG    Entering start sequence
15:56:21-847511 DEBUG    Initializing
15:56:21-851511 INFO     Available VAEs: path="models\VAE" items=1
15:56:21-854511 INFO     Disabled extensions: ['sd-webui-controlnet']
15:56:21-858512 DEBUG    Scanning diffusers cache: folder=models\Diffusers items=0 time=0.00
15:56:21-861513 DEBUG    Read: file="metadata.json" json=12 bytes=17040 time=0.001
15:56:21-869514 INFO     Available models: path="models\Stable-diffusion" items=1 time=0.01
15:56:21-872515 DEBUG    Load extensions
15:56:21-965030 DEBUG    Extensions init time: 0.09
15:56:21-968531 DEBUG    Upscaler type=ESRGAN folder="models\ESRGAN" model="ESRGAN_4x" path="models\ESRGAN\ESRGAN_4x.pth"
15:56:21-974032 DEBUG    Upscaler type=SwinIR folder="models\SwinIR" model="SwinIR_4x" path="models\SwinIR\SwinIR_4x.pth"
15:56:21-977033 DEBUG    Read: file="extensions-builtin\sd-extension-chainner\models.json" json=24 bytes=2719 time=0.000
15:56:21-982034 DEBUG    chaiNNer models: path="models\chaiNNer" defined=24 discovered=0 downloaded=0
15:56:21-986034 DEBUG    Load upscalers: total=54 downloaded=3 user=2 time=0.02 ['None', 'Lanczos', 'Nearest', 'ESRGAN', 'LDSR', 'RealESRGAN', 'SCUNet', 'SD', 'SwinIR', 'ChaiNNer']
15:56:22-025041 DEBUG    Load styles: folder="models\styles" items=288 time=0.03
15:56:22-027542 DEBUG    Creating UI
15:56:22-029041 INFO     UI theme: name="black-teal" style=Auto base=sdnext.css
15:56:22-046545 DEBUG    UI initialize: txt2img
15:56:22-096054 DEBUG    Extra networks: page='model' items=37 subfolders=2 tab=txt2img folders=['models\\Stable-diffusion', 'models\\Diffusers', 'models\\Reference'] list=0.01 thumb=0.00 desc=0.00 info=0.00 workers=4
15:56:22-152063 DEBUG    Extra networks: page='style' items=288 subfolders=1 tab=txt2img folders=['models\\styles', 'html'] list=0.03 thumb=0.00 desc=0.00 info=0.00 workers=4
15:56:22-157064 DEBUG    Extra networks: page='embedding' items=0 subfolders=0 tab=txt2img folders=['models\\embeddings'] list=0.00 thumb=0.00 desc=0.00 info=0.00 workers=4
15:56:22-162066 DEBUG    Extra networks: page='hypernetwork' items=0 subfolders=0 tab=txt2img folders=['models\\hypernetworks'] list=0.00 thumb=0.00 desc=0.00 info=0.00 workers=4
15:56:22-167066 DEBUG    Extra networks: page='vae' items=1 subfolders=0 tab=txt2img folders=['models\\VAE'] list=0.00 thumb=0.00 desc=0.00 info=0.00 workers=4
15:56:22-172067 DEBUG    Extra networks: page='lora' items=0 subfolders=0 tab=txt2img folders=['models\\Lora', 'models\\LyCORIS'] list=0.00 thumb=0.00 desc=0.00 info=0.00 workers=4
15:56:22-260082 DEBUG    UI initialize: img2img
15:56:22-381103 DEBUG    UI initialize: control models=models\control
15:56:22-658651 DEBUG    Read: file="ui-config.json" json=0 bytes=2 time=0.000
15:56:22-766670 DEBUG    Themes: builtin=12 gradio=5 huggingface=0
15:56:23-511300 INFO     Extension list is empty: refresh required
15:56:24-191418 DEBUG    Extension list: processed=7 installed=7 enabled=6 disabled=1 visible=7 hidden=0
15:56:24-706007 DEBUG    Root paths: ['F:\\stable\\automatic']
15:56:24-806525 INFO     Local URL: http://127.0.0.1:7860/
15:56:24-808525 DEBUG    Gradio functions: registered=2348
15:56:24-811026 DEBUG    FastAPI middleware: ['Middleware', 'Middleware']
15:56:24-813526 DEBUG    Creating API
15:56:24-927046 INFO     [AgentScheduler] Task queue is empty
15:56:24-930547 INFO     [AgentScheduler] Registering APIs
15:56:25-194092 DEBUG    Scripts setup: ['IP Adapters:0.037', 'AnimateDiff:0.023', 'Prompt Matrix:0.009', 'Prompts from File:0.007', 'X/Y/Z Grid:0.03', 'Face:0.031', 'BLIP Diffusion:0.006', 'Differential diffusion:0.006',
                         'Image-to-Video:0.016', 'LEdits++:0.009', 'Outpainting:0.005', 'Stable Video Diffusion:0.012']
15:56:25-200094 DEBUG    Save: file="metadata.json" json=13 bytes=16655 time=0.001
15:56:25-203094 INFO     Model metadata saved: file="metadata.json" items=1 time=0.00
15:56:25-206095 DEBUG    Model requested: fn=<lambda>
15:56:25-208094 WARNING  Selected checkpoint not found: dreamshaper_8 [879db523c3]
15:56:25-210095 INFO     Select: model="dreamshaper_631BakedVae"
15:56:25-212095 DEBUG    Load model: existing=False target=F:\stable\automatic\models\Stable-diffusion\dreamshaper_631BakedVae.safetensors info=None
15:56:25-216096 INFO     Torch override dtype: no-half set
15:56:25-217597 INFO     Torch override VAE dtype: no-half set
15:56:25-219097 DEBUG    Desired Torch parameters: dtype=FP32 no-half=True no-half-vae=True upscast=False
15:56:25-221597 INFO     Setting Torch parameters: device=cpu dtype=torch.float32 vae=torch.float32 unet=torch.float32 context=no_grad fp16=None bf16=None optimization=Scaled-Dot-Product
15:56:25-224597 DEBUG    Diffusers loading: path="F:\stable\automatic\models\Stable-diffusion\dreamshaper_631BakedVae.safetensors"
15:56:25-226598 INFO     Diffusers: model="ONNX Stable Diffusion" class=OnnxStableDiffusionPipeline file="F:\stable\automatic\models\Stable-diffusion\dreamshaper_631BakedVae.safetensors" size=5687MB
15:56:27-813548 INFO     MOTD: N/A
15:56:30-857577 INFO     Browser session: user=None client=127.0.0.1 agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 Edg/123.0.0.0
15:56:42-778650 DEBUG    Setting model: pipeline=OnnxRawPipeline config={'low_cpu_mem_usage': True, 'torch_dtype': torch.float32, 'load_connected_pipeline': True, 'extract_ema': True, 'use_safetensors': True}
Calculating hash: F:\stable\automatic\models\Stable-diffusion\dreamshaper_631BakedVae.safetensors ---------------------------------------- 6.0/6.0 GB 0:00:00
15:56:48-261103 DEBUG    Save: file="cache.json" json=2 bytes=675 time=0.000
15:56:48-264603 ERROR    Failed to load diffusers model
15:56:48-266104 ERROR    loading Diffusers model: ValueError
┌──────────────────────────────────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ F:\stable\automatic\modules\sd_models.py:1093 in load_diffuser                                                                                                                                                                             │
│                                                                                                                                                                                                                                            │
│   1092 │   │   else:                                                                                                                                                                                                                       │
│ > 1093 │   │   │   move_model(sd_model, devices.device)                                                                                                                                                                                    │
│   1094                                                                                                                                                                                                                                     │
│                                                                                                                                                                                                                                            │
│ F:\stable\automatic\modules\sd_models.py:763 in move_model                                                                                                                                                                                 │
│                                                                                                                                                                                                                                            │
│    762 │   debug_move(f'Model move: device={device} class={model.__class__} accelerate={getattr(model, "has_accelerate", False)} fn={sys._getframe(1).f_code.co_name}') # pylint: disable=protected-access                                 │
│ >  763 │   if hasattr(model, "components"): # accelerate patch                                                                                                                                                                             │
│    764 │   │   for name, m in model.components.items():                                                                                                                                                                                    │
│                                                                                                                                                                                                                                            │
│ F:\stable\automatic\venv\lib\site-packages\diffusers\pipelines\pipeline_utils.py:1504 in components                                                                                                                                        │
│                                                                                                                                                                                                                                            │
│   1503 │   │   if set(components.keys()) != expected_modules:                                                                                                                                                                              │
│ > 1504 │   │   │   raise ValueError(                                                                                                                                                                                                       │
│   1505 │   │   │   │   f"{self} has been incorrectly initialized or {self.__class__} is incorrectly implemented. Expected"                                                                                                                 │
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
ValueError: OnnxRawPipeline {
  "_class_name": "OnnxRawPipeline",
  "_diffusers_version": "0.27.0"
}
 has been incorrectly initialized or <class 'modules.onnx_impl.pipelines.OnnxRawPipeline'> is incorrectly implemented. Expected {'constructor', 'path'} to be defined, but dict_keys([]) are defined.
15:56:48-599662 INFO     Load embeddings: loaded=0 skipped=0 time=0.00
15:56:48-952723 DEBUG    GC: collected=13 device=cpu {'ram': {'used': 4.64, 'total': 31.91}} time=0.35
15:56:48-956224 INFO     Load model: time=23.39 load=23.39 native=0 {'ram': {'used': 4.64, 'total': 31.91}}
15:56:48-960225 DEBUG    Script callback init time: image_browser.py:ui_tabs=1.37 system-info.py:app_started=0.45 task_scheduler.py:app_started=0.46
15:56:48-962225 DEBUG    Save: file="config.json" json=37 bytes=1603 time=0.002
15:56:48-965725 INFO     Startup time: 80.80 ldm=53.68 extensions=0.09 ui-en=0.26 ui-txt2img=0.06 ui-img2img=0.08 ui-control=0.13 ui-settings=0.28 ui-extensions=1.30 ui-defaults=0.42 launch=0.18 app-started=0.37 checkpoint=23.77

Cont of Log during image generation.

15:57:59-638513 DEBUG    Server: alive=True jobs=3 requests=67 uptime=158 memory=0.68/31.91 backend=Backend.DIFFUSERS state=idle
15:59:59-551862 DEBUG    Server: alive=True jobs=3 requests=67 uptime=278 memory=0.68/31.91 backend=Backend.DIFFUSERS state=idle
16:02:00-472387 DEBUG    Server: alive=True jobs=3 requests=67 uptime=399 memory=0.68/31.91 backend=Backend.DIFFUSERS state=idle
16:04:00-385736 DEBUG    Server: alive=True jobs=3 requests=67 uptime=519 memory=0.68/31.91 backend=Backend.DIFFUSERS state=idle
16:06:00-299084 DEBUG    Server: alive=True jobs=3 requests=67 uptime=639 memory=0.68/31.91 backend=Backend.DIFFUSERS state=idle
16:08:00-210933 DEBUG    Server: alive=True jobs=3 requests=67 uptime=759 memory=0.68/31.91 backend=Backend.DIFFUSERS state=idle
16:10:00-124282 DEBUG    Server: alive=True jobs=3 requests=67 uptime=878 memory=0.68/31.91 backend=Backend.DIFFUSERS state=idle
16:12:00-037632 DEBUG    Server: alive=True jobs=3 requests=67 uptime=998 memory=0.68/31.91 backend=Backend.DIFFUSERS state=idle
16:13:31-729074 ERROR    Invalid styles: -1
16:13:31-731074 ERROR    Invalid styles: -1
16:13:38-320720 INFO     MOTD: N/A
16:13:41-495272 DEBUG    Themes: builtin=12 gradio=5 huggingface=0
16:13:42-844007 INFO     Browser session: user=None client=127.0.0.1 agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 Edg/123.0.0.0
16:13:59-946980 DEBUG    Server: alive=True jobs=3 requests=207 uptime=1118 memory=0.68/31.91 backend=Backend.DIFFUSERS state=idle
16:14:39-631380 ERROR    Exception: OnnxRawPipeline {
                           "_class_name": "OnnxRawPipeline",
                           "_diffusers_version": "0.27.0"
                         }
                          has been incorrectly initialized or <class 'modules.onnx_impl.pipelines.OnnxRawPipeline'> is incorrectly implemented. Expected {'constructor', 'path'} to be defined, but dict_keys([]) are defined.
16:14:39-636381 ERROR    Arguments: args=('task(25k6ocgx6e9rcss)', 'the most beautiful artwork in the world,abstract art oil painting\n', 'blury, glitchy, glitch, warped, malformed', [], 20, 0, 0, True, False, False, 1, 1, 6, 6, 0.7, 0,
                         1, 1, -1.0, -1.0, 0, 0, 0, 512, 512, False, 0.3, 2, 'None', False, 20, 0, 0, 10, 0, '', '', 0, 0, 0, 0, False, 4, 0.95, False, 0.6, 1, '#000000', 0, [], 0, 1, 'None', 'None', 'None', 'None', 0.5, 0.5, 0.5, 0.5,
                         None, None, None, None, 0, 0, 0, 0, 1, 1, 1, 1, 'None', 16, 'None', 1, True, 'None', 2, True, 1, 0, True, 'none', 3, 4, 0.25, 0.25, 3, 1, 1, 0.8, 8, 64, True, 1, 1, 0.5, 0.5, False, False, 'positive', 'comma', 0,
                         False, False, '', 'None', '', 1, '', 'None', True, 0, 'None', 2, True, 1, 0, 0, '', [], 0, '', [], 0, '', [], False, True, False, False, False, False, 0, 'None', [], 'FaceID Base', True, True, 1, 1, 1, 0.5, False,
                         'person', 1, 0.5, True) kwargs={}
16:14:39-662885 ERROR    gradio call: ValueError
┌──────────────────────────────────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ F:\stable\automatic\modules\call_queue.py:31 in f                                                                                                                                                                                          │
│                                                                                                                                                                                                                                            │
│   30 │   │   │   try:                                                                                                                                                                                                                      │
│ > 31 │   │   │   │   res = func(*args, **kwargs)                                                                                                                                                                                           │
│   32 │   │   │   │   progress.record_results(id_task, res)                                                                                                                                                                                 │
│                                                                                                                                                                                                                                            │
│ F:\stable\automatic\modules\txt2img.py:88 in txt2img                                                                                                                                                                                       │
│                                                                                                                                                                                                                                            │
│   87 │   if processed is None:                                                                                                                                                                                                             │
│ > 88 │   │   processed = processing.process_images(p)                                                                                                                                                                                      │
│   89 │   p.close()                                                                                                                                                                                                                         │
│                                                                                                                                                                                                                                            │
│ F:\stable\automatic\modules\processing.py:193 in process_images                                                                                                                                                                            │
│                                                                                                                                                                                                                                            │
│   192 │   │   │   with context_hypertile_vae(p), context_hypertile_unet(p):                                                                                                                                                                │
│ > 193 │   │   │   │   processed = process_images_inner(p)                                                                                                                                                                                  │
│   194                                                                                                                                                                                                                                      │
│                                                                                                                                                                                                                                            │
│ F:\stable\automatic\modules\processing.py:305 in process_images_inner                                                                                                                                                                      │
│                                                                                                                                                                                                                                            │
│   304 │   │   │   │   │   from modules.processing_diffusers import process_diffusers                                                                                                                                                       │
│ > 305 │   │   │   │   │   x_samples_ddim = process_diffusers(p)                                                                                                                                                                            │
│   306 │   │   │   │   else:                                                                                                                                                                                                                │
│                                                                                                                                                                                                                                            │
│ F:\stable\automatic\modules\processing_diffusers.py:392 in process_diffusers                                                                                                                                                               │
│                                                                                                                                                                                                                                            │
│   391 │                                                                                                                                                                                                                                    │
│ > 392 │   sd_models.move_model(shared.sd_model, devices.device)                                                                                                                                                                            │
│   393 │   sd_models_compile.openvino_recompile_model(p, hires=False, refiner=False) # recompile if a parameter changes                                                                                                                     │
│                                                                                                                                                                                                                                            │
│ F:\stable\automatic\modules\sd_models.py:763 in move_model                                                                                                                                                                                 │
│                                                                                                                                                                                                                                            │
│    762 │   debug_move(f'Model move: device={device} class={model.__class__} accelerate={getattr(model, "has_accelerate", False)} fn={sys._getframe(1).f_code.co_name}') # pylint: disable=protected-access                                 │
│ >  763 │   if hasattr(model, "components"): # accelerate patch                                                                                                                                                                             │
│    764 │   │   for name, m in model.components.items():                                                                                                                                                                                    │
│                                                                                                                                                                                                                                            │
│ F:\stable\automatic\venv\lib\site-packages\diffusers\pipelines\pipeline_utils.py:1504 in components                                                                                                                                        │
│                                                                                                                                                                                                                                            │
│   1503 │   │   if set(components.keys()) != expected_modules:                                                                                                                                                                              │
│ > 1504 │   │   │   raise ValueError(                                                                                                                                                                                                       │
│   1505 │   │   │   │   f"{self} has been incorrectly initialized or {self.__class__} is incorrectly implemented. Expected"                                                                                                                 │
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
ValueError: OnnxRawPipeline {
  "_class_name": "OnnxRawPipeline",
  "_diffusers_version": "0.27.0"
}
 has been incorrectly initialized or <class 'modules.onnx_impl.pipelines.OnnxRawPipeline'> is incorrectly implemented. Expected {'constructor', 'path'} to be defined, but dict_keys([]) are defined.

Backend

Diffusers

Branch

Master

Model

SD 1.5

Acknowledgements

HackdaNorth commented 7 months ago

I believe the fix to be applied within the dev branch. I am reattempting with dev branch.

I recently found this discord post within support-forum outlining the fix, my apologies.

HackdaNorth commented 7 months ago

Dev branch solved the issue. Had to also untick "Full quality" in advanced tab, other than that fully functional.