-
-
Notifications
You must be signed in to change notification settings - Fork 411
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1461 from damarudhvarma/AI-Image-Generator
AI Image Generator
- Loading branch information
Showing
28 changed files
with
8,045 additions
and
2 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
Web Development/Intermediate/AI Image Generator/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
20
Web Development/Intermediate/AI Image Generator/components.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
38
Web Development/Intermediate/AI Image Generator/eslint.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
13
Web Development/Intermediate/AI Image Generator/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
13
Web Development/Intermediate/AI Image Generator/jsconfig.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"compilerOptions": { | ||
|
||
"baseUrl": ".", | ||
"paths": { | ||
"@/*": [ | ||
"./src/*" | ||
] | ||
} | ||
|
||
} | ||
} | ||
|
Oops, something went wrong.