mudler / LocalAI

:robot: The free, Open Source alternative to OpenAI, Claude and others. Self-hosted and local-first. Drop-in replacement for OpenAI, running on consumer-grade hardware. No GPU required. Runs gguf, transformers, diffusers and many more models architectures. Features: Generate Text, Audio, Video, Images, Voice Cloning, Distributed inference
https://localai.io
MIT License
23.77k stars 1.82k forks source link

Image Generation: ModuleNotFoundError: No module named 'PIL' #2276

Closed Nold360 closed 4 months ago

Nold360 commented 5 months ago

LocalAI version:

Container Image: quay.io/go-skynet/local-ai:v2.14.0-cublas-cuda12-ffmpeg-core

Environment, CPU architecture, OS, and Version:

Running on K8s

Describe the bug

Downloaded Dreamshaper via WebUI. Then wanted to use WebUI for Text-to-image, which gives me this error in logs.

To Reproduce

  1. Download Dreamshaper
  2. Use Text-2-Image

Expected behavior

It just works

Logs

│ localai-local-ai 6:17AM DBG GRPC(DreamShaper_8_pruned.safetensors-127.0.0.1:37247): stderr /build/backend/python/diffusers/run.sh: line 13: activate: No such file or directory                                            │
│ localai-local-ai 6:17AM DBG GRPC(DreamShaper_8_pruned.safetensors-127.0.0.1:37247): stderr Traceback (most recent call last):                                                                                              │
│ localai-local-ai 6:17AM DBG GRPC(DreamShaper_8_pruned.safetensors-127.0.0.1:37247): stderr   File "/build/backend/python/diffusers/backend_diffusers.py", line 12, in <module>                                             │
│ localai-local-ai 6:17AM DBG GRPC(DreamShaper_8_pruned.safetensors-127.0.0.1:37247): stderr     from PIL import Image                                                                                                       │
│ localai-local-ai 6:17AM DBG GRPC(DreamShaper_8_pruned.safetensors-127.0.0.1:37247): stderr ModuleNotFoundError: No module named 'PIL'     

Additional context

localai-bot commented 5 months ago

Hello Nold360, it seems there's a missing module in your LocalAI environment. To fix the issue, you need to install the 'PIL' module. You can do so by running the command 'pip install PIL'. If you encounter any issues while installing, please let us know and we'll assist you further. Also, this is an experiment by @mudler and I am a bot assisting with the audit of Github tickets. If you have any other questions or concerns, feel free to ask.

Nold360 commented 5 months ago

To fix the issue, you need to install the 'PIL' module. You can do so by running the command 'pip install PIL'.

Easier said then done in a container :P

mudler commented 5 months ago

@Nold360 for the python backends you need to pick up images without the core tag - the images with core are without any python dependencies, see also: https://localai.io/basics/container/#standard-container-images

Nold360 commented 4 months ago

oh damn, alright, i'm stupid. thx dude