Generate stunning images from creative text prompts using Stable Diffusion, Hugging Face, and Gradio β powered by your own GPU (like RTX 3060 Ti).
- π¬ Accepts text prompts and returns unique images
- β‘ Runs locally on GPU (with
torch.float16for speed) - π Clean web UI using Gradio
- π§ Based on
CompVis/stable-diffusion-v1-4(Hugging Face) - βοΈ Optimized with reduced inference steps for fast generation
text-to-image/ βββ main.py # Main Python app with Gradio UI βββ requirements.txt # Python dependencies βββ README.md # Project overview
git clone https://github.com/your-username/text-to-image.git cd text-to-image 2. Create and Activate Virtual Environment python -m venv venv venv\Scripts\activate # On Windows
- Install Dependencies pip install -r requirements.txt
- Add Your Hugging Face Token Create a free account: https://huggingface.co Get your access token: https://huggingface.co/settings/tokens Replace "your_token_here" in main.py with your token. Run the App python main.py Youβll see output like: Using GPU: True Device name: NVIDIA GeForce RTX 3060 Ti Running on local URL: http://127.0.0.1:7860 Then open your browser and enter prompts like: A cyberpunk owl with neon feathers sitting on a skyscraper π§ͺ Example Prompts A cat wearing sunglasses surfing a giant wave A glowing castle floating in the night sky with stars A robot reading a book in a cozy library A frog wizard casting spells in a magical swamp π¦ Requirements Python 3.10 (not 3.13+) An NVIDIA GPU with CUDA support (e.g., RTX 3060 Ti) Hugging Face Token π requirements.txt txt Copy Edit torch==2.5.1+cu121 torchvision==0.20.1+cu121 torchaudio==2.5.1+cu121 diffusers transformers accelerate gradio π Acknowledgements π€ Hugging Face π§ Diffusers Library πΌοΈ Gradio π§° PyTorch
