Stable-diffusion in Nix

This page summarizes the projects mentioned and recommended in the original post on /r/NixOS

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • stable-diffusion

    A latent text-to-image diffusion model

  • I have been playing around with a memory efficient version of [stable-diffusion](https://github.com/basujindal/stable-diffusion), an AI model that outputs images based on input text. I think it is rather neat, and [this post](https://xeiaso.net/blog/stable-diffusion-nixos) by Xeiaso (good blog for nix resources and rants) inspired me to try and make the installation process more nix-friendly. So I have forked the original [stable-diffusion repo](https://github.com/CompVis/stable-diffusion) and added a [`default.nix`](https://github.com/Danielhp95/nix-stable-diffusion/blob/main/default.nix) which dumps you in a `nix-shell` with all dependencies: cuda (nvidia) stuff, python dependencies and C++ libraries for pytorch (deep learning framework). Although **note** that in order to run it you must first download the model weights from [this repo](https://huggingface.co/CompVis/stable-diffusion-v1-4) and place them in `models/ldm/stable-diffusion-v1/model.ckpt` directory.

  • stable-diffusion

    Optimized Stable Diffusion modified to run on lower GPU VRAM (by basujindal)

  • I have been playing around with a memory efficient version of [stable-diffusion](https://github.com/basujindal/stable-diffusion), an AI model that outputs images based on input text. I think it is rather neat, and [this post](https://xeiaso.net/blog/stable-diffusion-nixos) by Xeiaso (good blog for nix resources and rants) inspired me to try and make the installation process more nix-friendly. So I have forked the original [stable-diffusion repo](https://github.com/CompVis/stable-diffusion) and added a [`default.nix`](https://github.com/Danielhp95/nix-stable-diffusion/blob/main/default.nix) which dumps you in a `nix-shell` with all dependencies: cuda (nvidia) stuff, python dependencies and C++ libraries for pytorch (deep learning framework). Although **note** that in order to run it you must first download the model weights from [this repo](https://huggingface.co/CompVis/stable-diffusion-v1-4) and place them in `models/ldm/stable-diffusion-v1/model.ckpt` directory.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • nix-stable-diffusion

    Nix-friendly fork of: Optimized Stable Diffusion modified to run on lower GPU VRAM (by Danielhp95)

  • I have been playing around with a memory efficient version of [stable-diffusion](https://github.com/basujindal/stable-diffusion), an AI model that outputs images based on input text. I think it is rather neat, and [this post](https://xeiaso.net/blog/stable-diffusion-nixos) by Xeiaso (good blog for nix resources and rants) inspired me to try and make the installation process more nix-friendly. So I have forked the original [stable-diffusion repo](https://github.com/CompVis/stable-diffusion) and added a [`default.nix`](https://github.com/Danielhp95/nix-stable-diffusion/blob/main/default.nix) which dumps you in a `nix-shell` with all dependencies: cuda (nvidia) stuff, python dependencies and C++ libraries for pytorch (deep learning framework). Although **note** that in order to run it you must first download the model weights from [this repo](https://huggingface.co/CompVis/stable-diffusion-v1-4) and place them in `models/ldm/stable-diffusion-v1/model.ckpt` directory.

  • stable-diffusion-webui

    Stable Diffusion web UI

  • This was really helpful, thanks. I managed to get it working for the AUTOMATIC1111 version of webui.

  • taming-transformers

    Taming Transformers for High-Resolution Image Synthesis

  • # Copy models as described in README cp ~/Downloads/model.ckpt . cp ~/Downloads/GFPGANv1.3.pth . # Clone other repos as mentioned in README mkdir repositories git clone https://github.com/CompVis/stable-diffusion.git repositories/stable-diffusion git clone https://github.com/CompVis/taming-transformers.git repositories/taming-transformers git clone https://github.com/sczhou/CodeFormer.git repositories/CodeFormer git clone https://github.com/salesforce/BLIP.git repositories/BLIP export NIXPKGS_ALLOW_UNFREE=1 nix-shell default.nix pip install torch --extra-index-url https://download.pytorch.org/whl/cu113 # Also from linux instructions. Can probably be added to default.nix python webui.py

  • CodeFormer

    [NeurIPS 2022] Towards Robust Blind Face Restoration with Codebook Lookup Transformer

  • # Copy models as described in README cp ~/Downloads/model.ckpt . cp ~/Downloads/GFPGANv1.3.pth . # Clone other repos as mentioned in README mkdir repositories git clone https://github.com/CompVis/stable-diffusion.git repositories/stable-diffusion git clone https://github.com/CompVis/taming-transformers.git repositories/taming-transformers git clone https://github.com/sczhou/CodeFormer.git repositories/CodeFormer git clone https://github.com/salesforce/BLIP.git repositories/BLIP export NIXPKGS_ALLOW_UNFREE=1 nix-shell default.nix pip install torch --extra-index-url https://download.pytorch.org/whl/cu113 # Also from linux instructions. Can probably be added to default.nix python webui.py

  • BLIP

    PyTorch code for BLIP: Bootstrapping Language-Image Pre-training for Unified Vision-Language Understanding and Generation

  • # Copy models as described in README cp ~/Downloads/model.ckpt . cp ~/Downloads/GFPGANv1.3.pth . # Clone other repos as mentioned in README mkdir repositories git clone https://github.com/CompVis/stable-diffusion.git repositories/stable-diffusion git clone https://github.com/CompVis/taming-transformers.git repositories/taming-transformers git clone https://github.com/sczhou/CodeFormer.git repositories/CodeFormer git clone https://github.com/salesforce/BLIP.git repositories/BLIP export NIXPKGS_ALLOW_UNFREE=1 nix-shell default.nix pip install torch --extra-index-url https://download.pytorch.org/whl/cu113 # Also from linux instructions. Can probably be added to default.nix python webui.py

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts