Machine Learning

Machine Learning in Linux: ImaginAIry – Pythonic generation of images

Artificial intelligence icon Our Machine Learning in Linux series focuses on apps that make it easy to experiment with machine learning. All the apps covered in the series can be self-hosted.

ImaginAIry is Python-based software for generating Stable Diffusion images. It’s primarily designed for the command-line but there’s a web frontend in development.

This is free and open source software.


The software featured in this series is primarily tested under Manjaro, an Arch-based distro.

ImaginAIry recommends installing their software using pip. Unfortunately pip on any Arch-based distro is a nightmare, as pacman should be the only system-wide package manager. Everything else must be installed in a virtual environment or a local environment.

ImaginAIry recommends using Python 3.10, with no support for Python 3.11 currently. You guessed it, Manjaro uses Python 3.11.3. We therefore installed ImaginAIry using pyenv, software which offers easy switching between multiple versions of Python.

Install pipenv with the command:

$ sudo pacman -S pyenv

We want Bash shell integration so we’ll add a few lines to our .bashrc configuration file.

echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc

Look at the image below. The first command shows that we’re running version 3.11.3 of Python. The second command tells us that’s the only version of Python installed on the system. The third command installs Python 3.10.12 using pyenv without affecting our system version of Python.

Installing Python 3.10.12 with pyenv

Now look at the image below. The first command below activates version 3.10.12 of Python. The second and third commands are simply to check the Python and pip executables are the versions we want to use to install ImaginAIry.


We’re now ready to install ImaginAIry. Here’s an image of the installation in action.

Installing ImaginAIry with pip

Next page: Page 2 – In Operation and Summary

Pages in this article:
Page 1 – Introduction and Installation
Page 2 – In Operation and Summary

Notify of

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Inline Feedbacks
View all comments