Skip to content

Commit

Permalink
Merge pull request #1461 from damarudhvarma/AI-Image-Generator
Browse files Browse the repository at this point in the history
AI Image Generator
  • Loading branch information
Kushal997-das authored Oct 22, 2024
2 parents 7e3aba6 + 0ee2230 commit cade00b
Show file tree
Hide file tree
Showing 28 changed files with 8,045 additions and 2 deletions.
24 changes: 24 additions & 0 deletions Web Development/Intermediate/AI Image Generator/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local
.env
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
78 changes: 78 additions & 0 deletions Web Development/Intermediate/AI Image Generator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# AI Image Generator Project

In this AI Image Generator project, I have utilized the **Hugging Face API** based on the **StableDiffusion** model along with **Aceternity UI**. The user-provided prompt is processed to generate an image.

## Tools & Technologies Used

- **Build Tool**: Vite
- **API**: Hugging Face API
- **Server**: Express
- **UI**: Aceternity UI

## Project Setup

### Clone the Repository

```
git clone <repository-url>
```

## Frontend Setup :

```
cd <repository-directory>
```

## create .env at root of the folder

```
VITE_HOST= your server URL
```

### Starting Frontend :

```
npm i
npm run dev
```

## Backend Setup :

### Get API KEY:

#### from : [Hugging Face](https://huggingface.co)

### Navigate to Server:

```
cd server
```

### Create a "public" folder at the root of server

### After obtaining your API key, add it to the .env file located in the server directory:

```
API_KEY=your_api_key_here
FRONTEND_URL=""
```

### Starting Backend :

```
npm install
npx nodemon index.js
```

## Demo video

Demo Video [Here](https://drive.google.com/file/d/15PmkjI34Wo2k6_bGK53dmWar4GSQ99WU/view?usp=drive_link)

## Hosted LInk

[Here](https://ai-image-generator-frontend-5712.onrender.com/).

## Acknowledgements

- [Hugging Face](https://huggingface.co) for the StableDiffusion model.
- [Aceternity UI](https://www.aceternity.com) for UI components.
20 changes: 20 additions & 0 deletions Web Development/Intermediate/AI Image Generator/components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "default",
"rsc": true,
"tsx": false,
"tailwind": {
"config": "tailwind.config.js",
"css": "src/App.css",
"baseColor": "slate",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"examples": "@/components/examples",
"blocks": "@/components/blocks"
}
}
38 changes: 38 additions & 0 deletions Web Development/Intermediate/AI Image Generator/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import js from '@eslint/js'
import globals from 'globals'
import react from 'eslint-plugin-react'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'

export default [
{ ignores: ['dist'] },
{
files: ['**/*.{js,jsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parserOptions: {
ecmaVersion: 'latest',
ecmaFeatures: { jsx: true },
sourceType: 'module',
},
},
settings: { react: { version: '18.3' } },
plugins: {
react,
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...js.configs.recommended.rules,
...react.configs.recommended.rules,
...react.configs['jsx-runtime'].rules,
...reactHooks.configs.recommended.rules,
'react/jsx-no-target-blank': 'off',
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
},
]
13 changes: 13 additions & 0 deletions Web Development/Intermediate/AI Image Generator/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
13 changes: 13 additions & 0 deletions Web Development/Intermediate/AI Image Generator/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"compilerOptions": {

"baseUrl": ".",
"paths": {
"@/*": [
"./src/*"
]
}

}
}

Loading

0 comments on commit cade00b

Please sign in to comment.