This project is a simple image generator that utilizes the Stable Diffusion XL Base 1.0 model from Hugging Face for AI-powered image generation.
- Generate images from text prompts.
- Uses Hugging Face API for inference.
- Lightweight and easy to use.
- Built with Node.js, Express, and EJS for frontend rendering.
Ensure you have the following installed:
- Node.js
dotenv
,express
,axios
, andejs
npm packages
Install dependencies using:
npm install express axios ejs dotenv
- Obtain an API key from Hugging Face.
- Create a
.env
file in the root directory and add your API key:HF_API_KEY=your_huggingface_api_key
- Set up your server script (
server.js
):
- Run the server:
node server.js
- Open
http://localhost:3000
in your browser. - Enter a text prompt and generate images.
- The API might have rate limits.
- Ensure your API key has the necessary permissions.
- For best results, experiment with different prompts.
This project is under the MIT License.