Getting disconnected from the server
Hi there, I love Kritta Diffusion but for a while now I've had this issue where the live painting process will fail after a while. I didn't initially have this problem, but now I can't seem to get it to work.
I'm on a windows 11 machine with a Geforce 4090 GPU.
I'm on the latest version of the plugin and the issue has persisted through the last few versions.
I appreciate any help as it's breaking my Krita flow.
Here's a log from right after I got disconnected:
2024-10-23 10:11:28,579 ERROR Couldn't subscribe to shared workflows: 'Already subscribed' (Error transferring http://127.0.0.1:8188/api/etn/workflow/subscribe - server replied: Bad Request) 2024-10-23 10:13:16,088 INFO Stopping server 2024-10-23 10:13:16,424 ERROR Server process terminated with code 1 2024-10-23 10:13:17,986 INFO Starting server with python -su -Xutf8 main.py 2024-10-23 10:13:20,620 INFO Connecting to http://127.0.0.1:8188 2024-10-23 10:13:21,143 INFO Optional Text Encoder model clip_l for All not found (search path: clip_l) 2024-10-23 10:13:21,143 INFO Optional Text Encoder model clip_g for All not found (search path: clip_g) 2024-10-23 10:13:21,143 INFO Optional Text Encoder model t5 for All not found (search path: t5) 2024-10-23 10:13:21,143 INFO Optional Text Encoder model clip_l for All not found (search path: clip_l) 2024-10-23 10:13:21,143 INFO Optional Text Encoder model clip_g for All not found (search path: clip_g) 2024-10-23 10:13:21,143 INFO Optional Text Encoder model t5 for All not found (search path: t5) 2024-10-23 10:13:21,143 INFO Optional Image Encoder (VAE) model default for SD 1.5 not found (search path: vae-ft-mse-840000-ema) 2024-10-23 10:13:21,143 INFO Optional Image Encoder (VAE) model default for SD XL not found (search path: sdxl_vae) 2024-10-23 10:13:21,143 INFO Optional Image Encoder (VAE) model default for Flux not found (search path: ae.s) 2024-10-23 10:13:21,144 INFO Found ControlNet model inpaint for SD 1.5: control_v11p_sd15_inpaint_fp16.safetensors 2024-10-23 10:13:21,144 INFO Optional ControlNet model inpaint for Flux not found (search path: flux.1-dev-controlnet-inpaint) 2024-10-23 10:13:21,144 INFO Found ControlNet model universal for SD XL: xinsir-controlnet-union-sdxl-1.0-promax.safetensors 2024-10-23 10:13:21,144 INFO Found ControlNet model scribble for SD 1.5: control_lora_rank128_v11p_sd15_scribble_fp16.safetensors 2024-10-23 10:13:21,144 INFO Optional ControlNet model scribble for SD XL not found (search path: xinsirscribble, scribble-sdxl, mistoline_fp16, mistoline_rank, control-lora-sketch-rank, sai_xl_sketch_) 2024-10-23 10:13:21,144 INFO Found ControlNet model line_art for SD 1.5: control_v11p_sd15_lineart_fp16.safetensors 2024-10-23 10:13:21,144 INFO Optional ControlNet model line_art for SD XL not found (search path: xinsirscribble, mistoline_fp16, mistoline_rank, scribble-sdxl, control-lora-sketch-rank, sai_xl_sketch_) 2024-10-23 10:13:21,144 INFO Optional ControlNet model line_art for Flux not found (search path: mistoline_flux) 2024-10-23 10:13:21,144 INFO Found ControlNet model soft_edge for SD 1.5: control_v11p_sd15_softedge_fp16.safetensors 2024-10-23 10:13:21,144 INFO Optional ControlNet model soft_edge for SD XL not found (search path: mistoline_fp16, mistoline_rank, xinsirscribble, scribble-sdxl) 2024-10-23 10:13:21,144 INFO Optional ControlNet model soft_edge for Flux not found (search path: mistoline_flux) 2024-10-23 10:13:21,144 INFO Found ControlNet model canny_edge for SD 1.5: control_v11p_sd15_canny_fp16.safetensors 2024-10-23 10:13:21,144 INFO Optional ControlNet model canny_edge for SD XL not found (search path: xinsircanny, canny-sdxlcontrol-lora-canny-rank, sai_xl_canny_) 2024-10-23 10:13:21,144 INFO Optional ControlNet model canny_edge for Flux not found (search path: flux-canny, mistoline_flux) 2024-10-23 10:13:21,144 INFO Found ControlNet model depth for SD 1.5: control_lora_rank128_v11f1p_sd15_depth_fp16.safetensors 2024-10-23 10:13:21,145 INFO Optional ControlNet model depth for SD XL not found (search path: xinsirdepth, depth-sdxl, control-lora-depth-rank, sai_xl_depth_) 2024-10-23 10:13:21,145 INFO Optional ControlNet model depth for Flux not found (search path: flux-depth) 2024-10-23 10:13:21,145 INFO Found ControlNet model normal for SD 1.5: control_lora_rank128_v11p_sd15_normalbae_fp16.safetensors 2024-10-23 10:13:21,145 INFO Found ControlNet model pose for SD 1.5: control_lora_rank128_v11p_sd15_openpose_fp16.safetensors 2024-10-23 10:13:21,145 INFO Optional ControlNet model pose for SD XL not found (search path: xinsiropenpose, openpose-sdxl, control-lora-openposexl2-rank, thibaud_xl_openpose) 2024-10-23 10:13:21,145 INFO Found ControlNet model segmentation for SD 1.5: control_lora_rank128_v11p_sd15_seg_fp16.safetensors 2024-10-23 10:13:21,145 INFO Optional ControlNet model segmentation for SD XL not found (search path: sdxl_segmentation_ade20k_controlnet) 2024-10-23 10:13:21,145 INFO Found ControlNet model blur for SD 1.5: control_lora_rank128_v11f1e_sd15_tile_fp16.safetensors 2024-10-23 10:13:21,145 INFO Optional ControlNet model blur for SD XL not found (search path: xinsirtile, tile-sdxl, ttplanetsdxlcontrolnet, ttplanet_sdxl_controlnet_tile_realistic, ttplanet_controlnet_tile_realistic) 2024-10-23 10:13:21,145 INFO Optional ControlNet model blur for Flux not found (search path: flux.1-dev-controlnet-upscale) 2024-10-23 10:13:21,145 INFO Found ControlNet model stencil for SD 1.5: control_v1p_sd15_qrcode_monster.safetensors 2024-10-23 10:13:21,145 INFO Optional ControlNet model stencil for SD XL not found (search path: sdxl_qrcode_monster) 2024-10-23 10:13:21,145 INFO Found ControlNet model hands for SD 1.5: control_sd15_inpaint_depth_hand_fp16.safetensors 2024-10-23 10:13:21,145 INFO Optional ControlNet model hands for SD XL not found (search path: control-lora-depth-rank, sai_xl_depth_) 2024-10-23 10:13:21,145 INFO Found CLIP Vision model ip_adapter for All: clip-vision_vit-h.safetensors 2024-10-23 10:13:21,145 INFO Found IP-Adapter model reference for SD 1.5: ip-adapter_sd15.safetensors 2024-10-23 10:13:21,145 INFO Found IP-Adapter model reference for SD XL: ip-adapter_sdxl_vit-h.safetensors 2024-10-23 10:13:21,146 INFO Found IP-Adapter model face for SD 1.5: ip-adapter-faceid-plusv2_sd15.bin 2024-10-23 10:13:21,146 INFO Found IP-Adapter model face for SD XL: ip-adapter-faceid-plusv2_sdxl.bin 2024-10-23 10:13:21,146 INFO Found Upscale model default for All: 4x_NMKD-Superscale-SP_178000_G.pth 2024-10-23 10:13:21,146 INFO Found Upscale model fast_2x for All: OmniSR_X2_DIV2K.safetensors 2024-10-23 10:13:21,146 INFO Found Upscale model fast_3x for All: OmniSR_X3_DIV2K.safetensors 2024-10-23 10:13:21,146 INFO Found Upscale model fast_4x for All: OmniSR_X4_DIV2K.safetensors 2024-10-23 10:13:21,146 INFO Found Inpaint model default for All: MAT_Places512_G_fp16.safetensors 2024-10-23 10:13:21,146 INFO Found Inpaint model fooocus_head for SD XL: fooocus_inpaint_head.pth 2024-10-23 10:13:21,146 INFO Found Inpaint model fooocus_patch for SD XL: inpaint_v26.fooocus.patch 2024-10-23 10:13:21,146 INFO Found LoRA model hyper for SD 1.5: Hyper-SD15-8steps-CFG-lora.safetensors 2024-10-23 10:13:21,146 INFO Found LoRA model hyper for SD XL: Hyper-SDXL-8steps-CFG-lora.safetensors 2024-10-23 10:13:21,146 INFO Optional LoRA model lcm for SD 1.5 not found (search path: lcm-lora-sdv1-5.safetensors, lcm/sd1.5/pytorch_lora_weights.safetensors) 2024-10-23 10:13:21,146 INFO Optional LoRA model lcm for SD XL not found (search path: lcm-lora-sdxl.safetensors, lcm/sdxl/pytorch_lora_weights.safetensors) 2024-10-23 10:13:21,146 INFO Found LoRA model face for SD 1.5: ip-adapter-faceid-plusv2_sd15_lora.safetensors 2024-10-23 10:13:21,146 INFO Found LoRA model face for SD XL: ip-adapter-faceid-plusv2_sdxl_lora.safetensors 2024-10-23 10:13:21,146 INFO Optional LoRA model lightning for SD XL not found (search path: sdxl_lightning_8step_lora) 2024-10-23 10:13:21,266 INFO GGUF support: 0 models found. 2024-10-23 10:13:21,266 INFO SD 1.5: supported 2024-10-23 10:13:21,266 INFO SD XL: supported 2024-10-23 10:13:21,266 INFO SD 3: missing 3 models 2024-10-23 10:13:21,266 INFO Flux: missing 1 models 2024-10-23 10:15:27,143 WARNING Error processing message, error=argument of type 'NoneType' is not iterable, msg={'type': 'executed', 'data': {'node': '16', 'display_node': '16', 'output': None, 'prompt_id': '70454953-815d-4a88-8807-2ebbe90f0c0e'}} 2024-10-23 10:15:27,143 WARNING Error processing message, error=argument of type 'NoneType' is not iterable, msg={'type': 'executed', 'data': {'node': '15', 'display_node': '15', 'output': None, 'prompt_id': '70454953-815d-4a88-8807-2ebbe90f0c0e'}} 2024-10-23 10:15:32,475 ERROR Unhandled exception in websocket listener Traceback (most recent call last): File "C:\Users\Martin Nebelong\AppData\Roaming\krita\pykrita\ai_diffusion\comfy_client.py", line 235, in _listen await self._listen_websocket(websocket) File "C:\Users\Martin Nebelong\AppData\Roaming\krita\pykrita\ai_diffusion\comfy_client.py", line 260, in _listen_websocket image = _extract_message_png_image(memoryview(msg)) File "C:\Users\Martin Nebelong\AppData\Roaming\krita\pykrita\ai_diffusion\comfy_client.py", line 722, in _extract_message_png_image return Image.from_bytes(data[s:]) File "C:\Users\Martin Nebelong\AppData\Roaming\krita\pykrita\ai_diffusion\image.py", line 356, in from_bytes assert img and not img.isNull(), "Failed to load image from memory" AssertionError: Failed to load image from memory 2024-10-23 10:15:34,204 ERROR Couldn't subscribe to shared workflows: 'Already subscribed' (Error transferring http://127.0.0.1:8188/api/etn/workflow/subscribe - server replied: Bad Request) 2024-10-23 10:15:37,955 WARNING Started job e35291c3-bba9-4e94-af2e-df1d638616a9, but Job[local=47016174-35f2-47ef-85ac-84a143bb5197, remote=70454953-815d-4a88-8807-2ebbe90f0c0e] was never finished 2024-10-23 10:17:19,744 ERROR Unhandled exception in websocket listener Traceback (most recent call last): File "C:\Users\Martin Nebelong\AppData\Roaming\krita\pykrita\ai_diffusion\comfy_client.py", line 235, in _listen await self._listen_websocket(websocket) File "C:\Users\Martin Nebelong\AppData\Roaming\krita\pykrita\ai_diffusion\comfy_client.py", line 260, in _listen_websocket image = _extract_message_png_image(memoryview(msg)) File "C:\Users\Martin Nebelong\AppData\Roaming\krita\pykrita\ai_diffusion\comfy_client.py", line 722, in _extract_message_png_image return Image.from_bytes(data[s:]) File "C:\Users\Martin Nebelong\AppData\Roaming\krita\pykrita\ai_diffusion\image.py", line 356, in from_bytes assert img and not img.isNull(), "Failed to load image from memory" AssertionError: Failed to load image from memory 2024-10-23 10:17:20,142 ERROR Couldn't subscribe to shared workflows: 'Already subscribed' (Error transferring http://127.0.0.1:8188/api/etn/workflow/subscribe - server replied: Bad Request)
Is there anything in particular required for the error to occur, like using control layers or model architecture (SD1.5 or SDXL...), high resolution?
If it's sporadic it will be hard to reproduce. I've added some more detail to the error message, but the main reason it fails is unclear. The plugin receives some data from the server which should be an image, but appears to be incomplete or corrupt.
Something like that might happen when using an unstable internet connection, but it looks like you're running everything on the same PC.
Hey @Acly, thanks for getting back. This seems to happen consistently with both Sd1.5 and SDXL, mainly at high resolution (1920x1080). I'm running everything locally. In previous versions I didn't seem to have the same issue, even with high res.
Can I do anything else to give you a better idea of what's causing this?
@Acly I have the same problem when I try to generate with Flux model. So it seems that this might be a memory issue? It didn't happen on v1.25.0
@Acly I've just remembered that recently I changed settings of pagefile.sys. After I changed them back to defualt (size is managed by the system itself) the issue with disconnecting server is gone.
The pagefile is set to default here so something else seems to be going on at my end at least.. glad you fixed your issue piotr :D
I made the error handling more informative in 1.27.0, but probably won't entirely fix the problem. Maybe it will give a hint. Not quite sure what else to try
Thanks @Acly. I just tried the latest build and still experience the issue. I've attached some log-files from the last session:
The tool writes a "disconnected from server" message when the issue appears.
@Acly can you gather anything from the Logs? It's really sad that the disconnection breaks the live painting flow for me.. I love that part of Krita Diffusion! Really appreciate any help on the issue.
Not really, it just can't read the images that are being sent.
I also tried live painting for a while (keeping it running with automatic changes) at 1920x1080 resolution but didn't encounter any disconnects, so don't really have any new ideas.
Technically it's possible to ignore the error and hope that the next images will work again, making it less disruptive. But the problem is that it will also silently ignore actual issues and provide no feedback if something isn't working at all.
Hi there I just updated to latest 1.31.2 and got the same problem, reset the virtual memory to system managed never solved the problem, but It's working well with 1.1x plugin last year on the same machine, this is the client log,