Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
name: Bug report
about: Create a report to help us improve
title: '[BUG] '
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Environment (please complete the following information):**
- OS: [e.g. Ubuntu 20.04, Windows 10, macOS]
- Docker version: [e.g. 20.10.8]
- Browser: [e.g. chrome, safari]
- Python version: [e.g. 3.8, 3.9]

**Docker Environment**
- Docker image version: [e.g. lowinli98/stable-diffusion-streamlit-onnxquantized:v0.2]
- Memory allocated to Docker: [e.g. 8GB]
- CPU cores: [e.g. 4 cores]

**Additional context**
Add any other context about the problem here.

**Logs**
If applicable, add relevant logs from the Docker container:
```
docker logs stable-diffusion-streamlit-onnxquantized
```
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: Feature request
about: Suggest an idea for this project
title: '[FEATURE] '
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.

**Implementation considerations**
- [ ] This feature would require changes to the UI
- [ ] This feature would require changes to the model pipeline
- [ ] This feature would require additional dependencies
- [ ] This feature would impact Docker image size
- [ ] This feature would impact memory usage
- [ ] This feature would impact inference time

**Priority**
- [ ] Low
- [ ] Medium
- [ ] High
- [ ] Critical
39 changes: 39 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Enforcement Responsibilities

Project maintainers are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement. All complaints will be reviewed and investigated promptly and fairly.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), version 2.0.
127 changes: 127 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# Contributing to Stable Diffusion Streamlit

Thank you for your interest in contributing to this project! This document provides guidelines for contributing to the Stable Diffusion Streamlit application.

## πŸš€ Getting Started

### Prerequisites

- Docker and Docker Compose
- Python 3.8+
- Git

### Development Setup

1. **Fork the repository**
```bash
git clone https://github.com/LowinLi/stable-diffusion-streamlit.git
cd stable-diffusion-streamlit
```

2. **Set up development environment**
```bash
# Install dependencies
pip install -r src/stable-diffusion-streamlit/requirements.txt

# Run with Docker Compose
docker-compose up -d
```

3. **Access the application**
- Open http://localhost:8501 in your browser

## πŸ“ How to Contribute

### Reporting Issues

- Use the GitHub issue tracker to report bugs
- Include detailed information about your environment
- Provide steps to reproduce the issue
- Include screenshots if applicable

### Submitting Changes

1. **Create a feature branch**
```bash
git checkout -b feature/your-feature-name
```

2. **Make your changes**
- Follow the existing code style
- Add tests if applicable
- Update documentation as needed

3. **Test your changes**
```bash
# Test the Docker build
docker-compose build
docker-compose up -d
```

4. **Commit your changes**
```bash
git add .
git commit -m "feat: add your feature description"
```

5. **Push and create a Pull Request**
```bash
git push origin feature/your-feature-name
```

## 🎯 Development Guidelines

### Code Style

- Follow PEP 8 for Python code
- Use meaningful variable and function names
- Add comments for complex logic
- Keep functions small and focused

### Commit Messages

Use conventional commit format:
- `feat:` for new features
- `fix:` for bug fixes
- `docs:` for documentation changes
- `style:` for formatting changes
- `refactor:` for code refactoring
- `test:` for adding tests
- `chore:` for maintenance tasks

### Docker Best Practices

- Keep Docker images lightweight
- Use multi-stage builds when appropriate
- Document any new environment variables
- Test Docker builds locally

## πŸ” Testing

- Test the application with different prompts
- Verify Docker container functionality
- Check memory usage and performance
- Test on different platforms if possible

## πŸ“š Documentation

- Update README.md for new features
- Add inline code comments
- Update Docker documentation
- Include examples for new functionality

## 🀝 Community

- Be respectful and inclusive
- Help others in discussions
- Share knowledge and best practices
- Follow the project's code of conduct

## πŸ“ž Getting Help

- Check existing issues and discussions
- Create a new issue for questions
- Join community discussions
- Contact maintainers if needed

