Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

🖼️ AI Image Generation (Stable Diffusion – Python)

A clean, simple, and production-ready Python project for generating images from text prompts using Stable Diffusion via Hugging Face.
This project includes automated setup scripts, model downloading, and image generation with GPU/CPU fallback.


📁 Project Structure

imageGenByAi/
│── .venv/ # Virtual environment (ignored in Git)
│── models/ # Downloaded ML models (ignored in Git)
│── main.py # Main script to generate images
│── download_model.py # Script to download Stable Diffusion model
│── setup_and_run.py # One-click setup + run helper
│── .gitignore
│── README.md

🚀 Features

  • Generate images using Stable Diffusion
  • Automatic GPU or CPU use
  • Download model once → stored in models/
  • Clean scripts for setup and inference
  • 100% reproducible environment setup

🛠️ Requirements

  • Python 3.10
  • Hugging Face account
  • Optional: NVIDIA GPU (recommended for faster generation)

⚙️ Setup Instructions

1️⃣ Create & Activate Virtual Environment

python -m venv .venv
.venv\Scripts\activate

- If you want GPU acceleration (CUDA 12.1):
```cmd 
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
  • Install remaining libraries:
pip install diffusers transformers huggingface_hub pillow accelerate

Hugging Face Authentication

Download the Model

  • Run the included script: python download_model.py

  • This downloads the Stable Diffusion model into: models/

Generate an Image

python main.py
  • Example prompt inside main.py:
prompt = "A futuristic neon-lit city, cyberpunk style, extremely detailed, 4K"

One-Click Setup + Run

python setup_and_run.py

Contributions & Issues

  • Feel free to open issues or request improvements for scripts, prompts, or better GPU utilization.

If you want a GitHub-optimized version with badges, screenshots, or installation GIF, I can generate that too!

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages