camenduru / stable-diffusion-webui-colab

stable diffusion webui colab
The Unlicense
15.47k stars 2.61k forks source link

[Bug]: model loading bug #375

Closed feitianpig closed 1 year ago

feitianpig commented 1 year ago

What happened?

run in colab run.ipynb I want to load these models, downloaded them, but did not load, still loaded the original models. image image image image

and i want to load controlnet models in colab,Is it right to write like this? image image

Colab cell output

/content
Drive already mounted at /content/drive; to attempt to forcibly remount, call drive.mount("/content/drive", force_remount=True).
env: PYTHONDONTWRITEBYTECODE=1
env: TF_CPP_MIN_LOG_LEVEL=1
30 packages can be upgraded. Run 'apt list --upgradable' to see them.
--2023-04-21 03:56:22--  http://launchpadlibrarian.net/367274644/libgoogle-perftools-dev_2.5-2.2ubuntu3_amd64.deb
Resolving launchpadlibrarian.net (launchpadlibrarian.net)... 185.125.189.229, 185.125.189.228, 2620:2d:4000:1001::8007, ...
Connecting to launchpadlibrarian.net (launchpadlibrarian.net)|185.125.189.229|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 203696 (199K) [application/x-debian-package]
Saving to: ‘libgoogle-perftools-dev_2.5-2.2ubuntu3_amd64.deb’

libgoogle-perftools 100%[===================>] 198.92K   380KB/s    in 0.5s    

2023-04-21 03:56:23 (380 KB/s) - ‘libgoogle-perftools-dev_2.5-2.2ubuntu3_amd64.deb’ saved [203696/203696]

--2023-04-21 03:56:23--  https://launchpad.net/ubuntu/+source/google-perftools/2.5-2.2ubuntu3/+build/14795286/+files/google-perftools_2.5-2.2ubuntu3_all.deb
Resolving launchpad.net (launchpad.net)... 185.125.189.222, 185.125.189.223, 2620:2d:4000:1001::8003, ...
Connecting to launchpad.net (launchpad.net)|185.125.189.222|:443... connected.
HTTP request sent, awaiting response... 303 See Other
Location: https://launchpadlibrarian.net/367274642/google-perftools_2.5-2.2ubuntu3_all.deb [following]
--2023-04-21 03:56:23--  https://launchpadlibrarian.net/367274642/google-perftools_2.5-2.2ubuntu3_all.deb
Resolving launchpadlibrarian.net (launchpadlibrarian.net)... 185.125.189.228, 185.125.189.229, 2620:2d:4000:1001::8007, ...
Connecting to launchpadlibrarian.net (launchpadlibrarian.net)|185.125.189.228|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 294224 (287K) [application/x-debian-package]
Saving to: ‘google-perftools_2.5-2.2ubuntu3_all.deb’

google-perftools_2. 100%[===================>] 287.33K   487KB/s    in 0.6s    

2023-04-21 03:56:25 (487 KB/s) - ‘google-perftools_2.5-2.2ubuntu3_all.deb’ saved [294224/294224]

--2023-04-21 03:56:25--  https://launchpad.net/ubuntu/+source/google-perftools/2.5-2.2ubuntu3/+build/14795286/+files/libtcmalloc-minimal4_2.5-2.2ubuntu3_amd64.deb
Resolving launchpad.net (launchpad.net)... 185.125.189.223, 185.125.189.222, 2620:2d:4000:1001::8004, ...
Connecting to launchpad.net (launchpad.net)|185.125.189.223|:443... connected.
HTTP request sent, awaiting response... 303 See Other
Location: https://launchpadlibrarian.net/367274648/libtcmalloc-minimal4_2.5-2.2ubuntu3_amd64.deb [following]
--2023-04-21 03:56:25--  https://launchpadlibrarian.net/367274648/libtcmalloc-minimal4_2.5-2.2ubuntu3_amd64.deb
Resolving launchpadlibrarian.net (launchpadlibrarian.net)... 185.125.189.229, 185.125.189.228, 2620:2d:4000:1001::8007, ...
Connecting to launchpadlibrarian.net (launchpadlibrarian.net)|185.125.189.229|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 91644 (89K) [application/x-debian-package]
Saving to: ‘libtcmalloc-minimal4_2.5-2.2ubuntu3_amd64.deb’

libtcmalloc-minimal 100%[===================>]  89.50K   280KB/s    in 0.3s    

