Acly / krita-ai-diffusion

Streamlined interface for generating images with AI in Krita. Inpaint and outpaint with optional text prompt, no tweaking required.
https://www.interstice.cloud
GNU General Public License v3.0
6.85k stars 334 forks source link

Line art Controlnet Server execution error: Error while deserializing header: MetadataIncompleteBuffer #609

Closed YBGTA closed 7 months ago

YBGTA commented 7 months ago

Edit: now its every single controlnet model!

when ever I try to use controlnet line art model for a image it throws a error as stated in title, I tried to reinstall the comfyui server but still persists, am I going about using the layers when generating?

Server Log: 2024-04-11 18:02:54,345 INFO Total VRAM 8192 MB, total RAM 32050 MB 2024-04-11 18:02:54,345 INFO Set vram state to: NORMAL_VRAM 2024-04-11 18:02:54,345 INFO Device: cuda:0 NVIDIA GeForce RTX 2080 : cudaMallocAsync 2024-04-11 18:02:54,345 INFO VAE dtype: torch.float32 2024-04-11 18:02:55,505 INFO Using pytorch cross attention 2024-04-11 18:02:56,314 INFO [comfyui_controlnet_aux] | INFO -> Using ckpts path: C:\Users\koolg\AppData\Roaming\krita\ai_diffusion\server\ComfyUI\custom_nodes\comfyui_controlnet_aux\ckpts 2024-04-11 18:02:56,314 INFO [comfyui_controlnet_aux] | INFO -> Using symlinks: False 2024-04-11 18:02:56,314 INFO [comfyui_controlnet_aux] | INFO -> Using ort providers: ['CUDAExecutionProvider', 'DirectMLExecutionProvider', 'OpenVINOExecutionProvider', 'ROCMExecutionProvider', 'CPUExecutionProvider', 'CoreMLExecutionProvider'] 2024-04-11 18:02:56,597 INFO C:\Users\koolg\AppData\Roaming\krita\ai_diffusion\server\ComfyUI\custom_nodes\comfyui_controlnet_aux\node_wrappers\dwpose.py:26: UserWarning: DWPose: Onnxruntime not found or doesn't come with acceleration providers, switch to OpenCV with CPU device. DWPose might run very slowly 2024-04-11 18:02:56,597 INFO warnings.warn("DWPose: Onnxruntime not found or doesn't come with acceleration providers, switch to OpenCV with CPU device. DWPose might run very slowly") 2024-04-11 18:02:56,630 INFO 2024-04-11 18:02:56,630 INFO Import times for custom nodes: 2024-04-11 18:02:56,630 INFO 0.0 seconds: C:\Users\koolg\AppData\Roaming\krita\ai_diffusion\server\ComfyUI\custom_nodes\comfyui-tooling-nodes 2024-04-11 18:02:56,630 INFO 0.0 seconds: C:\Users\koolg\AppData\Roaming\krita\ai_diffusion\server\ComfyUI\custom_nodes\comfyui-inpaint-nodes 2024-04-11 18:02:56,630 INFO 0.0 seconds: C:\Users\koolg\AppData\Roaming\krita\ai_diffusion\server\ComfyUI\custom_nodes\ComfyUI_UltimateSDUpscale 2024-04-11 18:02:56,630 INFO 0.0 seconds: C:\Users\koolg\AppData\Roaming\krita\ai_diffusion\server\ComfyUI\custom_nodes\ComfyUI_IPAdapter_plus 2024-04-11 18:02:56,631 INFO 0.3 seconds: C:\Users\koolg\AppData\Roaming\krita\ai_diffusion\server\ComfyUI\custom_nodes\comfyui_controlnet_aux 2024-04-11 18:02:56,631 INFO 2024-04-11 18:02:56,631 INFO Starting server 2024-04-11 18:02:56,631 INFO 2024-04-11 18:02:56,631 INFO To see the GUI go to: http://127.0.0.1:8188 2024-04-11 18:02:57,722 INFO got prompt 2024-04-11 18:02:57,722 INFO !!! Exception during processing !!! 2024-04-11 18:02:57,722 INFO Traceback (most recent call last): 2024-04-11 18:02:57,722 INFO File "C:\Users\koolg\AppData\Roaming\krita\ai_diffusion\server\ComfyUI\execution.py", line 151, in recursive_execute 2024-04-11 18:02:57,723 INFO output_data, output_ui = get_output_data(obj, input_data_all) 2024-04-11 18:02:57,723 INFO File "C:\Users\koolg\AppData\Roaming\krita\ai_diffusion\server\ComfyUI\execution.py", line 81, in get_output_data 2024-04-11 18:02:57,723 INFO return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) 2024-04-11 18:02:57,723 INFO File "C:\Users\koolg\AppData\Roaming\krita\ai_diffusion\server\ComfyUI\execution.py", line 74, in map_node_over_list 2024-04-11 18:02:57,723 INFO results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) 2024-04-11 18:02:57,723 INFO File "C:\Users\koolg\AppData\Roaming\krita\ai_diffusion\server\ComfyUI\nodes.py", line 541, in load_checkpoint 2024-04-11 18:02:57,724 INFO out = comfy.sd.load_checkpoint_guess_config(ckpt_path, output_vae=True, output_clip=True, embedding_directory=folder_paths.get_folder_paths("embeddings")) 2024-04-11 18:02:57,724 INFO File "C:\Users\koolg\AppData\Roaming\krita\ai_diffusion\server\ComfyUI\comfy\sd.py", line 495, in load_checkpoint_guess_config 2024-04-11 18:02:57,724 INFO sd = comfy.utils.load_torch_file(ckpt_path) 2024-04-11 18:02:57,724 INFO File "C:\Users\koolg\AppData\Roaming\krita\ai_diffusion\server\ComfyUI\comfy\utils.py", line 14, in load_torch_file 2024-04-11 18:02:57,724 INFO sd = safetensors.torch.load_file(ckpt, device=device.type) 2024-04-11 18:02:57,724 INFO File "C:\Users\koolg\AppData\Roaming\krita\ai_diffusion\server\python\lib\site-packages\safetensors\torch.py", line 308, in load_file 2024-04-11 18:02:57,725 INFO with safe_open(filename, framework="pt", device=device) as f: 2024-04-11 18:02:57,725 INFO safetensors_rust.SafetensorError: Error while deserializing header: MetadataIncompleteBuffer 2024-04-11 18:02:57,725 INFO 2024-04-11 18:02:57,725 INFO Prompt executed in 0.00 seconds

