A simple, user-friendly AI image generator built with HTML, CSS, and JavaScript. This project allows users to generate images from a text prompt using various AI models from Hugging Face.
Text-to-Image Generation: Type a text prompt to create unique images.
Multiple Models: Choose from different AI models, including Stable Diffusion, FLUX, and Openjourney.
Random Prompts: Get inspired with a built-in dice button that suggests random prompts.
Customizable Output: Select the number of images to generate and choose from different aspect ratios (1:1, 16:9, 9:16).
Download Images: Easily download your generated images.
Prerequisites
You need a Hugging Face API key to use this application.
Sign up for an account on Hugging Face.
Go to your profile settings and find the Access Tokens section.
Create a new token with at least Read access.
Copy your new token.
Installation
Clone this repository to your local machine:
git clone https://github.com/SHLapi/AI-Image-Generator.gitNavigate to the project directory:
cd AI-Image-GeneratorOpen the app.js file and replace the placeholder with your Hugging Face API key.
const API_KEY = 'your_api_key_here'; // Replace with your actual API keyUsage
Simply open the index.html file in your web browser. The application is a single-page app and does not require a server to run.
index.html: The main HTML file that provides the user interface.
styles.css: The CSS file for styling the application.
app.js: The JavaScript file that handles the logic, including user interactions and API calls to Hugging Face.