/mlx-demos

Explore machine learning techniques with Gradio interfaces for Stable Diffusion image generation and LoRA text generation with the Apple MLX framework.

Primary LanguagePythonMIT LicenseMIT

MLX Demos

Welcome to the MLX Demos repository! This repository contains two separate demonstrations of machine learning techniques using MLX: Stable Diffusion and LoRA (Low-Rank Adaptation). Each demo is contained within its own directory and features a Gradio UI for easy interaction. Parts of the code in these demonstrations have been adapted from the MLX-Examples repository by Apple.

Directory Structure

  • stable-diffusion/: Contains the demo for image generation using Stable Diffusion.
  • lora/: Contains the demo for text generation using LoRA fine-tuning.

Getting Started

To get started with these demos, you will first need to clone this repository:

git clone https://github.com/RAHB-REALTORS-Association/mlx-demos.git
cd mlx-demos

Then, navigate to the specific demo you're interested in (stable-diffusion or lora), and follow the instructions in the respective README.md within each folder.

Stable Diffusion

The stable-diffusion directory contains a demo that uses Stable Diffusion for image generation. This demo illustrates the capabilities of MLX in processing and generating images based on textual prompts.

To run the Stable Diffusion demo, navigate to the stable-diffusion directory and follow the instructions in its README.md.

LoRA

The lora directory contains a demo that demonstrates the use of LoRA for text generation. This demo showcases how MLX can be used to fine-tune models for text generation tasks.

To run the LoRA demo, navigate to the lora directory and follow the instructions in its README.md.

Requirements

Each demo has its own set of dependencies. Please refer to the respective README.md files in each directory for specific instructions on how to install and run the demos.

Contributing

Contributions to this repository are welcome. Please feel free to submit issues or pull requests for improvements to the demos.

License

This project is open sourced under the MIT license. See the LICENSE file for more info.