Thank you for contributing to make this project better! πŸŽ‰
67 changes: 52 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,37 @@
[**δΈ­ζ–‡θ―΄ζ˜Ž**](https://github.com/LowinLi/stable-diffusion-streamlit/blob/main/README_CN.md) | [**English**](https://github.com/LowinLi/stable-diffusion-streamlit/blob/main/README.md)

# stable-diffusion-streamlit
# 🎨 Stable Diffusion Streamlit

- [1.Introduction](#1-introduction)
- [2.Getting Started](#2-getting-started)
- [3.Quantization Performance](#3-quantization-performance)
- [4.Streamlit Progress Bar](#4-streamlit-progress-bar)
- [5.To Do](#5-to-do)
- [6.Get Help](#6-get-help)
- [7.Acknowledgements](#7-acknowledgements)
[![Docker Image](https://img.shields.io/badge/docker-lowinli98%2Fstable--diffusion--streamlit--onnxquantized-blue)](https://hub.docker.com/r/lowinli98/stable-diffusion-streamlit-onnxquantized)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
[![Python](https://img.shields.io/badge/python-3.8%2B-blue.svg)](https://www.python.org/)
[![Streamlit](https://img.shields.io/badge/streamlit-1.0%2B-red.svg)](https://streamlit.io/)

## 1. Introduction
> πŸš€ A beautiful web application for Stable Diffusion text-to-image generation with **75% memory reduction** through ONNX quantization

## πŸ“‹ Table of Contents

- [✨ Features](#-features)
- [πŸš€ Introduction](#-introduction)
- [πŸ› οΈ Getting Started](#️-getting-started)
- [πŸ“Š Quantization Performance](#-quantization-performance)
- [πŸ“ˆ Streamlit Progress Bar](#-streamlit-progress-bar)
- [πŸ“ To Do](#-to-do)
- [🀝 Contributing](#-contributing)
- [❓ Get Help](#-get-help)
- [πŸ™ Acknowledgements](#-acknowledgements)

## ✨ Features

- 🎨 **Text-to-Image Generation**: Create stunning images from text prompts
- πŸ”§ **ONNX Quantization**: 75% memory reduction with minimal quality loss
- 🌐 **Web Interface**: Beautiful Streamlit-based user interface
- πŸ–ΌοΈ **Gallery View**: Browse and manage generated images
- 🐳 **Docker Support**: Easy deployment with Docker Compose
- πŸ‡¨πŸ‡³ **Chinese Interface**: Native Chinese language support
- ⚑ **Fast Inference**: Optimized for CPU execution

## πŸš€ Introduction

+ Create beautiful apps using [Streamlit](https://github.com/streamlit/streamlit) to test [CompVis/stable-diffusion-v1-4](https://huggingface.co/CompVis/stable-diffusion-v1-4) model quantized by [OnnxRuntime](https://github.com/microsoft/onnxruntime) **cutting down memory 75%**.
+ **Streamlit**:
Expand All @@ -21,7 +42,7 @@
+ a cross-platform, faster inference and lower costs accelerator for machine learning models.


## 2. Getting Started
## πŸ› οΈ Getting Started

### 2.1. Deployment
+ docker-compose up -d
Expand Down Expand Up @@ -96,17 +117,33 @@ With another thread in Python, the progress bar can be updated by the pipeline s



## 5. To Do
## πŸ“ To Do

- [ ] Add the Text-Guided Image-to-Image Pipeline in [Huggingface/Diffusers](https://huggingface.co/docs/diffusers/using-diffusers/img2img)
- [ ] Add the Text-Guided Image-Inpainting Pipeline in [Huggingface/Diffusers](https://huggingface.co/docs/diffusers/using-diffusers/inpaint)
- [ ] Add support for different Stable Diffusion models
- [ ] Implement batch processing for multiple images
- [ ] Add image upscaling options
- [ ] Support for custom model fine-tuning

## 🀝 Contributing

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.

- πŸ› **Bug Reports**: Use our [bug report template](.github/ISSUE_TEMPLATE/bug_report.md)
- πŸ’‘ **Feature Requests**: Use our [feature request template](.github/ISSUE_TEMPLATE/feature_request.md)
- πŸ“– **Documentation**: Help improve our documentation
- πŸ§ͺ **Testing**: Help us test new features

Please read our [Code of Conduct](CODE_OF_CONDUCT.md) before contributing.

## 6. Get Help
## ❓ Get Help

+ Contact me at lowinli@outlook.com
+ If appropriate, open an issue on GitHub
+ πŸ“§ Contact me at lowinli@outlook.com
+ πŸ› If appropriate, open an issue on GitHub
+ πŸ’¬ Join our discussions in the Issues section

## 7. Acknowledgements
## πŸ™ Acknowledgements

+ [Huggingface/Diffusers](https://github.com/huggingface/diffusers)
+ [CompVis/stable-diffusion](https://github.com/CompVis/stable-diffusion)
Expand Down
Loading