{"id":26567602,"url":"https://github.com/sauravrwt/text-to-img","last_synced_at":"2026-05-04T22:34:40.900Z","repository":{"id":283772918,"uuid":"930304853","full_name":"SauRavRwT/text-to-img","owner":"SauRavRwT","description":"A Python-based text-to-image generation tool leveraging stable diffusion models. This application provides enhanced control over image generation through optimized parameters, improved prompting, and an efficient interface.","archived":false,"fork":false,"pushed_at":"2025-03-22T04:03:50.000Z","size":1503,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-22T05:18:22.833Z","etag":null,"topics":["diffuser","fastai","gradio","python","stable-diffusion","torch","transformers"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SauRavRwT.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-10T12:23:06.000Z","updated_at":"2025-03-22T04:03:53.000Z","dependencies_parsed_at":"2025-03-22T05:18:30.031Z","dependency_job_id":"69581303-6739-4fae-945f-392be7ac4db0","html_url":"https://github.com/SauRavRwT/text-to-img","commit_stats":null,"previous_names":["sauravrwt/text-to-img"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SauRavRwT%2Ftext-to-img","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SauRavRwT%2Ftext-to-img/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SauRavRwT%2Ftext-to-img/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SauRavRwT%2Ftext-to-img/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SauRavRwT","download_url":"https://codeload.github.com/SauRavRwT/text-to-img/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245008077,"owners_count":20546266,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["diffuser","fastai","gradio","python","stable-diffusion","torch","transformers"],"created_at":"2025-03-22T19:19:52.339Z","updated_at":"2026-05-04T22:34:40.859Z","avatar_url":"https://github.com/SauRavRwT.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Text to Image Generator\n\nA powerful Python-based text-to-image generation tool using Stable Diffusion models with optimized performance and an intuitive Gradio interface. Generate high-quality images from text descriptions with advanced customization options.\n\n![Text to Image Generator](./Images/txt-to-img-5.png)\n\n## Features\n\n### Multiple Model Support\n- Stable Diffusion 1.5\n- Stable Diffusion 2.1\n- Dreamshaper 8\n\n### Smart Optimizations\n- Automatic VRAM-based optimization\n- xFormers memory efficient attention (when available)\n- VAE slicing for better memory usage\n- Sequential CPU offload for low VRAM systems\n- Dynamic model caching\n\n### Advanced Generation Controls\n- Adaptive guidance scaling (7-30 range)\n- Quality enhancement prompts\n- Comprehensive negative prompts\n- Custom seed support\n- Adjustable image dimensions (512-1024px)\n- Configurable inference steps (20-100)\n\n### User Interface\n- Clean, intuitive Gradio interface\n- Example prompts gallery\n- Real-time generation details\n- Advanced settings accordion\n- Random prompt generation\n- Clear function\n\n### Results\n\nBelow are sample outputs generated by the Text to Image Generator using various prompts and models:\n\n| Prompt | Model | Output |\n|--------|-------|--------|\n| *A serene landscape with mountains, a lake, and a sunset, highly detailed, vibrant colors* | Stable Diffusion 1.5 | ![Sample 3](./Images/sd-v1.5.webp) |\n| *A serene landscape with mountains, a lake, and a sunset, highly detailed, vibrant colors* | Stable Diffusion 2.1 | ![Sample 1](./Images/sd-v2.1.webp) |\n| *A serene landscape with mountains, a lake, and a sunset, highly detailed, vibrant colors* | Dreamshaper 8 | ![Sample 2](./Images/dreamshaper-v8.webp) |\n\n\u003e *Note: Output quality and style may vary depending on the selected model and prompt.*\n\n## Requirements\n\n- Python 3.13\n- CUDA-compatible GPU (recommended)\n- CPU-only mode supported\n\n## Setup Guide\n\n### Google Colab Setup\n1. Open `Text-to-img.ipynb` in Google Colab\n2. Select 'Runtime' \u003e 'Change runtime type' \u003e Choose 'T4 GPU'\n3. Run all cells in sequence\n\n### Hugging Face Token Setup\n\n#### Google Colab\n1. Obtain your Hugging Face token from [Hugging Face](https://huggingface.co/settings/tokens).\n2. Add the token to the Colab notebook by running the following code in a cell:\n    ```python\n    from huggingface_hub import login\n    login(\"your_huggingface_token_here\")\n    ```\n\n#### Local Deployment\n1. Obtain your Hugging Face token from [Hugging Face](https://huggingface.co/settings/tokens).\n2. Create a file named `token` inside the `huggingface` directory:\n    ```bash\n    echo \"your_huggingface_token_here\" \u003e huggingface/token\n    ```\nAlternatively, you can securely add your Hugging Face token directly in Google Colab by setting it as a secret. Use the following code snippet in a cell:\n\n```python\nHF_TOKEN=YOUR_HUGGINGFACE_TOKEN\n```\n\n### Local Installation\nNote: Need Python 3.13 and if you are facing error in setup wheel then run `pip install --upgrade pip setuptools wheel` and restart the kernel.\n\n#### 1. Clone Repository\n```bash\ngit clone https://github.com/SauRavRwT/text-to-img.git\ncd text-to-img\n```\n\n#### 2. Create Virtual Environment\nWindows:\n```bash\npython -m venv venv\nvenv\\scripts\\activate\n```\n\nLinux/Mac:\n```bash\npython -m venv venv\nsource venv/bin/activate\n```\n\n#### 3. Install Dependencies\n```bash\npip install -r requirements.txt\n```\n\n#### 4. Launch Application\n```bash\npython app.py\n```\n\n### Technical Notes\n- The system automatically detects available VRAM and applies appropriate optimizations\n- For systems with less than 6GB VRAM: Uses sequential CPU offload\n- For systems with 6-8GB VRAM: Uses model CPU offload\n- For systems with \u003e8GB VRAM: Runs fully on GPU with memory optimizations\n\n### For CUDA out of memory errors:\n\n- Reduce image dimensions\n- Decrease inference steps\n- Use a lower resolution model\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsauravrwt%2Ftext-to-img","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsauravrwt%2Ftext-to-img","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsauravrwt%2Ftext-to-img/lists"}