Skip to content

The Text-to-Image Generator is an AI-powered web application that generates high-quality images from user-provided text prompts. Leveraging Hugging Face's Stable Diffusion model, the application transforms descriptive text into vivid and detailed visuals, making it ideal for creative projects, concept visualization, and artistic experimentation.

Notifications You must be signed in to change notification settings

letsdoitbycode/Text-to-Image-Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Text-to-Image Generator with Real-Time Emotion Detection: FaceVibe

The Text-to-Image Generator is an AI-powered web application that generates high-quality images from user-provided text prompts. Leveraging Hugging Face's Stable Diffusion model, the application transforms descriptive text into vivid and detailed visuals, making it ideal for creative projects, concept visualization, and artistic experimentation.

Key Features

Key Objectives

  • Seamless Text-to-Image Conversion: Allow users to input descriptive prompts and receive corresponding images that visually interpret the text.
  • Accessible Web Interface: Provide an easy-to-use, interactive platform where users can generate images directly from their browser.
  • Flexible Prompting for Visual Exploration: Enable users to experiment with different prompts to explore a wide variety of generated visualizations.
  • AI-Powered Image Generation: Uses Hugging Face’s Stable Diffusion model to create high-quality images based on textual prompts.
  • Interactive Image Generation: Users can experiment with different prompts to explore various visualizations.

How It Works

  • Text Input: Users enter a descriptive text prompt, like "a futuristic city skyline at sunset."
  • Text-to-Image Model: The prompt is processed by Hugging Face's Stable Diffusion model, which uses embeddings and a generative neural network to create a corresponding image.
  • Image Display: The generated image is displayed on the app interface, available for download.

Installation

  1. Clone the repository

    git clone https://github.com/letsdoitbycode/Text-to-Image-Generator.git
    cd Text-to-Image-Generator
  2. Create a virtual environment and activate it:

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  3. Install the required packages:

    pip install flask torch diffusers transformers accelerate gunicorn python-dotenv
    pip install requirements.txt
  4. API key setup for Application:

    sh touch .env paste your API key in plaintext.env file as plaintext AUTH_TOKEN='API_KEY' sh touch .gitignore add plaintext .env in the file to secure the API key To test the API key, follow below mentioned steps

    
    

API Key Setup

To run the Text-to-Image Generator, you’ll need a Hugging Face API Token:

  • Go to the Hugging Face website https://huggingface.co .
  • Sign in or create an account.
  • Navigate to Account Settings > API token and click Generate new token.
  • Copy the generated token and add it in your Python code (StableDiffusionImage.ipynb) file in place of plaintext self.authorization_token = "" .
  1. Run the Flask app:
    python app.py

Project Structure

YouTube-Video-Summarization-App/
│
├── app.py                                              # Main Flask application
├── templates/
│   └── index.html                                      # Main HTML file
├── static/
│   ├── style.css                                       # CSS styles
├── .gitignore
├── StableDiffusionImage.ipynb                          # python file for the execution
├── requirements.txt                                    # requirements for the project
└── README.md                                           # This README file

Demo Application Interface

Screenshot (23)

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any changes or improvements.

About

The Text-to-Image Generator is an AI-powered web application that generates high-quality images from user-provided text prompts. Leveraging Hugging Face's Stable Diffusion model, the application transforms descriptive text into vivid and detailed visuals, making it ideal for creative projects, concept visualization, and artistic experimentation.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages