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.41k stars 310 forks source link

Error: division by zero #538

Closed freecoderwaifu closed 5 months ago

freecoderwaifu commented 5 months ago

Screenshot 2024-03-28 112222

Steps to reproduce: Open new canvas Use Live mode Close canvas Open new canvas Error appears

However, the error doesn't appear if Live Mode is stopped before closing the canvas.

Log:

2024-03-28 11:23:43,017 INFO Extension initialized, Version: 1.16.0, Python: 3.10.7 (tags/v3.10.7:6cc6b13, Sep  5 2022, 14:08:36) [MSC v.1933 64 bit (AMD64)]
2024-03-28 11:23:44,217 INFO Connecting to http://127.0.0.1:8188
2024-03-28 11:23:47,514 INFO Found ControlNet model inpaint for SD 1.5: control_v11p_sd15_inpaint_fp16.safetensors
2024-03-28 11:23:47,514 INFO Found ControlNet model scribble for SD 1.5: control_lora_rank128_v11p_sd15_scribble_fp16.safetensors
2024-03-28 11:23:47,514 INFO Found ControlNet model scribble for SD XL: sai_xl_sketch_256lora.safetensors
2024-03-28 11:23:47,514 INFO Found ControlNet model line_art for SD 1.5: control_v11p_sd15_lineart_fp16.safetensors
2024-03-28 11:23:47,515 INFO Found ControlNet model line_art for SD XL: sai_xl_sketch_256lora.safetensors
2024-03-28 11:23:47,515 INFO Found ControlNet model soft_edge for SD 1.5: control_v11p_sd15_softedge_fp16.safetensors
2024-03-28 11:23:47,515 INFO Found ControlNet model canny_edge for SD 1.5: control_v11p_sd15_canny_fp16.safetensors
2024-03-28 11:23:47,515 INFO Found ControlNet model canny_edge for SD XL: sai_xl_canny_256lora.safetensors
2024-03-28 11:23:47,515 INFO Found ControlNet model depth for SD 1.5: control_lora_rank128_v11f1p_sd15_depth_fp16.safetensors
2024-03-28 11:23:47,515 INFO Found ControlNet model depth for SD XL: sai_xl_depth_256lora.safetensors
2024-03-28 11:23:47,516 INFO Found ControlNet model normal for SD 1.5: control_lora_rank128_v11p_sd15_normalbae_fp16.safetensors
2024-03-28 11:23:47,516 INFO Found ControlNet model pose for SD 1.5: control_lora_rank128_v11p_sd15_openpose_fp16.safetensors
2024-03-28 11:23:47,516 INFO Found ControlNet model pose for SD XL: thibaud_xl_openpose_256lora.safetensors
2024-03-28 11:23:47,516 INFO Found ControlNet model segmentation for SD 1.5: control_lora_rank128_v11p_sd15_seg_fp16.safetensors
2024-03-28 11:23:47,516 INFO Found ControlNet model blur for SD 1.5: control_lora_rank128_v11f1e_sd15_tile_fp16.safetensors
2024-03-28 11:23:47,516 INFO Optional ControlNet model blur for SD XL not found (search path: ttplanetsdxlcontrolnet, ttplanet_sdxl_controlnet_tile_realistic)
2024-03-28 11:23:47,516 INFO Found ControlNet model stencil for SD 1.5: control_v1p_sd15_qrcode_monster.safetensors
2024-03-28 11:23:47,516 INFO Found ControlNet model hands for SD 1.5: control_sd15_inpaint_depth_hand_fp16.safetensors
2024-03-28 11:23:47,516 INFO Found ControlNet model hands for SD XL: sai_xl_depth_256lora.safetensors
2024-03-28 11:23:47,516 INFO Found CLIP Vision model ip_adapter for All: SD1.5\model.safetensors
2024-03-28 11:23:47,518 INFO Found IP-Adapter model reference for SD 1.5: ip-adapter_sd15.safetensors
2024-03-28 11:23:47,518 INFO Found IP-Adapter model reference for SD XL: ip-adapter_sdxl_vit-h.safetensors
2024-03-28 11:23:47,518 INFO Found IP-Adapter model face for SD 1.5: ip-adapter-faceid-plusv2_sd15.bin
2024-03-28 11:23:47,518 INFO Found IP-Adapter model face for SD XL: ip-adapter-faceid-plusv2_sdxl.bin
2024-03-28 11:23:47,518 INFO Found Upscale model default for All: 4x_NMKD-Superscale-SP_178000_G.pth
2024-03-28 11:23:47,518 INFO Found Upscale model fast_2x for All: OmniSR_X2_DIV2K.safetensors
2024-03-28 11:23:47,518 INFO Found Upscale model fast_3x for All: OmniSR_X3_DIV2K.safetensors
2024-03-28 11:23:47,518 INFO Found Upscale model fast_4x for All: OmniSR_X4_DIV2K.safetensors
2024-03-28 11:23:47,519 INFO Found Inpaint model default for All: MAT_Places512_G_fp16.safetensors
2024-03-28 11:23:47,519 INFO Found Inpaint model fooocus_head for SD XL: fooocus_inpaint_head.pth
2024-03-28 11:23:47,519 INFO Found Inpaint model fooocus_patch for SD XL: inpaint_v26.fooocus.patch
2024-03-28 11:23:47,530 INFO Found LoRA model lcm for SD 1.5: lcm-lora-sdv1-5.safetensors
2024-03-28 11:23:47,541 INFO Found LoRA model lcm for SD XL: lcm-lora-sdxl.safetensors
2024-03-28 11:23:47,552 INFO Found LoRA model face for SD 1.5: ip-adapter-faceid-plusv2_sd15_lora.safetensors
2024-03-28 11:23:47,563 INFO Found LoRA model face for SD XL: ip-adapter-faceid-plusv2_sdxl_lora.safetensors
2024-03-28 11:23:53,198 INFO SD 1.5: supported
2024-03-28 11:23:53,198 INFO SD XL: supported
2024-03-28 11:23:53,198 INFO No supported styles found, creating default style with checkpoint (0)Mine\basemodelforlorabestquality.safetensors
2024-03-28 11:38:39,234 ERROR Error: division by zero
Traceback (most recent call last):
  File "F:\LIBRARIES\AppData\Roaming\krita\pykrita\ai_diffusion\model.py", line 838, in _report_errors
    return await coro
  File "F:\LIBRARIES\AppData\Roaming\krita\pykrita\ai_diffusion\model.py", line 603, in _continue_generating
    new_input = await self._model._generate_live(self._last_input)
  File "F:\LIBRARIES\AppData\Roaming\krita\pykrita\ai_diffusion\model.py", line 240, in _generate_live
    input = workflow.prepare(
  File "F:\LIBRARIES\AppData\Roaming\krita\pykrita\ai_diffusion\workflow.py", line 850, in prepare
    i.images, i.batch_count = resolution.prepare_image(
  File "F:\LIBRARIES\AppData\Roaming\krita\pykrita\ai_diffusion\resolution.py", line 213, in prepare_image
    scaled, out_image, _, batch = prepare_diffusion_input(
  File "F:\LIBRARIES\AppData\Roaming\krita\pykrita\ai_diffusion\resolution.py", line 166, in prepare_diffusion_input
    min_size, max_size, min_scale, max_scale = CheckpointResolution.compute(
  File "F:\LIBRARIES\AppData\Roaming\krita\pykrita\ai_diffusion\resolution.py", line 138, in compute
    min_scale = math.sqrt(min_pixel_count / extent.pixel_count)
ZeroDivisionError: division by zero

Might also be related to not having the checkpoints for the default styles, despite not using them and setting them to not show


2024-03-28 11:50:38,824 ERROR Error: The checkpoint 'realisticVisionV51_v51VAE.safetensors' used by style 'Cinematic Photo' is not available on the server
Traceback (most recent call last):
  File "F:\LIBRARIES\AppData\Roaming\krita\pykrita\ai_diffusion\model.py", line 838, in _report_errors
    return await coro
  File "F:\LIBRARIES\AppData\Roaming\krita\pykrita\ai_diffusion\model.py", line 603, in _continue_generating
    new_input = await self._model._generate_live(self._last_input)
  File "F:\LIBRARIES\AppData\Roaming\krita\pykrita\ai_diffusion\model.py", line 240, in _generate_live
    input = workflow.prepare(
  File "F:\LIBRARIES\AppData\Roaming\krita\pykrita\ai_diffusion\workflow.py", line 812, in prepare
    _check_server_has_models(i.models, models, style.name)
  File "F:\LIBRARIES\AppData\Roaming\krita\pykrita\ai_diffusion\workflow.py", line 992, in _check_server_has_models
    raise ValueError(
ValueError: The checkpoint 'realisticVisionV51_v51VAE.safetensors' used by style 'Cinematic Photo' is not available on the server
Acly commented 5 months ago

Fixed the division by zero in v1.16.1 Let me know if you still run into issue with the wrong style being used.

tabishqidwai98 commented 5 months ago

Nope, now I'm not

Thank you

On Sun, 31 Mar, 2024, 17:48 Acly, @.***> wrote:

Fixed the division by zero in v1.16.1 https://github.com/Acly/krita-ai-diffusion/releases/tag/v1.16.1 Let me know if you still run into issue with the wrong style being used.

— Reply to this email directly, view it on GitHub https://github.com/Acly/krita-ai-diffusion/issues/538#issuecomment-2028690522, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOLU2EQW2LW7GHA6K66UONDY275KDAVCNFSM6AAAAABFNHQE4WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRYGY4TANJSGI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

tabishqidwai98 commented 5 months ago

Hii acly,

I have branched an your repo for the issue:bug #540, which had issues in loading and generating images on the prompt.

But now when I see, the bug #540 is not present there, under the label bug. I cannot find it for my reference.

Can you tell me the right way

Thanking u

Tabish Qidwai

Acly commented 5 months ago

The issue is still there but closed now. I also fixed that bug in https://github.com/Acly/krita-ai-diffusion/commit/a8a4ec3543b402f9ba47df2b25f7e4b92a60cb5f

tabishqidwai98 commented 5 months ago

Oh okay, i didn't knew seeing the repo

tabishqidwai98 commented 5 months ago

Can I contribute to any other feature-cum-bug on this same repo

freecoderwaifu commented 5 months ago

Fixed the division by zero in v1.16.1 Let me know if you still run into issue with the wrong style being used.

Thank you, can confirm the division by zero is fixed. The style issue is still there however, I'll make a standalone issue to better track it.