This script should be run on a Raspberry Pi with a Waveshare e-ink display attached to it.
The contents of the waveshare_epd
directory were copied from here: https://github.com/waveshareteam/e-Paper/tree/master/RaspberryPi_JetsonNano/python/lib/waveshare_epd
The display model that I'm using in this script has a 7.5 inch diameter and a 640x384 resolution. To initialize and use the display I had to import the code from waveshare_epd/epd7in5bc
. Edit main.py
with the correct import and resolution settings if you have a different model.
git clone https://github.com/laszloszurok/rpi-dalle-waveshare.git
cd rpi-dalle-waveshare
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
export OPENAI_API_KEY="replce-with-a-valid-api-key"
python main.py
You might get a warning similar to this:
.../venv/lib/python3.11/site-packages/gpiozero/devices.py:300: PinFactoryFallback: Falling back from lgpio: module 'lgpio' has no attribute 'SET_BIAS_DISABLE'
warnings.warn(
Here is a related gpiozero github issue: gpiozero/gpiozero#1038. TLDR: The warning should not cause problems and can be ignored.