Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

OpenDiff StyleLab

OpenDiff StyleLab is a notebook-first generative AI MVP built around Hugging Face Diffusers and Stable Diffusion. The project walks through a lightweight image-generation workflow, from setup and dummy dataset creation to text-to-image inference, image-to-image style transfer, and a simulated LoRA fine-tuning loop.

What's in this project

  • Generative_AI_MVP.ipynb - the main end-to-end notebook
  • .env - local environment variables for secrets such as Hugging Face access tokens
  • .venv/ - local virtual environment (ignored by Git)

Notebook flow

The notebook is organized into the following sections:

  1. Setup and imports
  2. Dataset loading with sample dummy images
  3. Stable Diffusion model loading
  4. Fine-tuning simulation with LoRA-style concepts
  5. Training metric visualization
  6. Text-to-image inference
  7. Image-to-image style transfer

Tech stack

  • Python
  • Jupyter Notebook
  • PyTorch
  • Hugging Face Diffusers
  • Transformers
  • Accelerate
  • PEFT
  • Matplotlib
  • Pillow
  • NumPy

Getting started

1. Create and activate a virtual environment

PowerShell:

python -m venv .venv
.venv\Scripts\Activate.ps1

2. Install dependencies

pip install diffusers transformers accelerate peft matplotlib datasets torch torchvision pillow numpy jupyter

3. Configure environment variables

Create a .env file for local secrets:

HF_READ_TOKEN=your_huggingface_token_here

If you load the token inside the notebook, make sure it is read from the environment instead of being hardcoded.

4. Launch Jupyter

jupyter notebook

Open Generative_AI_MVP.ipynb and run the notebook cells in order.

Notes

  • The current notebook is designed as an MVP and uses a dummy dataset for demonstration.
  • The model referenced in the notebook is OFA-Sys/small-stable-diffusion-v0, which is lightweight enough for experimentation on limited hardware.
  • CPU execution works for learning and validation, but inference will be much slower than on a CUDA-enabled GPU.

Suggested next improvements

  • Move reusable code from the notebook into Python modules
  • Add a requirements.txt or pyproject.toml
  • Load a real dataset instead of generated dummy images
  • Save generated outputs into a dedicated outputs/ directory
  • Add clearer token-loading and configuration cells

GitHub checklist

Before pushing this repo:

  • Confirm .env is not tracked
  • Keep .venv/ out of version control
  • Add a remote with git remote add origin <your-repo-url>
  • Commit your files and push with:
git add .
git commit -m "Initial project setup"
git push -u origin main

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages