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.91k stars 339 forks source link

Server execution error: Numpy is not available #1135

Closed Picus303 closed 2 months ago

Picus303 commented 2 months ago

I followed the exact steps of this tutorial for local installation: https://www.interstice.cloud/plugin But the error Server execution error: Numpy is not available appears at the end of a generation.

At the same time, running: \AppData\Roaming\krita\ai_diffusion\server\python\python.exe and trying to import Numpy works. Any ideas on how to fix that?

Acly commented 2 months ago

See #1130

It's strange I can't reproduce this with a fresh install on Windows

Picus303 commented 2 months ago

What is your GPU? Maybe the problem only happens with AMD. Are you sure pytorch with directml have the exact same dependencies than "normal" pytorch with cuda?

edit: downgrading to numpy 1.26.4 worked.

makkflai commented 2 months ago

hello, although I know absolutely nothing about programming and even less about python language, I also get the same error: “Server execution error: Numpy is not available”, I have an amd graphic card (6700xt) and when I try from the cpu it does let me generate images. what a pity I can't use it, I saw many videos about the AI and it is really very good. D:

Picus303 commented 2 months ago

@makkflai To make it simple, this program uses dependencies, pieces of code writen by other people. One of these dependencies needed to generate images on the GPU "Numpy" seems to be installed with an incompatible version for AMD GPUs.

You need to downgrade it manually.

If you followed the tutorial like me (didn't install anything else yourself), you can open a command prompt and type: C:\Users\<your username>\AppData\Roaming\krita\ai_diffusion\server\python\python.exe -m pip install numpy==1.26.4. Replace with the right name and it should be ok.

Acly commented 2 months ago

Maybe the problem only happens with AMD

Looks like that's the reason, the DirectML option does install numpy 2.1.0

Picus303 commented 2 months ago

Problem solved by the commit.

makkflai commented 2 months ago

thanks brother, with a friend who knows who helped me + your line of code I was able to make it work, have a good week :D