YanWenKun / ComfyUI-Docker

🐳Dockerfile for 🎨ComfyUI. | 容器镜像与启动脚本
https://hub.docker.com/r/yanwk/comfyui-boot
Other
467 stars 87 forks source link

The default `SD 1.5` model? #27

Closed liusida closed 7 months ago

liusida commented 7 months ago

I've started the docker and headed to the web GUI, but when I press "Queue Prompt", this error shows up:

Error occurred when executing CheckpointLoaderSimple:

'model.diffusion_model.input_blocks.0.0.weight'

File "/home/runner/ComfyUI/execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/ComfyUI/execution.py", line 81, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/ComfyUI/execution.py", line 74, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/ComfyUI/nodes.py", line 516, in load_checkpoint
out = comfy.sd.load_checkpoint_guess_config(ckpt_path, output_vae=True, output_clip=True, embedding_directory=folder_paths.get_folder_paths("embeddings"))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/ComfyUI/comfy/sd.py", line 507, in load_checkpoint_guess_config
model_config = model_detection.model_config_from_unet(sd, "model.diffusion_model.")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/ComfyUI/comfy/model_detection.py", line 194, in model_config_from_unet
unet_config = detect_unet_config(state_dict, unet_key_prefix)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/ComfyUI/comfy/model_detection.py", line 78, in detect_unet_config
model_channels = state_dict['{}input_blocks.0.0.weight'.format(key_prefix)].shape[0]
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I realized that the default SD 1.5 model is not there; instead, the default one is SD 2.1-unclip-small. I manually downloaded the default SD 1.5, and everything works. So I wonder why SD 2.1-unclip-small was chosen as the default? And why was I running into such an error?

YanWenKun commented 7 months ago

This was fixed yesterday, just now I pushed a new image. The checkpoints folder will leave empty and people will aware. Models could be downloaded via ComfyUI-Manager or manually from https://civitai.com/ & https://huggingface.co/ & https://www.liblib.art/

liusida commented 7 months ago

Thanks for the quick response.

I think I might need to write my own ./storage/scripts/pre-start.sh to download whatever I need, right?

Is there a template or example that I can refer to for writing this script?

YanWenKun commented 7 months ago

As mentioned in #28, give a try to megapak !

But ./storage/scripts/pre-start.sh can do it too, for example:

#!/bin/bash

echo "[INFO] Downloading my favorite models..."

cd /home/runner/ComfyUI/models
aria2c \
  --input-file=/home/runner/scripts/download-my-fav-models.txt \
  --allow-overwrite=false \
  --auto-file-renaming=false \
  --continue=true \
  --max-connection-per-server=5

And ./storage/scripts/download-my-fav-models.txt :

# Comments
https://huggingface.co/playgroundai/playground-v2.5-1024px-aesthetic/resolve/main/playground-v2.5-1024px-aesthetic.fp16.safetensors
  dir=checkpoints
  out=playground-v2.5-1024px-aesthetic.fp16.safetensors
https://huggingface.co/cagliostrolab/animagine-xl-3.1/resolve/main/animagine-xl-3.1.safetensors?download=true
  dir=checkpoints/sdxl
  out=animagine-xl-3.1.safetensors

A side note: batch-download from CivitAI sometimes reports error, so I prefer downloading from Huggingface, as you see in download.txt

liusida commented 7 months ago

Cool, thanks~