barreloflube
commited on
Commit
β’
ce40b40
1
Parent(s):
742f08c
Refactor UI structure and add image tab
Browse files- Refactored the UI structure to improve code organization and maintainability.
- Added a new image tab to the UI, allowing users to interact with image-related functionalities.
- .github/workflows/hf-space.yml +1 -1
- README.md +1 -1
- app.py +49 -0
- requirements.txt +1 -0
- src/ui/__init__.py +1 -0
- src/ui/audios.py +0 -0
- src/ui/images.py +14 -0
- src/ui/tabs/__init__.py +1 -0
- src/ui/tabs/images/flux_tab.py +8 -0
- src/ui/talkinghead.py +0 -0
- src/ui/texts.py +0 -0
- src/ui/videos.py +0 -0
.github/workflows/hf-space.yml
CHANGED
@@ -15,4 +15,4 @@ jobs:
|
|
15 |
- name: Sync to hf space
|
16 |
env:
|
17 |
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
18 |
-
run: git push https://mantrakp:$HF_TOKEN@huggingface.co/spaces/mantrakp/
|
|
|
15 |
- name: Sync to hf space
|
16 |
env:
|
17 |
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
18 |
+
run: git push https://mantrakp:$HF_TOKEN@huggingface.co/spaces/mantrakp/aai main
|
README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
---
|
2 |
title: Aai
|
3 |
-
emoji:
|
4 |
colorFrom: gray
|
5 |
colorTo: pink
|
6 |
sdk: gradio
|
|
|
1 |
---
|
2 |
title: Aai
|
3 |
+
emoji: π
|
4 |
colorFrom: gray
|
5 |
colorTo: pink
|
6 |
sdk: gradio
|
app.py
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
from src.ui import (
|
4 |
+
image_tab,
|
5 |
+
)
|
6 |
+
|
7 |
+
|
8 |
+
css = """
|
9 |
+
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');
|
10 |
+
body {
|
11 |
+
font-family: 'Poppins', sans-serif !important;
|
12 |
+
}
|
13 |
+
.center-content {
|
14 |
+
text-align: center;
|
15 |
+
max-width: 600px;
|
16 |
+
margin: 0 auto;
|
17 |
+
padding: 20px;
|
18 |
+
}
|
19 |
+
.center-content h1 {
|
20 |
+
font-weight: 600;
|
21 |
+
margin-bottom: 1rem;
|
22 |
+
}
|
23 |
+
.center-content p {
|
24 |
+
margin-bottom: 1.5rem;
|
25 |
+
}
|
26 |
+
"""
|
27 |
+
|
28 |
+
|
29 |
+
# Main Gradio app
|
30 |
+
with gr.Blocks(theme=gr.themes.Soft(), css=css) as demo:
|
31 |
+
# Header
|
32 |
+
with gr.Column(elem_classes="center-content"):
|
33 |
+
gr.Markdown("""
|
34 |
+
# π AAI: All AI
|
35 |
+
Unleash your creativity with our multi-modal AI platform.
|
36 |
+
""")
|
37 |
+
|
38 |
+
# Tabs
|
39 |
+
with gr.Tabs():
|
40 |
+
with gr.Tab(label="πΌοΈ Image"):
|
41 |
+
image_tab()
|
42 |
+
with gr.Tab(label="π΅ Audio"):
|
43 |
+
gr.Label("Coming soon!")
|
44 |
+
with gr.Tab(label="π¬ Video"):
|
45 |
+
gr.Label("Coming soon!")
|
46 |
+
with gr.Tab(label="π Text"):
|
47 |
+
gr.Label("Coming soon!")
|
48 |
+
|
49 |
+
demo.launch(share=True)
|
requirements.txt
CHANGED
@@ -1,3 +1,4 @@
|
|
1 |
torch
|
2 |
torchvision
|
3 |
torchaudio
|
|
|
|
1 |
torch
|
2 |
torchvision
|
3 |
torchaudio
|
4 |
+
gradio
|
src/ui/__init__.py
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
from .images import image_tab
|
src/ui/audios.py
ADDED
File without changes
|
src/ui/images.py
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
|
3 |
+
import gradio as gr
|
4 |
+
|
5 |
+
from .tabs import (
|
6 |
+
flux_tab,
|
7 |
+
)
|
8 |
+
|
9 |
+
def image_tab():
|
10 |
+
with gr.Tabs():
|
11 |
+
with gr.Tab(label="Flux"):
|
12 |
+
flux_tab()
|
13 |
+
with gr.Tab(label="SDXL"):
|
14 |
+
gr.Label("Coming soon!")
|
src/ui/tabs/__init__.py
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
from .images.flux_tab import flux_tab
|
src/ui/tabs/images/flux_tab.py
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
def flux_tab():
|
4 |
+
with gr.Column():
|
5 |
+
prompt = gr.Textbox(lines=5, label="Prompt")
|
6 |
+
with gr.Column():
|
7 |
+
with gr.Group():
|
8 |
+
output_image = gr.Image()
|
src/ui/talkinghead.py
ADDED
File without changes
|
src/ui/texts.py
ADDED
File without changes
|
src/ui/videos.py
ADDED
File without changes
|