Client Log: 2024-04-11 18:02:51,199 INFO Extension initialized, Version: 1.16.1, Python: 3.10.7 (tags/v3.10.7:6cc6b13, Sep 5 2022, 14:08:36) [MSC v.1933 64 bit (AMD64)] 2024-04-11 18:02:51,199 INFO Loading settings from C:\Users\koolg\AppData\Roaming\krita\ai_diffusion\settings.json 2024-04-11 18:02:51,200 INFO Found server installation v1.16.0 at C:\Users\koolg\AppData\Roaming\krita\ai_diffusion\server 2024-04-11 18:02:52,488 INFO Starting server with python -su -Xutf8 main.py 2024-04-11 18:02:56,643 INFO Connecting to http://127.0.0.1:8188 2024-04-11 18:02:56,721 INFO Found ControlNet model inpaint for SD 1.5: control_v11p_sd15_inpaint_fp16.safetensors 2024-04-11 18:02:56,721 INFO Found ControlNet model scribble for SD 1.5: control_lora_rank128_v11p_sd15_scribble_fp16.safetensors 2024-04-11 18:02:56,722 INFO Optional ControlNet model scribble for SD XL not found (search path: control-lora-sketch-rank, sai_xlsketch) 2024-04-11 18:02:56,722 INFO Found ControlNet model line_art for SD 1.5: control_v11p_sd15_lineart_fp16.safetensors 2024-04-11 18:02:56,723 INFO Optional ControlNet model line_art for SD XL not found (search path: control-lora-sketch-rank, sai_xlsketch) 2024-04-11 18:02:56,723 INFO Found ControlNet model soft_edge for SD 1.5: control_v11p_sd15_softedge_fp16.safetensors 2024-04-11 18:02:56,723 INFO Found ControlNet model canny_edge for SD 1.5: control_v11p_sd15_canny_fp16.safetensors 2024-04-11 18:02:56,723 INFO Optional ControlNet model canny_edge for SD XL not found (search path: control-lora-canny-rank, sai_xlcanny) 2024-04-11 18:02:56,723 INFO Found ControlNet model depth for SD 1.5: control_lora_rank128_v11f1p_sd15_depth_fp16.safetensors 2024-04-11 18:02:56,723 INFO Optional ControlNet model depth for SD XL not found (search path: control-lora-depth-rank, sai_xldepth) 2024-04-11 18:02:56,724 INFO Found ControlNet model normal for SD 1.5: control_lora_rank128_v11p_sd15_normalbae_fp16.safetensors 2024-04-11 18:02:56,724 INFO Found ControlNet model pose for SD 1.5: control_lora_rank128_v11p_sd15_openpose_fp16.safetensors 2024-04-11 18:02:56,724 INFO Optional ControlNet model pose for SD XL not found (search path: control-lora-openposexl2-rank, thibaud_xl_openpose) 2024-04-11 18:02:56,724 INFO Found ControlNet model segmentation for SD 1.5: control_lora_rank128_v11p_sd15_seg_fp16.safetensors 2024-04-11 18:02:56,724 INFO Found ControlNet model blur for SD 1.5: control_lora_rank128_v11f1e_sd15_tile_fp16.safetensors 2024-04-11 18:02:56,724 INFO Optional ControlNet model blur for SD XL not found (search path: ttplanetsdxlcontrolnet, ttplanet_sdxl_controlnet_tile_realistic) 2024-04-11 18:02:56,725 INFO Found ControlNet model stencil for SD 1.5: control_v1p_sd15_qrcode_monster.safetensors 2024-04-11 18:02:56,725 INFO Found ControlNet model hands for SD 1.5: control_sd15_inpaint_depth_hand_fp16.safetensors 2024-04-11 18:02:56,725 INFO Optional ControlNet model hands for SD XL not found (search path: control-lora-depth-rank, sai_xldepth) 2024-04-11 18:02:56,725 INFO Found CLIP Vision model ip_adapter for All: clip-vision_vit-h.safetensors 2024-04-11 18:02:56,725 INFO Found IP-Adapter model reference for SD 1.5: ip-adapter_sd15.safetensors 2024-04-11 18:02:56,726 WARNING Missing IP-Adapter model reference for SD XL 2024-04-11 18:02:56,726 INFO -> No model matches search paths: ip-adapter_sdxl_vit-h 2024-04-11 18:02:56,726 INFO -> Available models: ip-adapter-faceid-plusv2_sd15.bin, ip-adapter_sd15.safetensors 2024-04-11 18:02:56,726 INFO Found IP-Adapter model face for SD 1.5: ip-adapter-faceid-plusv2_sd15.bin 2024-04-11 18:02:56,726 INFO Optional IP-Adapter model face for SD XL not found (search path: ip-adapter-faceid-plusv2_sdxl, ip-adapter-faceid_sdxl) 2024-04-11 18:02:56,726 INFO Found Upscale model default for All: 4x_NMKD-Superscale-SP_178000_G.pth 2024-04-11 18:02:56,727 INFO Found Upscale model fast_2x for All: OmniSR_X2_DIV2K.safetensors 2024-04-11 18:02:56,727 INFO Found Upscale model fast_3x for All: OmniSR_X3_DIV2K.safetensors 2024-04-11 18:02:56,727 INFO Found Upscale model fast_4x for All: OmniSR_X4_DIV2K.safetensors 2024-04-11 18:02:56,727 INFO Found Inpaint model default for All: MAT_Places512_G_fp16.safetensors 2024-04-11 18:02:56,727 WARNING Missing Inpaint model fooocus_head for SD XL 2024-04-11 18:02:56,727 INFO -> No model matches search paths: fooocus_inpaint_head.pth 2024-04-11 18:02:56,728 INFO -> Available models: mat_places512_g_fp16.safetensors 2024-04-11 18:02:56,728 WARNING Missing Inpaint model fooocus_patch for SD XL 2024-04-11 18:02:56,728 INFO -> No model matches search paths: inpaint_v26.fooocus.patch 2024-04-11 18:02:56,728 INFO -> Available models: mat_places512_g_fp16.safetensors 2024-04-11 18:02:56,728 INFO Found LoRA model lcm for SD 1.5: lcm-lora-sdv1-5.safetensors 2024-04-11 18:02:56,728 WARNING Missing LoRA model lcm for SD XL 2024-04-11 18:02:56,728 INFO -> No model matches search paths: lcm-lora-sdxl.safetensors, lcm/sdxl/pytorch_lora_weights.safetensors 2024-04-11 18:02:56,729 INFO -> Available models: ip-adapter-faceid-plusv2_sd15_lora.safetensors, lcm-lora-sdv1-5.safetensors 2024-04-11 18:02:56,729 INFO Found LoRA model face for SD 1.5: ip-adapter-faceid-plusv2_sd15_lora.safetensors 2024-04-11 18:02:56,729 INFO Optional LoRA model face for SD XL not found (search path: ip-adapter-faceid-plusv2_sdxl_lora, ip-adapter-faceid_sdxl_lora) 2024-04-11 18:02:56,785 INFO SD 1.5: supported 2024-04-11 18:02:56,785 INFO SD XL: missing 5 models 2024-04-11 18:02:57,847 ERROR Job 479346a5-a936-4619-ba54-99ce7319ad17 failed: Error while deserializing header: MetadataIncompleteBuffer [' File "C:\Users\koolg\AppData\Roaming\krita\ai_diffusion\server\ComfyUI\execution.py", line 151, in recursive_execute\n output_data, output_ui = get_output_data(obj, input_data_all)\n', ' File "C:\Users\koolg\AppData\Roaming\krita\ai_diffusion\server\ComfyUI\execution.py", line 81, in get_output_data\n return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)\n', ' File "C:\Users\koolg\AppData\Roaming\krita\ai_diffusion\server\ComfyUI\execution.py", line 74, in map_node_over_list\n results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))\n', ' File "C:\Users\koolg\AppData\Roaming\krita\ai_diffusion\server\ComfyUI\nodes.py", line 541, in load_checkpoint\n out = comfy.sd.load_checkpoint_guess_config(ckpt_path, output_vae=True, output_clip=True, embedding_directory=folder_paths.get_folder_paths("embeddings"))\n', ' File "C:\Users\koolg\AppData\Roaming\krita\ai_diffusion\server\ComfyUI\comfy\sd.py", line 495, in load_checkpoint_guess_config\n sd = comfy.utils.load_torch_file(ckpt_path)\n', ' File "C:\Users\koolg\AppData\Roaming\krita\ai_diffusion\server\ComfyUI\comfy\utils.py", line 14, in load_torch_file\n sd = safetensors.torch.load_file(ckpt, device=device.type)\n', ' File "C:\Users\koolg\AppData\Roaming\krita\ai_diffusion\server\python\lib\site-packages\safetensors\torch.py", line 308, in load_file\n with safe_open(filename, framework="pt", device=device) as f:\n']

Acly commented 7 months ago

This error usually means a model file is corrupt (not downloaded correctly, maybe due to spotty internet connection).

From the log it looks like it is the checkpoint file you are using, and has nothing to do with controlnet. Does it actually work without controlnet?

Style settings show which checkpoint you're using and allow to open the folder where they are stored. Maybe try to download it manually, some links can be found here

YBGTA commented 7 months ago

Yes the plugin seems to work fine without control net, before my edit it was just line art not working then I must have moved something and caused it to not recognize all models for ControlNet, so I reinstalled for a 2nd time and it fixed it somehow, sorry I'm very new to troubleshooting anything that has to do with SD1.5/XL, thank you for your help and plugin. :)