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 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:[email protected]/spaces/mantrakp/demo main
 
15
  - name: Sync to hf space
16
  env:
17
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
18
+ run: git push https://mantrakp:[email protected]/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