lllyasviel / sd-forge-layerdiffuse

[WIP] Layer Diffusion for WebUI (via Forge)
Apache License 2.0
3.79k stars 327 forks source link

DLL failed while importing _pydantic_core #124

Closed DiegoRRR closed 1 month ago

DiegoRRR commented 1 month ago

I am trying to use the last version of Forge. (The old version works perfectly but I want to use the updated Layer Diffusion extension that fixes img2img and it needs the last version.)

So I downloaded and extracted "webui_forge_cu121_torch21.7z" from 11 august 2024.

For I use Windows 7 I replaced the incompatible embed python with PythonWin7 3.10.14 embed, I copied it from my working old Forge folder. I replaced only the python files at the root, not the folders.

It starts, downloads and installs some requirements... then I have a weird error about "_pydantic_core" that I never had and don't understand...

Can someone help, please?

Here is the console output:

Python 3.10.14 (main, Mar 20 2024, 16:10:51) [MSC v.1939 64 bit (AMD64)]
Version: f2.0.1v1.10.1-previous-219-g885ea650
Commit hash: 885ea650dd69dbdd1380ea311736e26c71c59ffb
Installing clip
Installing open_clip
Cloning huggingface_guess into D:\apps\stable-diffusion\Forge_20240811\webui\rep
ositories\huggingface_guess...
Cloning into 'D:\apps\stable-diffusion\Forge_20240811\webui\repositories\hugging
face_guess'...
remote: Enumerating objects: 42, done.
remote: Counting objects: 100% (42/42), done.
remote: Compressing objects: 100% (29/29), done.
remote: Total 42 (delta 23), reused 32 (delta 13), pack-reused 0 (from 0)
ng objects:  64% (27/42)
Receiving objects: 100% (42/42), 35.40 KiB | 1.22 MiB/s, done.
Resolving deltas: 100% (23/23), done.
Installing requirements
Installing forge_legacy_preprocessor requirement: fvcore
Installing forge_legacy_preprocessor requirement: mediapipe
Installing forge_legacy_preprocessor requirement: svglib
Installing forge_legacy_preprocessor requirement: handrefinerportable
Launching Web UI with arguments: --skip-torch-cuda-test
Traceback (most recent call last):
  File "D:\apps\stable-diffusion\Forge_20240811\webui\launch.py", line 51, in <m
odule>
    main()
  File "D:\apps\stable-diffusion\Forge_20240811\webui\launch.py", line 47, in ma
in
    start()
  File "D:\apps\stable-diffusion\Forge_20240811\webui\modules\launch_utils.py",
line 544, in start
    import webui
  File "D:\apps\stable-diffusion\Forge_20240811\webui\webui.py", line 14, in <mo
dule>
    from modules_forge.forge_canvas.canvas import canvas_js_root_path
  File "D:\apps\stable-diffusion\Forge_20240811\webui\modules_forge\forge_canvas
\canvas.py", line 6, in <module>
    import gradio.component_meta
  File "D:\apps\stable-diffusion\Forge_20240811\system\python\lib\site-packages\
gradio\__init__.py", line 3, in <module>
    import gradio._simple_templates
  File "D:\apps\stable-diffusion\Forge_20240811\system\python\lib\site-packages\
gradio\_simple_templates\__init__.py", line 1, in <module>
    from .simpledropdown import SimpleDropdown
  File "D:\apps\stable-diffusion\Forge_20240811\system\python\lib\site-packages\
gradio\_simple_templates\simpledropdown.py", line 6, in <module>
    from gradio.components.base import Component, FormComponent
  File "D:\apps\stable-diffusion\Forge_20240811\system\python\lib\site-packages\
gradio\components\__init__.py", line 1, in <module>
    from gradio.components.annotated_image import AnnotatedImage
  File "D:\apps\stable-diffusion\Forge_20240811\system\python\lib\site-packages\
gradio\components\annotated_image.py", line 13, in <module>
    from gradio import processing_utils, utils
  File "D:\apps\stable-diffusion\Forge_20240811\system\python\lib\site-packages\
gradio\processing_utils.py", line 22, in <module>
    from gradio import utils, wasm_utils
  File "D:\apps\stable-diffusion\Forge_20240811\system\python\lib\site-packages\
gradio\utils.py", line 56, in <module>
    from gradio.data_classes import BlocksConfigDict, FileData
  File "D:\apps\stable-diffusion\Forge_20240811\system\python\lib\site-packages\
gradio\data_classes.py", line 13, in <module>
    from fastapi import Request
  File "D:\apps\stable-diffusion\Forge_20240811\system\python\lib\site-packages\
fastapi\__init__.py", line 7, in <module>
    from .applications import FastAPI as FastAPI
  File "D:\apps\stable-diffusion\Forge_20240811\system\python\lib\site-packages\
fastapi\applications.py", line 16, in <module>
    from fastapi import routing
  File "D:\apps\stable-diffusion\Forge_20240811\system\python\lib\site-packages\
fastapi\routing.py", line 22, in <module>
    from fastapi import params
  File "D:\apps\stable-diffusion\Forge_20240811\system\python\lib\site-packages\
fastapi\params.py", line 5, in <module>
    from fastapi.openapi.models import Example
  File "D:\apps\stable-diffusion\Forge_20240811\system\python\lib\site-packages\
fastapi\openapi\models.py", line 4, in <module>
    from fastapi._compat import (
  File "D:\apps\stable-diffusion\Forge_20240811\system\python\lib\site-packages\
fastapi\_compat.py", line 20, in <module>
    from fastapi.exceptions import RequestErrorModel
  File "D:\apps\stable-diffusion\Forge_20240811\system\python\lib\site-packages\
fastapi\exceptions.py", line 3, in <module>
    from pydantic import BaseModel, create_model
  File "D:\apps\stable-diffusion\Forge_20240811\system\python\lib\site-packages\
pydantic\__init__.py", line 404, in __getattr__
    module = import_module(module_name, package=package)
  File "importlib\__init__.py", line 126, in import_module
  File "D:\apps\stable-diffusion\Forge_20240811\system\python\lib\site-packages\
pydantic\main.py", line 27, in <module>
    import pydantic_core
  File "D:\apps\stable-diffusion\Forge_20240811\system\python\lib\site-packages\
pydantic_core\__init__.py", line 6, in <module>
    from ._pydantic_core import (
ImportError: DLL load failed while importing _pydantic_core: La procédure spécif
iée est introuvable.

I tried to reinstall pydantic, from system/python/scripts/ I ran: pip install -U pydantic it said

Requirement already satisfied: pydantic in d:\apps\stable-diffusion\forge_202408
11\system\python\lib\site-packages (2.8.2)
Requirement already satisfied: annotated-types>=0.4.0 in d:\apps\stable-diffusio
n\forge_20240811\system\python\lib\site-packages (from pydantic) (0.7.0)
Requirement already satisfied: pydantic-core==2.20.1 in d:\apps\stable-diffusion
\forge_20240811\system\python\lib\site-packages (from pydantic) (2.20.1)
Requirement already satisfied: typing-extensions>=4.6.1 in d:\apps\stable-diffus
ion\forge_20240811\system\python\lib\site-packages (from pydantic) (4.9.0)
DiegoRRR commented 1 month ago

Oops, posted this by error in sd-forge-layerdiffuse instead of forge.