Skip to content

GizzYii/AI-Image-Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Image Generator (Local Version)

This is a locally running AI Image Generator built using Hugging Face Inference API and Node.js/Express.
The project is designed for learning purposes, so you can explore how AI image generation works, practice frontend-backend integration, and understand responsive design — all without deploying anything online.

It's perfect for anyone who wants to experiment locally and learn how to run a full-stack AI project on their own machine.

⚡ How It Works

  1. User enters a text prompt or selects a random example prompt.
  2. User chooses a model, image count, and aspect ratio.
  3. Frontend sends a POST request to the backend /api/generate endpoint.
  4. Backend uses Hugging Face API to generate images.
  5. Generated images are returned as Base64 and displayed in the gallery.

🛠️ Technologies Used

  • Backend: Node.js, Express, dotenv, CORS
  • Frontend: HTML, CSS, JavaScript
  • AI API: Hugging Face Inference API (Nebius provider)
  • Others: Font Awesome icons for UI, responsive CSS grid

Features & Learning Highlights

  • AI Image Generation: Generate images from text prompts using Hugging Face models.
  • Local Server: Express server (server.js) handles API requests locally.
  • Responsive Frontend: Dynamic gallery, image cards, and grid layout adapt to any screen size.
  • Interactive UI: Select model, image count, and aspect ratio; click "Generate" to see results instantly.
  • Light/Dark Mode: Toggle themes and persist preference using localStorage.
  • Image Download: Download generated images directly from the gallery.
  • Learning-Oriented: Designed to help you practice and understand:
    • Local API setup with Express
    • Frontend-backend communication
    • Handling base64 images in JavaScript
    • Responsive CSS grids and interactive UI elements
    • Managing state, async operations, and error handling in JS


💻 Installation & Setup

  1. Clone the repository:
git clone https://github.com/username/ai-image-generator.git

About

AI Image Generator using Hugging Face Inference API with Node.js backend and HTML/CSS/JS frontend. Generate images from text prompts in multiple models and aspect ratios.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors