stable-diffusion-webui-docker icon indicating copy to clipboard operation
stable-diffusion-webui-docker copied to clipboard

Failed to build invoke ui - get "ImportError" on "ModelSearchArguments"

Open points-unknown opened this issue 2 years ago • 3 comments

Has this issue been opened before?

  • [x ] It is not in the FAQ, I checked.
  • [x] It is not in the issues, I searched.

Describe the bug

On building with

docker compose --profile invoke up --build

get the following: image

Which UI

invoke

Hardware / Software

  • OS: Ubuntu 22.04
  • OS version: 22.04.3 LTS
  • Docker Version: 24.0.7
  • Docker compose version: 2.21.0

Steps to Reproduce

  1. type: docker compose --profile invoke up --build
  2. See error

points-unknown avatar Dec 22 '23 22:12 points-unknown

My bet is on huggingface_hub v0.19, which removed ModelSearchArguments completely. Similar to @peacheniya solution for the torchmetrics issue, I went through dependencies and got something like the following in the ./services/invoke/Dockerfile after torchmetrics fix:

RUN --mount=type=cache,target=/root/.cache/pip \
  pip uninstall -y huggingface-hub && \
  pip install huggingface-hub==0.18

RUN --mount=type=cache,target=/root/.cache/pip \
  pip uninstall -y transformers && \
  pip install transformers==4.28

RUN --mount=type=cache,target=/root/.cache/pip \
  pip uninstall -y werkzeug && \
  pip install werkzeug==2.2.2

It does not fix the underlying issue, dependency on the old libraries, but at least makes it runnable.

tired-engineer avatar Jan 11 '24 19:01 tired-engineer

RUN --mount=type=cache,target=/root/.cache/pip
pip uninstall -y huggingface-hub &&
pip install huggingface-hub==0.18

RUN --mount=type=cache,target=/root/.cache/pip
pip uninstall -y transformers &&
pip install transformers==4.28

RUN --mount=type=cache,target=/root/.cache/pip
pip uninstall -y werkzeug &&
pip install werkzeug==2.2.2

Sadly, doesn't work for me. Same error as before.

Hoping now for AbdBarho's fix to be merged.

gitwittidbit avatar Feb 03 '24 17:02 gitwittidbit

To anyone else who runs into this issue before the update comes out, you can patch your copy by changing the following two lines in the middle of the invokeai/Dockerfile after the torchmetrics fix:

#git reset --hard f3b2e02921927d9317255b1c3811f47bd40a2bf9 && \
  git reset --hard dedead672f2e9f995b6b96d7ada37456dab15b55 && \ 

#ARG BRANCH=main SHA=f3b2e02921927d9317255b1c3811f47bd40a2bf9
ARG BRANCH=main SHA=dedead672f2e9f995b6b96d7ada37456dab15b55

And then adding this third line right before COPY . /docker/:

RUN sed -i 's/https:\/\/civitai.com\/api\/download\/models\/63006/https:\/\/huggingface.co\/XpucT\/Loras\/resolve\/main\/LowRA_v2.safetensors?download=true/' invokeai/configs/INITIAL_MODELS.yaml

Apparently the bundled version of InvokeAI tries to pull a model (LowRA) from Civitai that's been removed (apparently the creator didn't like their updated T&Cs) but it seems to also be available on huggingface (LowRA_v2.safetensors)

TotalBogus avatar Mar 06 '24 06:03 TotalBogus