Git Product home page Git Product logo

mlx-stable-diffusion-webui's Introduction

Notes on Future Development

Due to serious Metal bugs, at least for me, that can't be managed, I won't be actively working on this project anymore. Feel free to explore on your own.

For more information, please refer to the NOTES_ON_METAL_BUGS.md file.

โ€ผ๏ธImportant Final Note: I'm archiving this repository as of April 13, 2024. I will keep the repository up for reference, but I won't be updating it. I am moving on to other projects. I hope this repository has been helpful to you. Thank you for your support.

MLX Stable Diffusion WebUI

This is a straightforward web interface for the Apple MLX Stable Diffusion example.

It is a modified version of mlx-examples/stable-diffusion by Apple. The original code can be found at https://github.com/ml-explore/mlx-examples/tree/main/stable_diffusion

The project is purely for educational purposes and is not intended for any serious use.

Depending on the availability of free time and the level of interest, there may be further development and refinement of these ideas.

thumb.jpeg

What's New

๐Ÿ‘‰ Streamlit WebUI

๐Ÿ‘‰ All models from Hugging Face can be used

๐Ÿ‘‰ All SD 1.5 Models that can be converted to diffuser models are supported

When you select a non-diffuser model from the list, the model will be converted to a diffuser model and saved in the `diffuser_models` folder. 

The next time you run the code, the converted model will be used.

Please note that the conversion process may take a while.

๐Ÿ‘‰ Implementation of Image to Image Generation

๐Ÿ‘‰ I2I UI Cleaned Up

๐Ÿ‘‰ Normalized I2I Base Image Strength Control

๐Ÿ‘‰ Seed Control

๐Ÿ‘‰ Half Precision Support

Installation

To run this example, you need to install Streamlit.

pip install streamlit   

Alternatively, you can install it using:

pip install -r requirements.txt

The first time you run the code with a new checkpoint, it will download it from Hugging Face, so it may take a while. Downloded checkpoints are cached, so the next time you run the code it will be faster.

How to Add Models from Hugging Face

To add a new model, you need to add a new entry to the _AVAILABLE_MODELS list in stable_diffusion_models.py. For example, to add the Lykon/absolute-reality-1.81 model, you would add the following entry:

_AVAILABLE_MODELS = [
    "stabilityai/stable-diffusion-2-1-base",
    "Lykon/dreamshaper-8",
    "Lykon/absolute-reality-1.81", # <--- Add this line
]

Added models will be available in the dropdown menu in the web interface automatically. XL models are not supported.

How to Add Local Models

Just symlink your Automatic1111 Stable Diffusion models folder to the models folder.

ln -s /path/to/your/automatic1111/stable_diffusion/models_folder ./models

ex) ln -s ~/stable-diffusion-webui/models/Stable-diffusion ./models

Note that all SDXL models are excluded based on their file names and not checked for compatibility.

You original unconverted models will remain intact. Converted models will be saved in the diffuser_models folder.

How to Run

To run the example, simply type in terminal:

streamlit run ./MLX-Stable-Diffusion-WebUI/main.py

Resources

Denoising Diffusion Probabilistic Models (DDPM) by Jonathan Ho, Ajay Jain, Pieter Abbeel https://arxiv.org/pdf/2006.11239.pdf

Umar Jamil(hkproj) PyTorch Stable Diffusion https://github.com/hkproj/pytorch-stable-diffusion

Notes on Contributions

While I deeply appreciate the community's interest and support, this project is currently not open for external contributions. As the sole author, I am crafting the content meticulously to ensure the highest quality and consistency in the educational material provided. This approach helps maintain the integrity and coherence of the content, tailored specifically for this project's unique educational goals.

I encourage you to use this resource for your learning and hope it helps you in your AI journey. Thank you for understanding and respecting the nature of this project.

mlx-stable-diffusion-webui's People

Contributors

neobundy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.