2023-04-21 03:56:26 (280 KB/s) - ‘libtcmalloc-minimal4_2.5-2.2ubuntu3_amd64.deb’ saved [91644/91644]

--2023-04-21 03:56:26--  https://launchpad.net/ubuntu/+source/google-perftools/2.5-2.2ubuntu3/+build/14795286/+files/libgoogle-perftools4_2.5-2.2ubuntu3_amd64.deb
Resolving launchpad.net (launchpad.net)... 185.125.189.222, 185.125.189.223, 2620:2d:4000:1001::8003, ...
Connecting to launchpad.net (launchpad.net)|185.125.189.222|:443... connected.
HTTP request sent, awaiting response... 303 See Other
Location: https://launchpadlibrarian.net/367274647/libgoogle-perftools4_2.5-2.2ubuntu3_amd64.deb [following]
--2023-04-21 03:56:27--  https://launchpadlibrarian.net/367274647/libgoogle-perftools4_2.5-2.2ubuntu3_amd64.deb
Resolving launchpadlibrarian.net (launchpadlibrarian.net)... 185.125.189.228, 185.125.189.229, 2620:2d:4000:1001::8007, ...
Connecting to launchpadlibrarian.net (launchpadlibrarian.net)|185.125.189.228|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 189628 (185K) [application/x-debian-package]
Saving to: ‘libgoogle-perftools4_2.5-2.2ubuntu3_amd64.deb’

libgoogle-perftools 100%[===================>] 185.18K   386KB/s    in 0.5s    

2023-04-21 03:56:28 (386 KB/s) - ‘libgoogle-perftools4_2.5-2.2ubuntu3_amd64.deb’ saved [189628/189628]

libunwind-dev is already the newest version (1.2.1-9ubuntu0.1).
0 upgraded, 0 newly installed, 0 to remove and 30 not upgraded.
(Reading database ... 122585 files and directories currently installed.)
Preparing to unpack google-perftools_2.5-2.2ubuntu3_all.deb ...
Unpacking google-perftools (2.5-2.2ubuntu3) over (2.5-2.2ubuntu3) ...
Preparing to unpack libgoogle-perftools4_2.5-2.2ubuntu3_amd64.deb ...
Unpacking libgoogle-perftools4 (2.5-2.2ubuntu3) over (2.5-2.2ubuntu3) ...
Preparing to unpack libgoogle-perftools-dev_2.5-2.2ubuntu3_amd64.deb ...
Unpacking libgoogle-perftools-dev (2.5-2.2ubuntu3) over (2.5-2.2ubuntu3) ...
Preparing to unpack libtcmalloc-minimal4_2.5-2.2ubuntu3_amd64.deb ...
Unpacking libtcmalloc-minimal4 (2.5-2.2ubuntu3) over (2.5-2.2ubuntu3) ...
Setting up libtcmalloc-minimal4 (2.5-2.2ubuntu3) ...
Setting up libgoogle-perftools4 (2.5-2.2ubuntu3) ...
Setting up libgoogle-perftools-dev (2.5-2.2ubuntu3) ...
Setting up google-perftools (2.5-2.2ubuntu3) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.9) ...
env: LD_PRELOAD=libtcmalloc.so
aria2 is already the newest version (1.35.0-1build1).
0 upgraded, 0 newly installed, 0 to remove and 30 not upgraded.
unionfs-fuse is already the newest version (1.0-1ubuntu2).
0 upgraded, 0 newly installed, 0 to remove and 30 not upgraded.
Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/, https://download.pytorch.org/whl/cu116
Requirement already satisfied: torch==1.13.1+cu116 in /usr/local/lib/python3.9/dist-packages (1.13.1+cu116)
Requirement already satisfied: torchvision==0.14.1+cu116 in /usr/local/lib/python3.9/dist-packages (0.14.1+cu116)
Requirement already satisfied: torchaudio==0.13.1 in /usr/local/lib/python3.9/dist-packages (0.13.1+cu116)
Requirement already satisfied: torchtext==0.14.1 in /usr/local/lib/python3.9/dist-packages (0.14.1)
Requirement already satisfied: torchdata==0.5.1 in /usr/local/lib/python3.9/dist-packages (0.5.1)
Requirement already satisfied: typing-extensions in /usr/local/lib/python3.9/dist-packages (from torch==1.13.1+cu116) (4.5.0)
Requirement already satisfied: requests in /usr/local/lib/python3.9/dist-packages (from torchvision==0.14.1+cu116) (2.25.1)
Requirement already satisfied: pillow!=8.3.*,>=5.3.0 in /usr/local/lib/python3.9/dist-packages (from torchvision==0.14.1+cu116) (9.4.0)
Requirement already satisfied: numpy in /usr/local/lib/python3.9/dist-packages (from torchvision==0.14.1+cu116) (1.23.3)
Requirement already satisfied: tqdm in /usr/local/lib/python3.9/dist-packages (from torchtext==0.14.1) (4.65.0)
Requirement already satisfied: portalocker>=2.0.0 in /usr/local/lib/python3.9/dist-packages (from torchdata==0.5.1) (2.7.0)
Requirement already satisfied: urllib3>=1.25 in /usr/local/lib/python3.9/dist-packages (from torchdata==0.5.1) (1.26.15)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.9/dist-packages (from requests->torchvision==0.14.1+cu116) (2022.12.7)
Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.9/dist-packages (from requests->torchvision==0.14.1+cu116) (2.10)
Requirement already satisfied: chardet<5,>=3.0.2 in /usr/local/lib/python3.9/dist-packages (from requests->torchvision==0.14.1+cu116) (4.0.0)
mkdir: cannot create directory ‘/content/fused-models’: File exists
mkdir: cannot create directory ‘/content/models’: File exists
mkdir: cannot create directory ‘/content/fused-lora’: File exists
mkdir: cannot create directory ‘/content/lora’: File exists
mkdir: cannot create directory ‘/content/fused-vae’: File exists
mkdir: cannot create directory ‘/content/vae’: File exists
mkdir: cannot create directory ‘/content/fused-controlnetmodels’: File exists
fuse: mountpoint is not empty
fuse: if you are sure this is safe, use the 'nonempty' mount option
fuse: mountpoint is not empty
fuse: if you are sure this is safe, use the 'nonempty' mount option
fuse: mountpoint is not empty
fuse: if you are sure this is safe, use the 'nonempty' mount option
/content/drive/MyDrive/stable-diffusion-webui-colab/stable-diffusion-webui
Updating files: 100% (200/200), done.
HEAD is now at a9fed7c3 Merge pull request #8503 from mcmonkey4eva/filename-length-limit-fix
Updating files: 100% (96/96), done.
HEAD is now at 47b6b60 Merge pull request #39 from CookieLau/patch-1
HEAD is now at 709b8a0 Update ssh_tunnel.py
Already up to date.

Download Results:
gid   |stat|avg speed  |path/URI
======+====+===========+=======================================================
b746f7|OK  |   133MiB/s|/content/controlnetmodels/coadapter-canny-sd15v1.pth

Status Legend:
(OK):download completed.

Download Results:
gid   |stat|avg speed  |path/URI
======+====+===========+=======================================================
b6642f|OK  |   181MiB/s|/content/controlnetmodels/coadapter-depth-sd15v1.pth

Status Legend:
(OK):download completed.

Download Results:
gid   |stat|avg speed  |path/URI
======+====+===========+=======================================================
8708c7|OK  |   236MiB/s|/content/controlnetmodels/control_hed-fp16.safetensors

Status Legend:
(OK):download completed.

Download Results:
gid   |stat|avg speed  |path/URI
======+====+===========+=======================================================
ba6d0e|OK  |   249MiB/s|/content/controlnetmodels/control_mlsd-fp16.safetensors

Status Legend:
(OK):download completed.

Download Results:
gid   |stat|avg speed  |path/URI
======+====+===========+=======================================================
fb2687|OK  |   164MiB/s|/content/controlnetmodels/control_normal-fp16.safetensors

Status Legend:
(OK):download completed.

Download Results:
gid   |stat|avg speed  |path/URI
======+====+===========+=======================================================
05b0ce|OK  |    41MiB/s|/content/controlnetmodels/t2iadapter_openpose_sd14v1.pth

Status Legend:
(OK):download completed.

Download Results:
gid   |stat|avg speed  |path/URI
======+====+===========+=======================================================
af8751|OK  |   182MiB/s|/content/controlnetmodels/control_scribble-fp16.safetensors

Status Legend:
(OK):download completed.

Download Results:
gid   |stat|avg speed  |path/URI
======+====+===========+=======================================================
d10807|OK  |    78MiB/s|/content/controlnetmodels/t2iadapter_seg_sd14v1.pth

Status Legend:
(OK):download completed.

Download Results:
gid   |stat|avg speed  |path/URI
======+====+===========+=======================================================
dd8557|OK  |    87MiB/s|/content/controlnetmodels/t2iadapter_color-fp16.safetensors

Status Legend:
(OK):download completed.

Download Results:
gid   |stat|avg speed  |path/URI
======+====+===========+=======================================================
776df5|OK  |    99MiB/s|/content/controlnetmodels/t2iadapter_keypose-fp16.safetensors

Status Legend:
(OK):download completed.

Download Results:
gid   |stat|avg speed  |path/URI
======+====+===========+=======================================================
b08a36|OK  |    91MiB/s|/content/controlnetmodels/t2iadapter_sketch-fp16.safetensors

Status Legend:
(OK):download completed.

Download Results:
gid   |stat|avg speed  |path/URI
======+====+===========+=======================================================
6be2cc|OK  |    25MiB/s|/content/controlnetmodels/t2iadapter_style-fp16.safetensors

Status Legend:
(OK):download completed.

Download Results:
gid   |stat|avg speed  |path/URI
======+====+===========+=======================================================
04aff8|OK  |   116MiB/s|/content/controlnetmodels/t2iadapter_zoedepth_sd15v1.pth

Status Legend:
(OK):download completed.

Download Results:
gid   |stat|avg speed  |path/URI
======+====+===========+=======================================================
50fec3|OK  |    37MiB/s|/content/controlnetmodels/coadapter-fuser-sd15v1.pth

Status Legend:
(OK):download completed.

Download Results:
gid   |stat|avg speed  |path/URI
======+====+===========+=======================================================
3ef2f9|OK  |       0B/s|/content/models/revAnimated_v12.safetensors

Status Legend:
(OK):download completed.

Download Results:
gid   |stat|avg speed  |path/URI
======+====+===========+=======================================================
9bfde2|OK  |       0B/s|/content/vae/vae-ft-mse-840000-ema-pruned.ckpt

Status Legend:
(OK):download completed.
Python 3.9.16 (main, Dec  7 2022, 01:11:51) 
[GCC 9.4.0]
Commit hash: a9fed7c364061ae6efb37f797b6b522cb3cf7aa2
Installing requirements for Web UI

Launching Web UI with arguments: --listen --xformers --enable-insecure-extension-access --theme dark --gradio-queue --clip-models-path /content/drive/MyDrive/stable-diffusion-webui-colab/stable-diffusion-webui/models/CLIP --ckpt-dir /content/fused --lora-dir /content/fused-lora --multiple
2023-04-21 03:58:14.904640: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
Downloading: "https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors" to /content/drive/MyDrive/stable-diffusion-webui-colab/stable-diffusion-webui/models/Stable-diffusion/v1-5-pruned-emaonly.safetensors

100% 3.97G/3.97G [01:20<00:00, 53.2MB/s]
Additional Network extension not installed, Only hijack built-in lora
LoCon Extension hijack built-in lora successfully
[AddNet] Updating model hashes...
0it [00:00, ?it/s]
[AddNet] Updating model hashes...
0it [00:00, ?it/s]
all detected, remote.moe trying to connect...
all detected, cloudflared trying to connect...
Checkpoint v1-5-pruned-emaonly.safetensors [6ce0161689] not found; loading fallback v1-5-pruned-emaonly.safetensors
Calculating sha256 for /content/drive/MyDrive/stable-diffusion-webui-colab/stable-diffusion-webui/models/Stable-diffusion/v1-5-pruned-emaonly.safetensors: 6ce0161689b3853acaa03779ec93eafe75a02f4ced659bee03f50797806fa2fa
Loading weights [6ce0161689] from /content/drive/MyDrive/stable-diffusion-webui-colab/stable-diffusion-webui/models/Stable-diffusion/v1-5-pruned-emaonly.safetensors
Creating model from config: /content/drive/MyDrive/stable-diffusion-webui-colab/stable-diffusion-webui/configs/v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Couldn't find VAE named vae-ft-mse-840000-ema-pruned.ckpt; using None instead
Applying xformers cross attention optimization.
Textual inversion embeddings loaded(26): ng_deepnegative_v1_75t, EasyNegative, bad-artist-anime, bad_prompt_version2, bad-hands-5, bad-image-v2-39000, bad-artist, style-rustmagic, hobbithouse, isometric_dreams, magicalinterior, style-sylvamagic, style-nebmagic, style_tombraider, kristen, krface1, corneo_dva, gunslinger, yamato_5000, akii_marie_rose, corneo_tifa_classic, flower_style, vslinx_nel, pastel_style, Style-Autumn, style-miaozu-20000
Textual inversion embeddings skipped(3): dblx, cartoonish_doll, 21charturnerv2
Model loaded in 64.9s (calculate hash: 37.7s, load weights from disk: 1.0s, create model: 11.7s, apply weights to model: 13.9s, load textual inversion embeddings: 0.4s).
*Deforum ControlNet support: enabled*
Public WebUI Colab URL: http://i3aguryr4l372iewj7pndylcnxrkmdn2birhz2hrbjqsbf3r4z5q.remote.moe 
Public WebUI Colab URL: https://b3424d62-39cd-46bf.gradio.live 
Public WebUI Colab URL: https://b22b8fb87ec679.lhr.life
Public WebUI Colab URL: https://pvc-sauce-value-heart.trycloudflare.com
Startup time: 185.0s (import gradio: 3.2s, import ldm: 10.2s, other imports: 5.1s, list extensions: 2.7s, list SD models: 80.7s, setup codeformer: 0.4s, load scripts: 13.0s, load SD checkpoint: 65.0s, create ui: 4.4s, gradio launch: 0.2s).

Which colab and model(s) were you using when the error occurred?

colab https://huggingface.co/hanafuusen2001/ReVAnimated/resolve/main/revAnimated_v12.safetensors https://huggingface.co/Yukihime256/840000/resolve/main/vae-ft-mse-840000-ema-pruned.ckpt

https://huggingface.co/TencentARC/T2I-Adapter/resolve/main/models/coadapter-canny-sd15v1.pth https://huggingface.co/TencentARC/T2I-Adapter/resolve/main/models/coadapter-depth-sd15v1.pth https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/main/control_hed-fp16.safetensors https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/main/control_mlsd-fp16.safetensors https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/main/control_normal-fp16.safetensors https://huggingface.co/TencentARC/T2I-Adapter/resolve/main/models/t2iadapter_openpose_sd14v1.pth https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/main/control_scribble-fp16.safetensors https://huggingface.co/TencentARC/T2I-Adapter/resolve/main/models/t2iadapter_seg_sd14v1.pth https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/main/t2iadapter_color-fp16.safetensors https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/main/t2iadapter_keypose-fp16.safetensors https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/main/t2iadapter_sketch-fp16.safetensors https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/main/t2iadapter_style-fp16.safetensors https://huggingface.co/TencentARC/T2I-Adapter/resolve/main/models/t2iadapter_zoedepth_sd15v1.pth https://huggingface.co/TencentARC/T2I-Adapter/resolve/main/models/coadapter-fuser-sd15v1.pth

Which Public WebUI Colab URL were you using when the error occurred?

trycloudflare.com

If you used HiRes mode when the error occurred, please provide the Hires info

No response

Anonimouche commented 1 year ago

So what you are tryying to do is downloading models to your drive and loading them in the colab or downloading models into the colab directly? But it seems like you put all models in the incorrect folder so the webUI have no idea where they are and they're not loading.

feitianpig commented 1 year ago

Thank you for your reply,And thank you so much for sharing. sorry,my english is not good, sometimes I want to downloading models into the colab directly if the models more than 7G,sometimes  downloading models into the drive,For example the lora. I don't know if I made that clear  

々Ж.ぁ隆.& @.***

 

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2023年4月22日(星期六) 晚上7:37 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [camenduru/stable-diffusion-webui-colab] [Bug]: model loading bug (Issue #375)

So what you are tryying to do is downloading models to your drive and loading them in the colab or downloading models into the colab directly?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

Anonimouche commented 1 year ago

So I never did drive installation but I think to download something to your drive you would need to use it like this: !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M {YourLink} -d /content/drive/MyDrive/examplefolder1/examplefolder2 -o {name of your file} And one to the VM would be like: !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M {YourLink} -d /content/examplefolder1/examplefolder2 -o {name of your file}

I'm not familiar with unionfs and Drive integration in the colab but here's an example that i think would work: image So in this example lora1 would be downloaded to your drive and lora 2 would be downloaded to the VM drive, then it would fuse them in the test2 folder and then can be accessed at launch. If you want the models in the test2 folder to be detected you would need to add the argument: "--lora-dir /content/test2" . This argument would indicate that the folder it should be looking for when looking for loras is test2

You can also use "--ckpt-dir YourModelFolder" to set a model folder it needs to use

For your controlnet models, you are forced to have them in your drive if you want to use them.