--- title: ImageGen AI emoji: 🖼 colorFrom: purple colorTo: red sdk: gradio sdk_version: 5.25.2 app_file: app.py pinned: false license: mit short_description: AI-Powered Text-to-Image Generator --- # ImageGen AI A powerful text-to-image generation application built with Gradio and Hugging Face's diffusers library. This application allows users to generate high-quality images from text descriptions using Stability AI's SDXL-Turbo model. ## Features - **Text-to-Image Generation**: Create images from text descriptions - **Customizable Parameters**: Adjust settings like image size, guidance scale, and inference steps - **Negative Prompts**: Specify what you don't want in the generated image - **Image History**: View and manage previously generated images - **Save Images**: Save your favorite generations to disk - **Example Prompts**: Get started quickly with example prompts ## Technical Details This application uses: - **Stability AI's SDXL-Turbo model** for fast, high-quality image generation - **Gradio** for the user interface - **Hugging Face's diffusers library** for the AI backend - **PyTorch** as the deep learning framework ## Project Structure - `app.py`: Main entry point for the application - `model.py`: Model initialization and inference logic - `ui.py`: Gradio UI components and layout - `utils.py`: Utility functions for image saving and history management - `config.py`: Configuration settings - `test_app.py`: Unit tests for the application ## Getting Started 1. Install the required dependencies: ``` pip install -r requirements.txt ``` 2. Run the application: ``` python app.py ``` 3. Open your browser and navigate to the URL displayed in the terminal (the application will try ports 7860-7869 until it finds an available one) You can also specify a custom port by setting the GRADIO_SERVER_PORT environment variable: ``` GRADIO_SERVER_PORT=8000 python app.py ``` ## Usage 1. Enter a text description in the "Prompt" field 2. (Optional) Enter what you want to avoid in the "Negative Prompt" field 3. (Optional) Adjust advanced settings like image size, guidance scale, etc. 4. Click "Generate Image" and wait for the result 5. Save your favorite images using the "Save Image" button ## Examples Try these prompts: - "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" - "A serene mountain lake with reflections of pine trees" - "Futuristic cityscape at sunset with flying cars" ## License This project is licensed under the MIT License - see the LICENSE file for details. ## Acknowledgments - [Hugging Face](https://huggingface.co/) for the diffusers library - [Stability AI](https://stability.ai/) for the SDXL-Turbo model - [Gradio](https://gradio.app/) for the UI framework Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference